Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Nov 18, 2022

Conversation

lemontree210
Copy link
Member

@lemontree210 lemontree210 commented Nov 11, 2022

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
Copy link
Member Author

lemontree210 commented Nov 11, 2022

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 lemontree210 marked this pull request as ready for review November 11, 2022 14:41
@lemontree210 lemontree210 marked this pull request as draft November 11, 2022 14:46
@harshil21 harshil21 added this to the v20.0a5 milestone Nov 11, 2022
@harshil21 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
@lemontree210 lemontree210 marked this pull request as ready for review November 12, 2022 12:04
@lemontree210
Copy link
Member Author

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

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

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

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.

@lemontree210
Copy link
Member Author

lemontree210 commented Nov 17, 2022

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 :)

@Bibo-Joshi Bibo-Joshi merged commit 0cc1d03 into api_6.3_update Nov 18, 2022
@Bibo-Joshi Bibo-Joshi deleted the new_classes_for_api_6.3 branch November 18, 2022 15:57
@github-actions github-actions bot locked and limited conversation to collaborators Nov 25, 2022
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