FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

New classes for API 6.3: `ForumTopic`, `ForumTopicCreated`, `ForumTopicClosed`, `ForumTopicReopened` by lemontree210 · Pull Request #3356 · python-telegram-bot/python-telegram-bot · GitHub

New classes for API 6.3: ForumTopic, ForumTopicCreated, ForumTopicClosed, ForumTopicReopened - #3356

Merged
Bibo-Joshi merged 33 commits into
api_6.3_updatefrom
new_classes_for_api_6.3
Nov 18, 2022
Merged

New classes for API 6.3: ForumTopic, ForumTopicCreated, ForumTopicClosed, ForumTopicReopened#3356
Bibo-Joshi merged 33 commits into
api_6.3_updatefrom
new_classes_for_api_6.3

Conversation

lemontree210 commented Nov 11, 2022
edited by Bibo-Joshi
Loading

Copy link
Copy Markdown
Member

addresses #3340

  • create new classes ForumTopic, ForumTopicCreated, empty classes
    ForumTopicClosed, ForumTopicReopened
  • add arguments and attributes to Message: forum_topic_created, forum_topic_closed, forum_topic_reopened
  • update docs
  • add tests
    • to_dict, __eq__ etc. for each class
    • createForumTopic
    • editForumTopic
    • closeForumTopic
    • reopenForumTopic
    • deleteForumTopic (I test it in the fixture)
    • unpinAllForumTopicMessages (test created but triggers telegram.error.BadRequest: Chat_not_modified.)
    • getForumTopicIconStickers
  • add filters

lemontree210 commented Nov 11, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

Actually, again, maybe the tests are worth adding when the methods are there, so it might make sense to review this as it is, then hopefully merge, and then we'll add tests with real methods.

lemontree210 marked this pull request as ready for review November 11, 2022 14:41
lemontree210 marked this pull request as draft November 11, 2022 14:46
harshil21 added this to the v20.0a5 milestone Nov 11, 2022
harshil21 added the ⚙️ bot-api affected functionality: bot-api label Nov 11, 2022
…Created`

+ change docstring for the module

will add tests for `ForumTopic` later on
Comment thread telegram/_forumtopic.py Outdated
Comment thread telegram/_forumtopic.py Outdated
Comment thread telegram/_forumtopic.py Outdated
lemontree210 marked this pull request as ready for review November 12, 2022 12:04
Comment thread docs/source/telegram.rst Outdated
Comment thread telegram/_forumtopic.py Outdated
Comment thread telegram/_forumtopic.py Outdated
Comment thread telegram/_message.py Outdated
Comment thread telegram/_message.py Outdated
Comment thread telegram/_message.py Outdated
Comment thread telegram/_message.py
Comment thread tests/test_forum.py Outdated
Comment thread telegram/_forumtopic.py Outdated

Copy link
Copy Markdown
Member Author

This seems ready to be merged if there are no other comments.

harshil21 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Now that all 7 forum methods have been implemented upstream, test_forum.py should be updated to test that.

Also we can add filters for the new status messages (ForumTopicCreated, etc). See filters.StatusUpdate as examples on how to add them, it's fairly straightforward.

Comment thread tests/test_forum.py Outdated
Comment thread tests/test_forum.py Outdated
Comment thread tests/test_forum.py Outdated

lemontree210 commented Nov 17, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

I'm having trouble adding a test for ForumTopicCreated. My idea is that I should create a topic, then get updates, check the last Message and make sure it contains a service message in forum_topic_created attribute with the correct topic name. Somehow it doesn't work though, which maybe depends on how bot fixture works. (I do get service messages, but old ones.)

I tried to see how it was done for other classes representing service messages, but tests for classes like VideoChatScheduled, MessageAutoDeleteTimerChanged and others only seem to test slots, equality etc., but not the fact of the service message actually being issued. So I'm struggling to find any relevant examples to follow here :)

Comment thread tests/test_forum.py Outdated
Bibo-Joshi merged commit 0cc1d03 into api_6.3_update Nov 18, 2022
Bibo-Joshi deleted the new_classes_for_api_6.3 branch November 18, 2022 15:57
github-actions Bot locked and limited conversation to collaborators Nov 25, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ bot-api affected functionality: bot-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL