botapi-py 1.5.13__tar.gz → 1.5.14__tar.gz
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.
- {botapi_py-1.5.13 → botapi_py-1.5.14}/PKG-INFO +1 -1
- {botapi_py-1.5.13 → botapi_py-1.5.14}/pyproject.toml +1 -1
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/core.py +4 -4
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/__init__.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/__init__.pyi +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/bot.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/dispatchers/__init__.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/dispatchers/__init__.pyi +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/dispatchers/common.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/dispatchers/get_updates_handler.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/dispatchers/redis_pubsub_handler.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/enums.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/errors.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/internals.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/methods.py +0 -0
- {botapi_py-1.5.13 → botapi_py-1.5.14}/src/botapi/types.py +0 -0
|
@@ -75,6 +75,10 @@ class BaseBot:
|
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
+
# `exclude_none` only applies to model fields, not to the keys of a plain dict, and httpx
|
|
79
|
+
# encodes a `None` value as an empty string, so Telegram would see the param as present.
|
|
80
|
+
serialized_data = {key: value for key, value in serialized_data.items() if value is not None}
|
|
81
|
+
|
|
78
82
|
# Telegram requires root-level lists/dicts to be JSON encoded strings.
|
|
79
83
|
for key, value in serialized_data.items():
|
|
80
84
|
if isinstance(value, (dict, list)):
|
|
@@ -86,10 +90,6 @@ class BaseBot:
|
|
|
86
90
|
'''
|
|
87
91
|
Sends a POST request to the Telegram Bot API.
|
|
88
92
|
'''
|
|
89
|
-
# TODO: request fix on the botAPI server, or fix in a cleaner way...
|
|
90
|
-
if 'receiver_user_id' in data and data['receiver_user_id'] is None:
|
|
91
|
-
del data['receiver_user_id']
|
|
92
|
-
|
|
93
93
|
converted_data, files = self._convert_data(data)
|
|
94
94
|
|
|
95
95
|
request = await self.session.post(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|