pyTelegramBotAPI 4.25.0__py3-none-any.whl → 4.26.0__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
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pyTelegramBotAPI
3
- Version: 4.25.0
3
+ Version: 4.26.0
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
@@ -8,6 +8,7 @@ Project-URL: Repository, https://github.com/eternnoir/pyTelegramBotAPI
8
8
  Project-URL: Issues, https://github.com/eternnoir/pyTelegramBotAPI/issues
9
9
  Author-email: eternnoir <eternnoir@gmail.com>
10
10
  License: GPL2
11
+ License-File: LICENSE
11
12
  Keywords: api,bot,telegram,tools
12
13
  Classifier: Development Status :: 5 - Production/Stable
13
14
  Classifier: Environment :: Console
@@ -52,7 +53,7 @@ Description-Content-Type: text/markdown
52
53
  <p align="center">A simple, but extensible Python implementation for the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
53
54
  <p align="center">Both synchronous and asynchronous.</p>
54
55
 
55
- ## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#november-17-2024"><img src="https://img.shields.io/badge/Bot%20API-8.1-blue?logo=telegram" alt="Supported Bot API version"></a>
56
+ ## <p align="center">Supported Bot API version: <a href="https://core.telegram.org/bots/api#january-1-2025"><img src="https://img.shields.io/badge/Bot%20API-8.2-blue?logo=telegram" alt="Supported Bot API version"></a>
56
57
 
57
58
  <h2><a href='https://pytba.readthedocs.io/en/latest/index.html'>Official documentation</a></h2>
58
59
  <h2><a href='https://pytba.readthedocs.io/ru/latest/index.html'>Official ru documentation</a></h2>
@@ -1,17 +1,17 @@
1
- telebot/__init__.py,sha256=a57ZJyp8GP-r-MiC5ecygZphIbWgNS8pMCOLd5TuSSM,432408
2
- telebot/apihelper.py,sha256=alfT2M1viZVOmDFMHb_Mdh5JeP4EE2mzZOnlvhGpBoM,100182
3
- telebot/async_telebot.py,sha256=qSENsVubvmCIXBn8-YARFLeha8IlDaNhgSDF9fVybc8,405457
1
+ telebot/__init__.py,sha256=ZQtRT7eeEcZ8PH640XvIlzqHnB3TBk5k7KjZF2U-xzs,435648
2
+ telebot/apihelper.py,sha256=N89dapRPfv3TfA7_YqZZpolJ5C_bTLrZRUW6klzd6J0,101613
3
+ telebot/async_telebot.py,sha256=IC197RbcdRLLSsgtVhkKNCEkwBZ8Yp3vBhFWc7BurCg,408733
4
4
  telebot/asyncio_filters.py,sha256=w63xFjFnXtr4oo3Kqx1Fs485vQxNCgXZs1ukdkNcnEA,12854
5
5
  telebot/asyncio_handler_backends.py,sha256=BWS7zr93FJNZJmPHBoXo4i_PIHGlmrEoWy1miXax9aI,2785
6
- telebot/asyncio_helper.py,sha256=SzBRMAhMr0A6gL3qnyoNJUNvOkXn28sVrytjhuRWZqM,101072
6
+ telebot/asyncio_helper.py,sha256=HCfTkX0_o4US2Mp5xCrbb6BPEZX5cgKXxCp--1ZxYFo,102561
7
7
  telebot/callback_data.py,sha256=k4Rz3lAONG5J2M9TESKMIjqXoBNJMfEy9nnrmJAyi3Q,5358
8
8
  telebot/custom_filters.py,sha256=ncF8_zwlSqkuATI46Xc6HQ5Y1ZoQ1fO6AlcRbs7bO3U,12975
9
9
  telebot/formatting.py,sha256=UFZTRSX-DMcALmaQ7xztHObop8DWeCtHdKsOoGLgDY0,15172
10
10
  telebot/handler_backends.py,sha256=lyKu0PaH2c4y5FfyQS3M9tOyBJ8ATjxHZkATzu01XpE,7969
11
11
  telebot/service_utils.py,sha256=xLmlZLTVs34UOdQtMvwduor8hnLxQCx8iJ92wDGl2Mw,2053
12
- telebot/types.py,sha256=lA3JYmLYBHcjzustmFaflPSwKXj5BOLzcWdSCSt2Mbo,474882
12
+ telebot/types.py,sha256=3iDuL1CBMfH7FUITdxOAa04AQwswEBKXgswUMwwacaE,475305
13
13
  telebot/util.py,sha256=ylRtI4DI4I1BJAF2Ack7WyGbTN1cRkubUCbhLNiiPj4,21385
14
- telebot/version.py,sha256=CFmNAe1WwcbIebAfVhERMAnvhFbYytIkUtMZMvGQQ7c,99
14
+ telebot/version.py,sha256=PVbmIN1Rpi1DPItgqp-6XAZxaknSOoqK63cBImPFerg,99
15
15
  telebot/asyncio_storage/__init__.py,sha256=fraOWJby1ddJmPAXf1oXWmZJXRodSpING17MF875NPI,433
16
16
  telebot/asyncio_storage/base_storage.py,sha256=I-NII9ZMCxCHStPc-73qSyQhjBtkhNzb2IcZPhjR1Eg,3243
17
17
  telebot/asyncio_storage/memory_storage.py,sha256=h8yc2xpfLmbcBjPmKkqNhZtUtpNQ7EuKIfMGue61e7w,5849
@@ -35,7 +35,7 @@ telebot/storage/base_storage.py,sha256=WzGgSflKzcn2ENsgz1Q-D_v-ZKCtnMOURGOHIwNJ0
35
35
  telebot/storage/memory_storage.py,sha256=-r1vuIt1YHq9btkr6E7BCu4Do-wUDlNcttG22SSgEYo,5799
36
36
  telebot/storage/pickle_storage.py,sha256=wjFuRxSBeCMB3h-fUqLgqe2XcZoc6-ixkN5qsm3th9I,7136
37
37
  telebot/storage/redis_storage.py,sha256=DReU2lc8cI0f3XMIT1N9-suGZ6jE8H9I_mapK3A-lyE,9450
38
- pytelegrambotapi-4.25.0.dist-info/METADATA,sha256=5ihfiBhE_mcs7oLTcB7-rddg33a6qyurCqj642X3Ugo,48123
39
- pytelegrambotapi-4.25.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
40
- pytelegrambotapi-4.25.0.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
41
- pytelegrambotapi-4.25.0.dist-info/RECORD,,
38
+ pytelegrambotapi-4.26.0.dist-info/METADATA,sha256=74lUQzeDkW4EQE2QFlnleOTIR5y7tMFaVfZJttC6K1U,48143
39
+ pytelegrambotapi-4.26.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
40
+ pytelegrambotapi-4.26.0.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
41
+ pytelegrambotapi-4.26.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.26.3
2
+ Generator: hatchling 1.27.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
telebot/__init__.py CHANGED
@@ -5474,7 +5474,7 @@ class TeleBot:
5474
5474
  (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
5475
5475
  :type prices: :obj:`list` of :obj:`types.LabeledPrice`
5476
5476
 
5477
- :subscription_period: The number of seconds the subscription will be active for before the next payment.
5477
+ :param subscription_period: The number of seconds the subscription will be active for before the next payment.
5478
5478
  The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always
5479
5479
  be 2592000 (30 days) if specified.
5480
5480
  :type subscription_period: :obj:`int`
@@ -6250,7 +6250,8 @@ class TeleBot:
6250
6250
  """
6251
6251
  return apihelper.delete_sticker_set(self.token, name)
6252
6252
 
6253
- def send_gift(self, user_id: int, gift_id: str, text: Optional[str]=None, text_parse_mode: Optional[str]=None, text_entities: Optional[List[types.MessageEntity]]=None) -> bool:
6253
+ def send_gift(self, user_id: int, gift_id: str, text: Optional[str]=None, text_parse_mode: Optional[str]=None,
6254
+ text_entities: Optional[List[types.MessageEntity]]=None, pay_for_upgrade: Optional[bool]=None) -> bool:
6254
6255
  """
6255
6256
  Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.
6256
6257
 
@@ -6262,6 +6263,9 @@ class TeleBot:
6262
6263
  :param gift_id: Identifier of the gift
6263
6264
  :type gift_id: :obj:`str`
6264
6265
 
6266
+ :param pay_for_upgrade: Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
6267
+ :type pay_for_upgrade: :obj:`bool`
6268
+
6265
6269
  :param text: Text that will be shown along with the gift; 0-255 characters
6266
6270
  :type text: :obj:`str`
6267
6271
 
@@ -6274,7 +6278,71 @@ class TeleBot:
6274
6278
  :return: Returns True on success.
6275
6279
  :rtype: :obj:`bool`
6276
6280
  """
6277
- return apihelper.send_gift(self.token, user_id, gift_id, text=text, text_parse_mode=text_parse_mode, text_entities=text_entities)
6281
+ return apihelper.send_gift(self.token, user_id, gift_id, text=text, text_parse_mode=text_parse_mode, text_entities=text_entities,
6282
+ pay_for_upgrade=pay_for_upgrade)
6283
+
6284
+ def verify_user(self, user_id: int, custom_description: Optional[str]=None) -> bool:
6285
+ """
6286
+ Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
6287
+
6288
+ Telegram documentation: https://core.telegram.org/bots/api#verifyuser
6289
+
6290
+ :param user_id: Unique identifier of the target user
6291
+ :type user_id: :obj:`int`
6292
+
6293
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
6294
+ :type custom_description: :obj:`str`
6295
+
6296
+ :return: Returns True on success.
6297
+ :rtype: :obj:`bool`
6298
+ """
6299
+ return apihelper.verify_user(self.token, user_id, custom_description=custom_description)
6300
+
6301
+ def verify_chat(self, chat_id: Union[int, str], custom_description: Optional[str]=None) -> bool:
6302
+ """
6303
+ Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
6304
+
6305
+ Telegram documentation: https://core.telegram.org/bots/api#verifychat
6306
+
6307
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
6308
+ :type chat_id: :obj:`int` | :obj:`str`
6309
+
6310
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
6311
+ :type custom_description: :obj:`str`
6312
+
6313
+ :return: Returns True on success.
6314
+ :rtype: :obj:`bool`
6315
+ """
6316
+ return apihelper.verify_chat(self.token, chat_id, custom_description=custom_description)
6317
+
6318
+ def remove_user_verification(self, user_id: int) -> bool:
6319
+ """
6320
+ Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
6321
+
6322
+ Telegram documentation: https://core.telegram.org/bots/api#removeuserverification
6323
+
6324
+ :param user_id: Unique identifier of the target user
6325
+ :type user_id: :obj:`int`
6326
+
6327
+ :return: Returns True on success.
6328
+ :rtype: :obj:`bool`
6329
+ """
6330
+
6331
+ return apihelper.remove_user_verification(self.token, user_id)
6332
+
6333
+ def remove_chat_verification(self, chat_id: Union[int, str]) -> bool:
6334
+ """
6335
+ Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
6336
+
6337
+ Telegram documentation: https://core.telegram.org/bots/api#removechatverification
6338
+
6339
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
6340
+ :type chat_id: :obj:`int` | :obj:`str`
6341
+
6342
+ :return: Returns True on success.
6343
+ :rtype: :obj:`bool`
6344
+ """
6345
+ return apihelper.remove_chat_verification(self.token, chat_id)
6278
6346
 
6279
6347
  def get_available_gifts(self) -> types.Gifts:
6280
6348
  """
telebot/apihelper.py CHANGED
@@ -1929,7 +1929,7 @@ def get_available_gifts(token):
1929
1929
  return _make_request(token, method_url)
1930
1930
 
1931
1931
 
1932
- def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, text_entities=None):
1932
+ def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, text_entities=None, pay_for_upgrade=None):
1933
1933
  method_url = 'sendGift'
1934
1934
  payload = {'user_id': user_id, 'gift_id': gift_id}
1935
1935
  if text:
@@ -1938,6 +1938,36 @@ def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, text_ent
1938
1938
  payload['text_parse_mode'] = text_parse_mode
1939
1939
  if text_entities:
1940
1940
  payload['text_entities'] = json.dumps(types.MessageEntity.to_list_of_dicts(text_entities))
1941
+ if pay_for_upgrade is not None:
1942
+ payload['pay_for_upgrade'] = pay_for_upgrade
1943
+ return _make_request(token, method_url, params=payload, method='post')
1944
+
1945
+
1946
+ def verify_user(token, user_id, custom_description=None):
1947
+ method_url = 'verifyUser'
1948
+ payload = {'user_id': user_id}
1949
+ if custom_description:
1950
+ payload['custom_description'] = custom_description
1951
+ return _make_request(token, method_url, params=payload, method='post')
1952
+
1953
+
1954
+ def verify_chat(token, chat_id, custom_description=None):
1955
+ method_url = 'verifyChat'
1956
+ payload = {'chat_id': chat_id}
1957
+ if custom_description:
1958
+ payload['custom_description'] = custom_description
1959
+ return _make_request(token, method_url, params=payload, method='post')
1960
+
1961
+
1962
+ def remove_user_verification(token, user_id):
1963
+ method_url = 'removeUserVerification'
1964
+ payload = {'user_id': user_id}
1965
+ return _make_request(token, method_url, params=payload, method='post')
1966
+
1967
+
1968
+ def remove_chat_verification(token, chat_id):
1969
+ method_url = 'removeChatVerification'
1970
+ payload = {'chat_id': chat_id}
1941
1971
  return _make_request(token, method_url, params=payload, method='post')
1942
1972
 
1943
1973
  def set_sticker_emoji_list(token, sticker, emoji_list):
@@ -2271,6 +2301,12 @@ def convert_input_media_array(array):
2271
2301
  if media_dict['media'].startswith('attach://'):
2272
2302
  key = media_dict['media'].replace('attach://', '')
2273
2303
  files[key] = input_media.media
2304
+ if 'thumbnail' in media_dict:
2305
+ thumbnail = media_dict['thumbnail']
2306
+ if isinstance(thumbnail, types.InputFile):
2307
+ thumbnail_key = 'thumbnail_' + key
2308
+ files[thumbnail_key] = thumbnail
2309
+ media_dict['thumbnail'] = 'attach://' + thumbnail_key
2274
2310
  media.append(media_dict)
2275
2311
  return json.dumps(media), files
2276
2312
 
telebot/async_telebot.py CHANGED
@@ -6922,7 +6922,7 @@ class AsyncTeleBot:
6922
6922
  (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
6923
6923
  :type prices: :obj:`list` of :obj:`types.LabeledPrice`
6924
6924
 
6925
- :subscription_period: The number of seconds the subscription will be active for before the next payment.
6925
+ :param subscription_period: The number of seconds the subscription will be active for before the next payment.
6926
6926
  The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always
6927
6927
  be 2592000 (30 days) if specified.
6928
6928
  :type subscription_period: :obj:`int`
@@ -7707,7 +7707,8 @@ class AsyncTeleBot:
7707
7707
 
7708
7708
  return await asyncio_helper.delete_sticker_set(self.token, name)
7709
7709
 
7710
- async def send_gift(self, user_id: int, gift_id: str, text: Optional[str]=None, text_parse_mode: Optional[str]=None, text_entities: Optional[List[types.MessageEntity]]=None) -> bool:
7710
+ async def send_gift(self, user_id: int, gift_id: str, text: Optional[str]=None, text_parse_mode: Optional[str]=None,
7711
+ text_entities: Optional[List[types.MessageEntity]]=None, pay_for_upgrade: Optional[bool]=None) -> bool:
7711
7712
  """
7712
7713
  Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.
7713
7714
 
@@ -7719,6 +7720,9 @@ class AsyncTeleBot:
7719
7720
  :param gift_id: Identifier of the gift
7720
7721
  :type gift_id: :obj:`str`
7721
7722
 
7723
+ :param pay_for_upgrade: Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
7724
+ :type pay_for_upgrade: :obj:`bool`
7725
+
7722
7726
  :param text: Text that will be shown along with the gift; 0-255 characters
7723
7727
  :type text: :obj:`str`
7724
7728
 
@@ -7731,7 +7735,71 @@ class AsyncTeleBot:
7731
7735
  :return: Returns True on success.
7732
7736
  :rtype: :obj:`bool`
7733
7737
  """
7734
- return await asyncio_helper.send_gift(self.token, user_id, gift_id, text, text_parse_mode, text_entities)
7738
+ return await asyncio_helper.send_gift(self.token, user_id, gift_id, text, text_parse_mode, text_entities, pay_for_upgrade=pay_for_upgrade)
7739
+
7740
+ async def verify_user(self, user_id: int, custom_description: Optional[str]=None) -> bool:
7741
+ """
7742
+ Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
7743
+
7744
+ Telegram documentation: https://core.telegram.org/bots/api#verifyuser
7745
+
7746
+ :param user_id: Unique identifier of the target user
7747
+ :type user_id: :obj:`int`
7748
+
7749
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
7750
+ :type custom_description: :obj:`str`
7751
+
7752
+ :return: Returns True on success.
7753
+ :rtype: :obj:`bool`
7754
+ """
7755
+ return await asyncio_helper.verify_user(self.token, user_id, custom_description=custom_description)
7756
+
7757
+ async def verify_chat(self, chat_id: Union[int, str], custom_description: Optional[str]=None) -> bool:
7758
+ """
7759
+ Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
7760
+
7761
+ Telegram documentation: https://core.telegram.org/bots/api#verifychat
7762
+
7763
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
7764
+ :type chat_id: :obj:`int` | :obj:`str`
7765
+
7766
+ :param custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
7767
+ :type custom_description: :obj:`str`
7768
+
7769
+ :return: Returns True on success.
7770
+ :rtype: :obj:`bool`
7771
+ """
7772
+
7773
+ return await asyncio_helper.verify_chat(self.token, chat_id, custom_description=custom_description)
7774
+
7775
+ async def remove_user_verification(self, user_id: int) -> bool:
7776
+ """
7777
+ Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
7778
+
7779
+ Telegram documentation: https://core.telegram.org/bots/api#removeuserverification
7780
+
7781
+ :param user_id: Unique identifier of the target user
7782
+ :type user_id: :obj:`int`
7783
+
7784
+ :return: Returns True on success.
7785
+ :rtype: :obj:`bool`
7786
+
7787
+ """
7788
+ return await asyncio_helper.remove_user_verification(self.token, user_id)
7789
+
7790
+ async def remove_chat_verification(self, chat_id: Union[int, str]) -> bool:
7791
+ """
7792
+ Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
7793
+
7794
+ Telegram documentation: https://core.telegram.org/bots/api#removechatverification
7795
+
7796
+ :param chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
7797
+ :type chat_id: :obj:`int` | :obj:`str`
7798
+
7799
+ :return: Returns True on success.
7800
+ :rtype: :obj:`bool`
7801
+ """
7802
+ return await asyncio_helper.remove_chat_verification(self.token, chat_id)
7735
7803
 
7736
7804
  async def get_available_gifts(self) -> types.Gifts:
7737
7805
  """
telebot/asyncio_helper.py CHANGED
@@ -1916,7 +1916,7 @@ async def delete_sticker_set(token, name):
1916
1916
  payload = {'name': name}
1917
1917
  return await _process_request(token, method_url, params=payload, method='post')
1918
1918
 
1919
- async def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, text_entities=None):
1919
+ async def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, text_entities=None, pay_for_upgrade=None):
1920
1920
  method_url = 'sendGift'
1921
1921
  payload = {'user_id': user_id, 'gift_id': gift_id}
1922
1922
  if text:
@@ -1925,6 +1925,32 @@ async def send_gift(token, user_id, gift_id, text=None, text_parse_mode=None, te
1925
1925
  payload['text_parse_mode'] = text_parse_mode
1926
1926
  if text_entities:
1927
1927
  payload['text_entities'] = json.dumps(types.MessageEntity.to_list_of_dicts(text_entities))
1928
+ if pay_for_upgrade is not None:
1929
+ payload['pay_for_upgrade'] = pay_for_upgrade
1930
+ return await _process_request(token, method_url, params=payload, method='post')
1931
+
1932
+ async def verify_user(token, user_id, custom_description=None):
1933
+ method_url = 'verifyUser'
1934
+ payload = {'user_id': user_id}
1935
+ if custom_description:
1936
+ payload['custom_description'] = custom_description
1937
+ return await _process_request(token, method_url, params=payload, method='post')
1938
+
1939
+ async def verify_chat(token, chat_id, custom_description=None):
1940
+ method_url = 'verifyChat'
1941
+ payload = {'chat_id': chat_id}
1942
+ if custom_description:
1943
+ payload['custom_description'] = custom_description
1944
+ return await _process_request(token, method_url, params=payload, method='post')
1945
+
1946
+ async def remove_user_verification(token, user_id):
1947
+ method_url = 'removeUserVerification'
1948
+ payload = {'user_id': user_id}
1949
+ return await _process_request(token, method_url, params=payload, method='post')
1950
+
1951
+ async def remove_chat_verification(token, chat_id):
1952
+ method_url = 'removeChatVerification'
1953
+ payload = {'chat_id': chat_id}
1928
1954
  return await _process_request(token, method_url, params=payload, method='post')
1929
1955
 
1930
1956
  async def get_available_gifts(token):
@@ -2243,6 +2269,12 @@ async def convert_input_media_array(array):
2243
2269
  if media_dict['media'].startswith('attach://'):
2244
2270
  key = media_dict['media'].replace('attach://', '')
2245
2271
  files[key] = input_media.media
2272
+ if 'thumbnail' in media_dict:
2273
+ thumbnail = media_dict['thumbnail']
2274
+ if isinstance(thumbnail, types.InputFile):
2275
+ thumbnail_key = 'thumbnail_' + key
2276
+ files[thumbnail_key] = thumbnail
2277
+ media_dict['thumbnail'] = 'attach://' + thumbnail_key
2246
2278
  media.append(media_dict)
2247
2279
  return json.dumps(media), files
2248
2280
 
telebot/types.py CHANGED
@@ -4449,6 +4449,10 @@ class InlineQueryResultArticle(InlineQueryResultBase):
4449
4449
  self.thumbnail_width: Optional[int] = thumbnail_width
4450
4450
  self.thumbnail_height: Optional[int] = thumbnail_height
4451
4451
 
4452
+ if hide_url:
4453
+ log_deprecation_warning('The parameter "hide_url" is deprecated. Pass an empty string as url instead.')
4454
+ self.url = ''
4455
+
4452
4456
 
4453
4457
  @property
4454
4458
  def thumb_url(self) -> str:
@@ -11059,6 +11063,9 @@ class Gift(JsonDeserializable):
11059
11063
  :param star_count: The number of Telegram Stars that must be paid to send the sticker
11060
11064
  :type star_count: :obj:`int`
11061
11065
 
11066
+ :param upgrade_star_count: Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one
11067
+ :type upgrade_star_count: :obj:`int`
11068
+
11062
11069
  :param total_count: Optional. The total number of the gifts of this type that can be sent; for limited gifts only
11063
11070
  :type total_count: :obj:`int`
11064
11071
 
@@ -11069,12 +11076,13 @@ class Gift(JsonDeserializable):
11069
11076
  :rtype: :class:`Gift`
11070
11077
  """
11071
11078
 
11072
- def __init__(self, id, sticker, star_count, total_count=None, remaining_count=None, **kwargs):
11079
+ def __init__(self, id, sticker, star_count, total_count=None, remaining_count=None, upgrade_star_count=None, **kwargs):
11073
11080
  self.id: str = id
11074
11081
  self.sticker: Sticker = sticker
11075
11082
  self.star_count: int = star_count
11076
11083
  self.total_count: Optional[int] = total_count
11077
11084
  self.remaining_count: Optional[int] = remaining_count
11085
+ self.upgrade_star_count: Optional[int] = upgrade_star_count
11078
11086
 
11079
11087
  @classmethod
11080
11088
  def de_json(cls, json_string):
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.25.0'
3
+ __version__ = '4.26.0'