-
Notifications
You must be signed in to change notification settings - Fork 2.1k
More changes from review of bot api 6.6 #1952
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
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7c7a063
Fix some code hints
Badiboy e56c60a
thumb deprecation typo and thumb->thumbnail param rename
Badiboy 6a9c25c
Fix set_sticker_set_thumb and set_sticker_set_thumbnail
Badiboy b0740a9
Set "thumb" as property in types
Badiboy c9ef0d7
Deprecation warnings equalisation
Badiboy fe2e9a7
thumb_url etc. converted to properties
Badiboy 14434b3
send_animation thumbnail hint
Badiboy b0e64d8
send_video thumbnail hint
Badiboy f3486b3
send_document thumbnail
Badiboy 018b89c
send_document thumbnail
Badiboy 46100ed
send_video_note thumbnail hint
Badiboy 6b5c263
send_animtion thumbnail hint
Badiboy b1c172c
send_document thumbnail hint
Badiboy 39360e0
send_video thumbnail hint
Badiboy dc98aca
Merge remote-tracking branch 'upstream/master'
Badiboy 8b63f6a
Merge branch 'master' of https://github.com/Badiboy/pyTelegramBotAPI
Badiboy 2e589ab
Thumb type spec
Badiboy 3f07dc4
thumb
Badiboy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -451,7 +451,7 @@ def run_webhooks(self, | |||||
| drop_pending_updates: Optional[bool] = None, | ||||||
| timeout: Optional[int]=None, | ||||||
| secret_token: Optional[str]=None, | ||||||
| secret_token_length: Optional[int]=20,): | ||||||
| secret_token_length: Optional[int]=20): | ||||||
| """ | ||||||
| This class sets webhooks and listens to a given url and port. | ||||||
|
|
||||||
|
|
@@ -1028,7 +1028,7 @@ def polling(self, non_stop: Optional[bool]=False, skip_pending: Optional[bool]=F | |||||
| :return: | ||||||
| """ | ||||||
| if none_stop is not None: | ||||||
| logger.warning("polling: none_stop parameter is deprecated. Use non_stop instead.") | ||||||
| logger.warning('The parameter "none_stop" is deprecated. Use "non_stop" instead.') | ||||||
| non_stop = none_stop | ||||||
|
|
||||||
| if skip_pending: | ||||||
|
|
@@ -1892,7 +1892,7 @@ def send_audio( | |||||
| The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. | ||||||
| Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, | ||||||
| so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name> | ||||||
| :type thumbnail: :obj:`str` | ||||||
| :type thumbnail: :obj:`str` or :class:`telebot.types.InputFile` | ||||||
|
|
||||||
| :param caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode | ||||||
| :type caption_entities: :obj:`list` of :class:`telebot.types.MessageEntity` | ||||||
|
|
@@ -1906,6 +1906,9 @@ def send_audio( | |||||
| :param message_thread_id: Identifier of a message thread, in which the message will be sent | ||||||
| :type message_thread_id: :obj:`int` | ||||||
|
|
||||||
| :param thumb: Deprecated. Use thumbnail instead | ||||||
| :type thumb: :obj:`str` or :class:`telebot.types.InputFile` | ||||||
|
|
||||||
| :return: On success, the sent Message is returned. | ||||||
| :rtype: :class:`telebot.types.Message` | ||||||
| """ | ||||||
|
|
@@ -1916,7 +1919,7 @@ def send_audio( | |||||
|
|
||||||
| if thumb is not None and thumbnail is None: | ||||||
| thumbnail = thumb | ||||||
| logger.warning('thumb is deprecated, use thumbnail instead') | ||||||
| logger.warning('The parameter "thumb" is deprecated. Use "thumbnail" instead.') | ||||||
|
|
||||||
| return types.Message.de_json( | ||||||
| apihelper.send_audio( | ||||||
|
|
@@ -2072,6 +2075,9 @@ def send_document( | |||||
| :param message_thread_id: The thread to which the message will be sent | ||||||
| :type message_thread_id: :obj:`int` | ||||||
|
|
||||||
| :param thumb: Deprecated. Use thumbnail instead | ||||||
| :type thumb: :obj:`str` or :class:`telebot.types.InputFile` | ||||||
|
|
||||||
| :return: On success, the sent Message is returned. | ||||||
| :rtype: :class:`telebot.types.Message` | ||||||
| """ | ||||||
|
|
@@ -2082,17 +2088,18 @@ def send_document( | |||||
|
|
||||||
| if data and not(document): | ||||||
| # function typo miss compatibility | ||||||
| logger.warning('The parameter "data" is deprecated. Use "document" instead.') | ||||||
| document = data | ||||||
|
|
||||||
| if thumb is not None and thumbnail is None: | ||||||
| thumbnail = thumb | ||||||
| logger.warning('thumb is deprecated, use thumbnail instead') | ||||||
| logger.warning('The parameter "thumb" is deprecated. Use "thumbnail" instead.') | ||||||
|
|
||||||
| return types.Message.de_json( | ||||||
| apihelper.send_data( | ||||||
| self.token, chat_id, document, 'document', | ||||||
| reply_to_message_id = reply_to_message_id, reply_markup = reply_markup, parse_mode = parse_mode, | ||||||
| disable_notification = disable_notification, timeout = timeout, caption = caption, thumb = thumbnail, | ||||||
| disable_notification = disable_notification, timeout = timeout, caption = caption, thumbnail= thumbnail, | ||||||
| caption_entities = caption_entities, allow_sending_without_reply = allow_sending_without_reply, | ||||||
| disable_content_type_detection = disable_content_type_detection, visible_file_name = visible_file_name, | ||||||
| protect_content = protect_content, message_thread_id = message_thread_id)) | ||||||
|
|
@@ -2162,6 +2169,7 @@ def send_sticker( | |||||
|
|
||||||
| if data and not(sticker): | ||||||
| # function typo miss compatibility | ||||||
| logger.warning('The parameter "data" is deprecated. Use "sticker" instead.') | ||||||
| sticker = data | ||||||
|
|
||||||
| return types.Message.de_json( | ||||||
|
|
@@ -2256,6 +2264,9 @@ def send_video( | |||||
| :param has_spoiler: Pass True, if the video should be sent as a spoiler | ||||||
| :type has_spoiler: :obj:`bool` | ||||||
|
|
||||||
| :param thumb: Deprecated. Use thumbnail instead | ||||||
| :type thumb: :obj:`str` or :class:`telebot.types.InputFile` | ||||||
|
|
||||||
Badiboy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| :return: On success, the sent Message is returned. | ||||||
| :rtype: :class:`telebot.types.Message` | ||||||
| """ | ||||||
|
|
@@ -2266,11 +2277,12 @@ def send_video( | |||||
|
|
||||||
| if data and not(video): | ||||||
| # function typo miss compatibility | ||||||
| logger.warning('The parameter "data" is deprecated. Use "video" instead.') | ||||||
| video = data | ||||||
|
|
||||||
| if thumb is not None and thumbnail is None: | ||||||
| thumbnail = thumb | ||||||
| logger.warning('thumb is deprecated, use thumbnail instead') | ||||||
| logger.warning('The parameter "thumb" is deprecated. Use "thumbnail" instead.') | ||||||
|
|
||||||
| return types.Message.de_json( | ||||||
| apihelper.send_video( | ||||||
|
|
@@ -2359,6 +2371,9 @@ def send_animation( | |||||
| :param has_spoiler: Pass True, if the animation should be sent as a spoiler | ||||||
| :type has_spoiler: :obj:`bool` | ||||||
|
|
||||||
| :param thumb: Deprecated. Use thumbnail instead | ||||||
| :type thumb: :obj:`str` or :class:`telebot.types.InputFile` | ||||||
|
|
||||||
Badiboy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| :return: On success, the sent Message is returned. | ||||||
| :rtype: :class:`telebot.types.Message` | ||||||
| """ | ||||||
|
|
@@ -2438,6 +2453,8 @@ def send_video_note( | |||||
| :param message_thread_id: Identifier of a message thread, in which the video note will be sent | ||||||
| :type message_thread_id: :obj:`int` | ||||||
|
|
||||||
| :param thumb: Deprecated. Use thumbnail instead | ||||||
|
|
||||||
|
||||||
| :type thumb: :obj:`str` or :class:`telebot.types.InputFile` |
Badiboy marked this conversation as resolved.
Show resolved
Hide resolved
Badiboy marked this conversation as resolved.
Show resolved
Hide resolved
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.