pyTelegramBotAPI 4.19.0__py3-none-any.whl → 4.19.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyTelegramBotAPI
3
- Version: 4.19.0
3
+ Version: 4.19.2
4
4
  Summary: Python Telegram bot api.
5
5
  Project-URL: Homepage, https://github.com/eternnoir/pyTelegramBotAPI
6
6
  Project-URL: Documentation, https://pytba.readthedocs.org
@@ -307,7 +307,7 @@ Handle shipping queries
307
307
  `@bot.shipping_query_handler() # <- passes a ShippingQuery type object to your function`
308
308
 
309
309
  #### Pre Checkout Query Handler
310
- Handle pre checkoupt queries
310
+ Handle pre checkout queries
311
311
  `@bot.pre_checkout_query_handler() # <- passes a PreCheckoutQuery type object to your function`
312
312
 
313
313
  #### Poll Handler
@@ -348,7 +348,7 @@ def query_text(inline_query):
348
348
 
349
349
  #### Chosen Inline handler
350
350
 
351
- Use chosen_inline_handler to get chosen_inline_result in telebot. Don't forgot add the /setinlinefeedback
351
+ Use chosen_inline_handler to get chosen_inline_result in telebot. Don't forget to add the /setinlinefeedback
352
352
  command for @Botfather.
353
353
 
354
354
  More information : [collecting-feedback](https://core.telegram.org/bots/inline#collecting-feedback)
@@ -1,6 +1,6 @@
1
- telebot/__init__.py,sha256=sEwkrswslHkU8BxRBNsutGSti7aDhOIGIuLUg277HcU,399051
2
- telebot/apihelper.py,sha256=KpA-LFS1B8DjcJrI0d8KHbA_WExDnMf6umQ5OA3H3PE,90915
3
- telebot/async_telebot.py,sha256=6WGXtMw7gDT9wsRijfAX4zSENF9wKW124UyCFE0cy1M,371829
1
+ telebot/__init__.py,sha256=G9UOw1DyZI7JfrmURasDulP5Ln3-kszg_pZZyoM77Zo,399109
2
+ telebot/apihelper.py,sha256=vXonQN8LoMJZo46yQsOXnWKqzy4rc5c0U0EmcXadZ6Q,91062
3
+ telebot/async_telebot.py,sha256=h_bu81HiDLJsWbYZHSk2Md6TfYh0e80H5ak04MUXITw,371749
4
4
  telebot/asyncio_filters.py,sha256=jALxGtTpsN6sFtpy7vEXSXTFuVTS9qTZ4lik1AQJo6I,13012
5
5
  telebot/asyncio_handler_backends.py,sha256=SRUJ3ADC5PNYZGaOYRxlik1PrR8UtVEZ7769_f3u3HQ,3756
6
6
  telebot/asyncio_helper.py,sha256=iHB9qNDhIow0i9jBR4ih62bJkbuVfkbwAeJqK1TG44M,91722
@@ -9,9 +9,9 @@ telebot/custom_filters.py,sha256=CJ1HEJ4k2QWvGAKVE_A51csGO3dmrOw0QB12rSbnr5g,131
9
9
  telebot/formatting.py,sha256=tvaGzSXzSVokuLiUSUiX39If2XNGuGSHhkOH8YkvBDI,14747
10
10
  telebot/handler_backends.py,sha256=tqp9pCKnM9GKSIgjvgF8m0sR9mZdwi2olACplIuCBlw,8915
11
11
  telebot/service_utils.py,sha256=y8-Q-iVhD0crX54Sqf3kZD9aLH9y1kYuxDDzil7zG2Y,1969
12
- telebot/types.py,sha256=VLfWc9jl8zxrKwbGzdVAEkG_p2lYzIBdAEaI4L7t6N4,422836
12
+ telebot/types.py,sha256=TWSicH_dL0naVOumoRr7eQL3ciz6ny0x0zpFS1Jzl3Q,422423
13
13
  telebot/util.py,sha256=XrBpCYBUWGSr7TvR6HIZSsstWqpdrxRKKh3YEodDOfI,20780
14
- telebot/version.py,sha256=enWhCayIOkhAWhj1mHizSfbvwq_M5kEZZFktsgeLHKg,99
14
+ telebot/version.py,sha256=r6jMn0S6vlfPiWDI2dTjYVHAWajlsPBiIUmgs7SYeqs,99
15
15
  telebot/asyncio_storage/__init__.py,sha256=g2PQQF0shmBxL8APFRHUxDiKquRpFoDAZZrUcHc3T6k,425
16
16
  telebot/asyncio_storage/base_storage.py,sha256=Dj00wiTqQIiQ_pjm8f8hoCR6-eOSgvvV5CldfUBV6Vg,1808
17
17
  telebot/asyncio_storage/memory_storage.py,sha256=SiIkFMMUNg2_p5wJ2M3BPXn_i4V0JH-LVAqAov17S_E,2396
@@ -28,7 +28,7 @@ telebot/storage/base_storage.py,sha256=nZRL7iOVbi82phlCrnOu4nD1kIR_z093WvKm7r8mC
28
28
  telebot/storage/memory_storage.py,sha256=7s3SMrVUZuyhEKE8TwCUL4m6a58U9793bU6Y1qI0i_U,2377
29
29
  telebot/storage/pickle_storage.py,sha256=8Tx4tXFjYaP6uiJOdqfx7O-Od4PW9Z0NYMIpoGHUfuQ,3949
30
30
  telebot/storage/redis_storage.py,sha256=6kueJ4oRvtsbnR5d_Hxkv3x85lXqa735tbyIg_ZsHs4,5593
31
- pytelegrambotapi-4.19.0.dist-info/METADATA,sha256=7w_MYz9-zage5dScRliakp3aIDbtsm6M_n002E650cE,48128
32
- pytelegrambotapi-4.19.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
33
- pytelegrambotapi-4.19.0.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
34
- pytelegrambotapi-4.19.0.dist-info/RECORD,,
31
+ pytelegrambotapi-4.19.2.dist-info/METADATA,sha256=kK_prgdGst_gCQDBnMI_64e0Z6J3g3aQsVgf15f_HLs,48130
32
+ pytelegrambotapi-4.19.2.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
33
+ pytelegrambotapi-4.19.2.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
34
+ pytelegrambotapi-4.19.2.dist-info/RECORD,,
telebot/__init__.py CHANGED
@@ -1874,7 +1874,6 @@ class TeleBot:
1874
1874
 
1875
1875
  :return: On success, the MessageId of the sent message is returned.
1876
1876
  :rtype: :class:`telebot.types.MessageID`
1877
-
1878
1877
  """
1879
1878
 
1880
1879
  disable_notification = self.disable_notification if (disable_notification is None) else disable_notification
@@ -1903,7 +1902,8 @@ class TeleBot:
1903
1902
  apihelper.copy_message(self.token, chat_id, from_chat_id, message_id, caption=caption,
1904
1903
  parse_mode=parse_mode, caption_entities=caption_entities, disable_notification=disable_notification,
1905
1904
  reply_markup=reply_markup, timeout=timeout, protect_content=protect_content,
1906
- message_thread_id=message_thread_id, reply_parameters=reply_parameters, show_caption_above_media=show_caption_above_media))
1905
+ message_thread_id=message_thread_id, reply_parameters=reply_parameters,
1906
+ show_caption_above_media=show_caption_above_media))
1907
1907
 
1908
1908
 
1909
1909
  def delete_message(self, chat_id: Union[int, str], message_id: int,
@@ -1950,13 +1950,13 @@ class TeleBot:
1950
1950
  :type message_ids: :obj:`list` of :obj:`int`
1951
1951
 
1952
1952
  :return: Returns True on success.
1953
-
1954
1953
  """
1955
1954
  return apihelper.delete_messages(self.token, chat_id, message_ids)
1956
1955
 
1957
1956
 
1958
- def forward_messages(self, chat_id: Union[str, int], from_chat_id: Union[str, int], message_ids: List[int], disable_notification: Optional[bool]=None,
1959
- message_thread_id: Optional[int]=None, protect_content: Optional[bool]=None) -> List[types.MessageID]:
1957
+ def forward_messages(self, chat_id: Union[str, int], from_chat_id: Union[str, int], message_ids: List[int],
1958
+ disable_notification: Optional[bool]=None, message_thread_id: Optional[int]=None,
1959
+ protect_content: Optional[bool]=None) -> List[types.MessageID]:
1960
1960
  """
1961
1961
  Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped.
1962
1962
  Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages.
@@ -2237,9 +2237,9 @@ class TeleBot:
2237
2237
  self.token, chat_id, photo, caption=caption, reply_markup=reply_markup,
2238
2238
  parse_mode=parse_mode, disable_notification=disable_notification, timeout=timeout,
2239
2239
  caption_entities=caption_entities, protect_content=protect_content,
2240
- message_thread_id=message_thread_id, has_spoiler=has_spoiler, reply_parameters=reply_parameters, business_connection_id=business_connection_id,
2241
- message_effect_id=message_effect_id, show_caption_above_media=show_caption_above_media))
2242
-
2240
+ message_thread_id=message_thread_id, has_spoiler=has_spoiler, reply_parameters=reply_parameters,
2241
+ business_connection_id=business_connection_id, message_effect_id=message_effect_id,
2242
+ show_caption_above_media=show_caption_above_media))
2243
2243
 
2244
2244
 
2245
2245
  def send_audio(
@@ -5540,7 +5540,8 @@ class TeleBot:
5540
5540
 
5541
5541
  result = apihelper.edit_message_caption(
5542
5542
  self.token, caption, chat_id=chat_id, message_id=message_id, inline_message_id=inline_message_id,
5543
- parse_mode=parse_mode, caption_entities=caption_entities, reply_markup=reply_markup, show_caption_above_media=show_caption_above_media)
5543
+ parse_mode=parse_mode, caption_entities=caption_entities, reply_markup=reply_markup,
5544
+ show_caption_above_media=show_caption_above_media)
5544
5545
 
5545
5546
  if type(result) == bool:
5546
5547
  return result
telebot/apihelper.py CHANGED
@@ -428,7 +428,7 @@ def forward_message(
428
428
 
429
429
  def copy_message(token, chat_id, from_chat_id, message_id, caption=None, parse_mode=None, caption_entities=None,
430
430
  disable_notification=None, reply_markup=None, timeout=None, protect_content=None, message_thread_id=None,
431
- reply_parameters=None):
431
+ reply_parameters=None, show_caption_above_media=None):
432
432
  method_url = r'copyMessage'
433
433
  payload = {'chat_id': chat_id, 'from_chat_id': from_chat_id, 'message_id': message_id}
434
434
  if caption is not None:
@@ -449,6 +449,8 @@ def copy_message(token, chat_id, from_chat_id, message_id, caption=None, parse_m
449
449
  payload['protect_content'] = protect_content
450
450
  if message_thread_id is not None:
451
451
  payload['message_thread_id'] = message_thread_id
452
+ if show_caption_above_media is not None:
453
+ payload['show_caption_above_media'] = show_caption_above_media
452
454
  return _make_request(token, method_url, params=payload)
453
455
 
454
456
 
@@ -485,8 +487,8 @@ def send_photo(
485
487
  caption=None, reply_markup=None,
486
488
  parse_mode=None, disable_notification=None, timeout=None,
487
489
  caption_entities=None, protect_content=None,
488
- message_thread_id=None, has_spoiler=None, reply_parameters=None, business_connection_id=None, message_effect_id=None,
489
- show_caption_above_media=None):
490
+ message_thread_id=None, has_spoiler=None, reply_parameters=None, business_connection_id=None,
491
+ message_effect_id=None, show_caption_above_media=None):
490
492
  method_url = r'sendPhoto'
491
493
  payload = {'chat_id': chat_id}
492
494
  files = None
@@ -715,8 +717,8 @@ def send_chat_action(token, chat_id, action, timeout=None, message_thread_id=Non
715
717
  def send_video(token, chat_id, data, duration=None, caption=None, reply_markup=None,
716
718
  parse_mode=None, supports_streaming=None, disable_notification=None, timeout=None,
717
719
  thumbnail=None, width=None, height=None, caption_entities=None, protect_content=None,
718
- message_thread_id=None, has_spoiler=None, reply_parameters=None, business_connection_id=None, message_effect_id=None,
719
- show_caption_above_media=None):
720
+ message_thread_id=None, has_spoiler=None, reply_parameters=None, business_connection_id=None,
721
+ message_effect_id=None, show_caption_above_media=None):
720
722
  method_url = r'sendVideo'
721
723
  payload = {'chat_id': chat_id}
722
724
  files = None
telebot/async_telebot.py CHANGED
@@ -523,7 +523,6 @@ class AsyncTeleBot:
523
523
  if isinstance(middleware_result, CancelUpdate):
524
524
  return
525
525
  elif isinstance(middleware_result, SkipHandler):
526
- await middleware.post_process(message, data, handler_error)
527
526
  skip_handlers = True
528
527
 
529
528
  if handlers and not(skip_handlers):
@@ -3440,8 +3439,8 @@ class AsyncTeleBot:
3440
3439
  """
3441
3440
  disable_notification = self.disable_notification if disable_notification is None else disable_notification
3442
3441
  protect_content = self.protect_content if protect_content is None else protect_content
3443
- result = await asyncio_helper.copy_messages(self.token, chat_id, from_chat_id, message_ids, disable_notification,
3444
- protect_content, message_thread_id, remove_caption)
3442
+ result = await asyncio_helper.copy_messages(self.token, chat_id, from_chat_id, message_ids, disable_notification, message_thread_id,
3443
+ protect_content, remove_caption)
3445
3444
  return [types.MessageID.de_json(message_id) for message_id in result]
3446
3445
 
3447
3446
  async def send_dice(
telebot/types.py CHANGED
@@ -9121,13 +9121,8 @@ class UsersShared(JsonDeserializable):
9121
9121
  :param request_id: Identifier of the request
9122
9122
  :type request_id: :obj:`int`
9123
9123
 
9124
- :param user_ids: Array of :obj:`types.SharedUser` of the shared users. These numbers may have more than 32 significant bits
9125
- and some programming languages may have difficulty/silent defects in interpreting them.
9126
- But they have at most 52 significant bits, so 64-bit integers or double-precision float
9127
- types are safe for storing these identifiers. The bot may not have access to the users and
9128
- could be unable to use these identifiers unless the users are already known to the bot by
9129
- some other means.
9130
- :type user_ids: :obj:`list` of :obj:`types.SharedUser`
9124
+ :param users: Information about users shared with the bot
9125
+ :type users: :obj:`list` of :obj:`types.SharedUser`
9131
9126
 
9132
9127
  :return: Instance of the class
9133
9128
  :rtype: :class:`UsersShared`
@@ -9136,20 +9131,23 @@ class UsersShared(JsonDeserializable):
9136
9131
  def de_json(cls, json_string):
9137
9132
  if json_string is None: return None
9138
9133
  obj = cls.check_json(json_string)
9139
-
9140
- obj['user_ids'] = [SharedUser.de_json(user) for user in obj['user_ids']]
9141
-
9134
+ obj['users'] = [SharedUser.de_json(user) for user in obj['users']]
9142
9135
  return cls(**obj)
9143
9136
 
9144
- def __init__(self, request_id, user_ids: SharedUser, **kwargs):
9137
+ def __init__(self, request_id, users: List[SharedUser], **kwargs):
9145
9138
  self.request_id = request_id
9146
- self.user_ids = user_ids
9139
+ self.users = users
9147
9140
 
9148
9141
  @property
9149
9142
  def user_id(self):
9150
9143
  logger.warning('The parameter "user_id" is deprecated, use "user_ids" instead')
9151
9144
  return None
9152
-
9145
+
9146
+ @property
9147
+ def user_ids(self):
9148
+ logger.warning('The parameter "user_ids" is deprecated, use "users" instead')
9149
+ return self.users
9150
+
9153
9151
 
9154
9152
  class ChatBoostUpdated(JsonDeserializable):
9155
9153
  """
telebot/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # Versions should comply with PEP440.
2
2
  # This line is parsed in setup.py:
3
- __version__ = '4.19.0'
3
+ __version__ = '4.19.2'