pyTelegramBotAPI 4.37.0__py3-none-any.whl → 4.37.1__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.5
2
2
  Name: pyTelegramBotAPI
3
- Version: 4.37.0
3
+ Version: 4.37.1
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
@@ -14,12 +14,12 @@ Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Environment :: Console
15
15
  Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
16
16
  Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
20
19
  Classifier: Programming Language :: Python :: 3.13
21
20
  Classifier: Programming Language :: Python :: 3.14
22
- Requires-Python: >=3.10
21
+ Classifier: Programming Language :: Python :: 3.15
22
+ Requires-Python: >=3.11
23
23
  Requires-Dist: aiohttp
24
24
  Requires-Dist: requests
25
25
  Provides-Extra: coloredlogs
@@ -111,7 +111,7 @@ Description-Content-Type: text/markdown
111
111
 
112
112
  ## Getting started
113
113
 
114
- This API is tested with Python 3.10-3.14 and PyPy 3.
114
+ This API is tested with Python 3.11-3.15 and PyPy 3.
115
115
  There are two ways to install the library:
116
116
 
117
117
  * Installation using pip (a Python package manager):
@@ -1,6 +1,6 @@
1
- telebot/__init__.py,sha256=7mDjyaAgs4CgLrtjrnTsXvAKo34nbl7yIuNEKYBDMPg,562113
1
+ telebot/__init__.py,sha256=2SsPwhB8UML0e5T3Ky3eIhkEmk3LQSrFSxgc7KLc5Pc,562113
2
2
  telebot/apihelper.py,sha256=Ao-eapo79Ysp9KST2tKcR1YfxWpn0B6xpzyUk5f06yQ,140974
3
- telebot/async_telebot.py,sha256=xTi_DuY6u9MT38_M1w6ZXzju2LYpBlP1kGmP6lK7EHg,537190
3
+ telebot/async_telebot.py,sha256=PeEZqp7E88iOi9bzzAOfazMX04GU8xd9Jgz4-pVBTxw,537190
4
4
  telebot/asyncio_filters.py,sha256=UM5AznjF5Ffym20_linOvqn5mHy5KfXy9MdKjFbKtcQ,12857
5
5
  telebot/asyncio_handler_backends.py,sha256=BWS7zr93FJNZJmPHBoXo4i_PIHGlmrEoWy1miXax9aI,2785
6
6
  telebot/asyncio_helper.py,sha256=xYvish7W7q1Xcjtly0j0MHtT1JUiQkO7d54kc1YZYSA,142499
@@ -10,9 +10,9 @@ telebot/formatting.py,sha256=hIaE3IiiumD6tf-X8DSDvFQyGHPq48nmEdLVJcr_nKQ,15950
10
10
  telebot/handler_backends.py,sha256=HORSAir-CdgbN8TdVDhuJ4rDXT5ogB8BQ4dEAeaanig,7986
11
11
  telebot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  telebot/service_utils.py,sha256=y8-Q-iVhD0crX54Sqf3kZD9aLH9y1kYuxDDzil7zG2Y,1969
13
- telebot/types.py,sha256=pKFzu0navifeiKVEmmNDkqeV5q4JI3s7oM2MjKmZ6fg,763105
13
+ telebot/types.py,sha256=-yrhBRXVL3DcdWmxKlFK9gUogahqSXIuZVyeJmph8KI,763024
14
14
  telebot/util.py,sha256=W9jWbz6zzzy8PI5zHL4oFrUHf7TLo0ZBj-bjIUi2RmY,23683
15
- telebot/version.py,sha256=rQ-4AlkAjhTay5AosMA42HSxkOhF4DoFpkkyZo54UIQ,99
15
+ telebot/version.py,sha256=myepnwNGh8WUuHu8AvQ4b-yeXqAFzIRWR-6-ywnVXhQ,99
16
16
  telebot/asyncio_storage/__init__.py,sha256=DpVFdTvFpJveTbHY2CezqGWjHKjG__qMdmJvFEc_ekw,446
17
17
  telebot/asyncio_storage/base_storage.py,sha256=T5FWpT057w-FSbprDBCEY2P1wzdrYoe8yonBOJLpSQs,3966
18
18
  telebot/asyncio_storage/memory_storage.py,sha256=XQO8hYPBOenrv8KHd3Bzj8Eg7OCmvJV4rbmKJPl5eB0,6074
@@ -27,7 +27,7 @@ telebot/ext/sync/webhooks.py,sha256=XMMhXnDuFs7CWJ7iDi11H0dwf6fRA4pbAjFjNgNJ18Y,
27
27
  telebot/states/__init__.py,sha256=LHXRkVrbx8ig_UBtNeYKLdF3HkkzJzkKs2EU23bhwiI,4529
28
28
  telebot/states/asyncio/__init__.py,sha256=GOj426jeWP2nuScz4SPRY3FcWZ9V7jE0iUR0B_spyUw,139
29
29
  telebot/states/asyncio/context.py,sha256=Mk8rgTmlM-cdpsN6GKUratJE4E6wkzjGo2PyLYtedw4,5101
30
- telebot/states/asyncio/middleware.py,sha256=JNaDTJ-rE_J6X4UfS0F8rIKUWYrCw5GowdJ8MnRFAzA,751
30
+ telebot/states/asyncio/middleware.py,sha256=z47uHMYScV25v7Z5KEb07iXq0VBj4IrHiqYbIILG3UI,733
31
31
  telebot/states/sync/__init__.py,sha256=4uC-5KHK3h2rsFcv98pDcLI3dzPet0aRB8x-2M0sMWE,137
32
32
  telebot/states/sync/context.py,sha256=Re5448GjbI_GfKpJh-MeDKDNHxodr7y2dTpgERcrB1s,4873
33
33
  telebot/states/sync/middleware.py,sha256=lkstXtC_35bZAajVeMkdepbVNK1Yir3XApDzEnMnIiM,701
@@ -36,7 +36,7 @@ telebot/storage/base_storage.py,sha256=Xcgb2LdGV_5L16W1TnRXG0tvkopNCf9xh37ri1Xza
36
36
  telebot/storage/memory_storage.py,sha256=PNDLz67TMioY_A-po9la4-qblIdoCERh7fHU18KqIeU,6024
37
37
  telebot/storage/pickle_storage.py,sha256=6vvR8vzNE0SUKiAYP_bM3Cx9if4-xLNOMkHvJtdgbM4,7399
38
38
  telebot/storage/redis_storage.py,sha256=WY8khaSVmEkJO6kQbQ-t916564BIwX2kinUMg_wLLDM,9774
39
- pytelegrambotapi-4.37.0.dist-info/METADATA,sha256=kg-R-Z0nxohGahDVSBikOQ5ouaOwhdJ7ZfAB-N80y_o,48286
40
- pytelegrambotapi-4.37.0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
41
- pytelegrambotapi-4.37.0.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
42
- pytelegrambotapi-4.37.0.dist-info/RECORD,,
39
+ pytelegrambotapi-4.37.1.dist-info/METADATA,sha256=sw1wrdtv9bDLaxDQ7EmmX1IfMANvmTR73rAbJ1q2OBc,48286
40
+ pytelegrambotapi-4.37.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
41
+ pytelegrambotapi-4.37.1.dist-info/licenses/LICENSE,sha256=qz_jTTxi4zSAFaTdASiwml2iAk0UZ6R4MRADNzwYo_A,18387
42
+ pytelegrambotapi-4.37.1.dist-info/RECORD,,
telebot/__init__.py CHANGED
@@ -7447,7 +7447,7 @@ class TeleBot:
7447
7447
 
7448
7448
 
7449
7449
  def answer_callback_query(
7450
- self, callback_query_id: int,
7450
+ self, callback_query_id: str,
7451
7451
  text: Optional[str]=None, show_alert: Optional[bool]=None,
7452
7452
  url: Optional[str]=None, cache_time: Optional[int]=None) -> bool:
7453
7453
  """
@@ -7457,7 +7457,7 @@ class TeleBot:
7457
7457
  Telegram documentation: https://core.telegram.org/bots/api#answercallbackquery
7458
7458
 
7459
7459
  :param callback_query_id: Unique identifier for the query to be answered
7460
- :type callback_query_id: :obj:`int`
7460
+ :type callback_query_id: :obj:`str`
7461
7461
 
7462
7462
  :param text: Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
7463
7463
  :type text: :obj:`str`
telebot/async_telebot.py CHANGED
@@ -9130,7 +9130,7 @@ class AsyncTeleBot:
9130
9130
  return await asyncio_helper.unpin_all_general_forum_topic_messages(self.token, chat_id)
9131
9131
 
9132
9132
  async def answer_callback_query(
9133
- self, callback_query_id: int,
9133
+ self, callback_query_id: str,
9134
9134
  text: Optional[str]=None, show_alert: Optional[bool]=None,
9135
9135
  url: Optional[str]=None, cache_time: Optional[int]=None) -> bool:
9136
9136
  """
@@ -9140,7 +9140,7 @@ class AsyncTeleBot:
9140
9140
  Telegram documentation: https://core.telegram.org/bots/api#answercallbackquery
9141
9141
 
9142
9142
  :param callback_query_id: Unique identifier for the query to be answered
9143
- :type callback_query_id: :obj:`int`
9143
+ :type callback_query_id: :obj:`str`
9144
9144
 
9145
9145
  :param text: Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
9146
9146
  :type text: :obj:`str`
@@ -1,21 +1,21 @@
1
- from telebot.asyncio_handler_backends import BaseMiddleware
2
- from telebot.async_telebot import AsyncTeleBot
3
- from telebot.states.sync.context import StateContext
4
- from telebot.util import update_types
5
- from telebot import types
6
-
7
-
8
- class StateMiddleware(BaseMiddleware):
9
-
10
- def __init__(self, bot: AsyncTeleBot) -> None:
11
- self.update_sensitive = False
12
- self.update_types = update_types
13
- self.bot: AsyncTeleBot = bot
14
-
15
- async def pre_process(self, message, data):
16
- state_context = StateContext(message, self.bot)
17
- data["state_context"] = state_context
18
- data["state"] = state_context # 2 ways to access state context
19
-
20
- async def post_process(self, message, data, exception):
21
- pass
1
+ from telebot.asyncio_handler_backends import BaseMiddleware
2
+ from telebot.async_telebot import AsyncTeleBot
3
+ from telebot.states.asyncio.context import StateContext
4
+ from telebot.util import update_types
5
+ from telebot import types
6
+
7
+
8
+ class StateMiddleware(BaseMiddleware):
9
+
10
+ def __init__(self, bot: AsyncTeleBot) -> None:
11
+ self.update_sensitive = False
12
+ self.update_types = update_types
13
+ self.bot: AsyncTeleBot = bot
14
+
15
+ async def pre_process(self, message, data):
16
+ state_context = StateContext(message, self.bot)
17
+ data["state_context"] = state_context
18
+ data["state"] = state_context # 2 ways to access state context
19
+
20
+ async def post_process(self, message, data, exception):
21
+ pass
telebot/types.py CHANGED
@@ -14688,16 +14688,17 @@ class RichText(JsonDeserializable, Dictionaryable, ABC):
14688
14688
  if json_string is None: return None
14689
14689
  if isinstance(json_string, str):
14690
14690
  # "...can be either a String for plain text..."
14691
- if (json_string.startswith('{') and json_string.endswith('}')) or (json_string.startswith('[') and json_string.endswith(']')):
14692
- try:
14693
- # Check if string is valid json. If so, assume it's json, not plain string
14694
- json.loads(json_string)
14695
- # If it's valid json, continue to json processing below
14696
- except (ValueError, TypeError, json.JSONDecodeError):
14697
- # If it's not valid json, return the string as is
14698
- return json_string
14699
- else:
14691
+ # Only a JSON object is a serialized RichText. Plain text can look
14692
+ # like JSON too, e.g. a "[56]" footnote mark, and stays text.
14693
+ if not (json_string.startswith('{') and json_string.endswith('}')):
14694
+ return json_string
14695
+ try:
14696
+ parsed = json.loads(json_string)
14697
+ except (ValueError, TypeError):
14698
+ return json_string
14699
+ if not isinstance(parsed, dict):
14700
14700
  return json_string
14701
+ json_string = parsed
14701
14702
  elif isinstance(json_string, list):
14702
14703
  # "...an Array of :class:`RichText`..."
14703
14704
  return [RichText.de_json(item) for item in 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.37.0'
3
+ __version__ = '4.37.1'