-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
API 4.7 #1858
API 4.7 #1858
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments on the code, please excuse my short writing, I'm doing it from my phone.
Unitests are the most missed part here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to comments inline, please check the coverage report, I see some new code is not covered by tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're getting close. a few minor details and we're set to go.
About the not-tested lines:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. We're down to only docstrings 🥳
Lets discuss them over chat and we can merge...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor suggestions
|
||
dice = _Dice() | ||
"""Dice Messages. If an integer or a list of integers is passed, it filters messages to only | ||
allow those whose dice value is appearing in the given list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow those whose dice value is appearing in the given list. | |
allow those with dice where the value is appearing in the given list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this is slightly more accurate, the sentence feels kinda weird to me. And it should be clear from the context, that only dice messages are allowed. I'll not change for now. If this is important to you, you can PR for it ;)
CI fails unrelated. merging. |
Closes #1856
Pure API updates:
Dice
Bot.send_dice
Message.dice
Message.reply_dice
BotCommand
Bot.get_my_commands
Bot.set_my_commands
Bot.commands
propertytgs_sticker
toBot.create_new_sticker_set
tgs_sticker
toBot.add_sticker_to_set
StickerSet.thumb
Bot.set_sticker_set_thumb
Bot.create_new_sticker_set
andBot.add_sticker_to_set
to release notesNew functionality:
Filters.dice
to filter messages containing a diceFilters.dice(1)
andFilters.dice([1, 5])
to filters for dices with specific valuesFilters.text
andMessage.effective_message
?Problems I encountered:
Bot.create_new_sticker_set
was not tested before, I guess because we can't delete packs via the API. So I don't test with the new parameter, either.The resultingBot.upload_sticker_file
seems to accept TGS files aspng_sticker
. I'm jusing it ittest_bot_methods_1_tgs
right now. Also pinged @botsupport about it.file_id
is not validmask_position
foradd_sticker_to_set
was untested. If I see correctly, request posts differently when posting files, which is the case for stickers, and thus themask_position
has to beto_json
-ed manually. Added that and the corresponding test.