telegrinder 0.1.dev158__py3-none-any.whl → 0.1.dev160__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.

Potentially problematic release.


This version of telegrinder might be problematic. Click here for more details.

Files changed (128) hide show
  1. telegrinder/__init__.py +4 -2
  2. telegrinder/api/__init__.py +0 -0
  3. telegrinder/api/abc.py +6 -4
  4. telegrinder/api/api.py +25 -11
  5. telegrinder/api/error.py +0 -0
  6. telegrinder/api/response.py +0 -0
  7. telegrinder/bot/__init__.py +0 -0
  8. telegrinder/bot/bot.py +0 -0
  9. telegrinder/bot/cute_types/__init__.py +0 -0
  10. telegrinder/bot/cute_types/base.py +100 -9
  11. telegrinder/bot/cute_types/callback_query.py +426 -37
  12. telegrinder/bot/cute_types/inline_query.py +44 -17
  13. telegrinder/bot/cute_types/message.py +2885 -117
  14. telegrinder/bot/cute_types/update.py +14 -7
  15. telegrinder/bot/cute_types/utils.py +542 -0
  16. telegrinder/bot/dispatch/__init__.py +0 -0
  17. telegrinder/bot/dispatch/abc.py +0 -0
  18. telegrinder/bot/dispatch/composition.py +0 -0
  19. telegrinder/bot/dispatch/context.py +0 -0
  20. telegrinder/bot/dispatch/dispatch.py +0 -0
  21. telegrinder/bot/dispatch/handler/__init__.py +0 -0
  22. telegrinder/bot/dispatch/handler/abc.py +0 -0
  23. telegrinder/bot/dispatch/handler/func.py +1 -1
  24. telegrinder/bot/dispatch/handler/message_reply.py +0 -0
  25. telegrinder/bot/dispatch/middleware/__init__.py +0 -0
  26. telegrinder/bot/dispatch/middleware/abc.py +0 -0
  27. telegrinder/bot/dispatch/process.py +0 -0
  28. telegrinder/bot/dispatch/return_manager/__init__.py +0 -0
  29. telegrinder/bot/dispatch/return_manager/abc.py +0 -0
  30. telegrinder/bot/dispatch/return_manager/callback_query.py +0 -0
  31. telegrinder/bot/dispatch/return_manager/inline_query.py +0 -0
  32. telegrinder/bot/dispatch/return_manager/message.py +0 -0
  33. telegrinder/bot/dispatch/view/__init__.py +0 -0
  34. telegrinder/bot/dispatch/view/abc.py +40 -29
  35. telegrinder/bot/dispatch/view/box.py +0 -0
  36. telegrinder/bot/dispatch/view/callback_query.py +0 -0
  37. telegrinder/bot/dispatch/view/inline_query.py +0 -0
  38. telegrinder/bot/dispatch/view/message.py +0 -0
  39. telegrinder/bot/dispatch/waiter_machine/__init__.py +0 -0
  40. telegrinder/bot/dispatch/waiter_machine/machine.py +0 -0
  41. telegrinder/bot/dispatch/waiter_machine/middleware.py +0 -0
  42. telegrinder/bot/dispatch/waiter_machine/short_state.py +0 -0
  43. telegrinder/bot/polling/__init__.py +0 -0
  44. telegrinder/bot/polling/abc.py +0 -0
  45. telegrinder/bot/polling/polling.py +7 -11
  46. telegrinder/bot/rules/__init__.py +0 -0
  47. telegrinder/bot/rules/abc.py +1 -1
  48. telegrinder/bot/rules/adapter/__init__.py +0 -0
  49. telegrinder/bot/rules/adapter/abc.py +0 -0
  50. telegrinder/bot/rules/adapter/errors.py +0 -0
  51. telegrinder/bot/rules/adapter/event.py +12 -6
  52. telegrinder/bot/rules/adapter/raw_update.py +0 -0
  53. telegrinder/bot/rules/callback_data.py +3 -11
  54. telegrinder/bot/rules/command.py +0 -0
  55. telegrinder/bot/rules/enum_text.py +0 -0
  56. telegrinder/bot/rules/func.py +0 -0
  57. telegrinder/bot/rules/fuzzy.py +0 -0
  58. telegrinder/bot/rules/inline.py +2 -1
  59. telegrinder/bot/rules/integer.py +0 -0
  60. telegrinder/bot/rules/is_from.py +0 -0
  61. telegrinder/bot/rules/markup.py +3 -1
  62. telegrinder/bot/rules/mention.py +0 -0
  63. telegrinder/bot/rules/message_entities.py +3 -1
  64. telegrinder/bot/rules/regex.py +1 -1
  65. telegrinder/bot/rules/rule_enum.py +0 -0
  66. telegrinder/bot/rules/start.py +0 -0
  67. telegrinder/bot/rules/text.py +0 -0
  68. telegrinder/bot/scenario/__init__.py +0 -0
  69. telegrinder/bot/scenario/abc.py +0 -0
  70. telegrinder/bot/scenario/checkbox.py +0 -0
  71. telegrinder/bot/scenario/choice.py +0 -0
  72. telegrinder/client/__init__.py +2 -2
  73. telegrinder/client/abc.py +35 -12
  74. telegrinder/client/aiohttp.py +35 -22
  75. telegrinder/model.py +70 -23
  76. telegrinder/modules.py +22 -12
  77. telegrinder/msgspec_json.py +0 -0
  78. telegrinder/msgspec_utils.py +30 -10
  79. telegrinder/node/__init__.py +0 -0
  80. telegrinder/node/attachment.py +0 -0
  81. telegrinder/node/base.py +0 -0
  82. telegrinder/node/composer.py +0 -0
  83. telegrinder/node/container.py +0 -0
  84. telegrinder/node/message.py +0 -0
  85. telegrinder/node/rule.py +0 -0
  86. telegrinder/node/source.py +0 -0
  87. telegrinder/node/text.py +0 -0
  88. telegrinder/node/tools/__init__.py +0 -0
  89. telegrinder/node/tools/generator.py +0 -0
  90. telegrinder/node/update.py +0 -0
  91. telegrinder/rules.py +0 -0
  92. telegrinder/tools/__init__.py +2 -30
  93. telegrinder/tools/buttons.py +19 -5
  94. telegrinder/tools/error_handler/__init__.py +2 -0
  95. telegrinder/tools/error_handler/abc.py +5 -1
  96. telegrinder/tools/error_handler/error.py +10 -0
  97. telegrinder/tools/error_handler/error_handler.py +100 -81
  98. telegrinder/tools/formatting/__init__.py +0 -0
  99. telegrinder/tools/formatting/html.py +0 -0
  100. telegrinder/tools/formatting/links.py +0 -0
  101. telegrinder/tools/formatting/spec_html_formats.py +0 -0
  102. telegrinder/tools/global_context/__init__.py +0 -0
  103. telegrinder/tools/global_context/abc.py +0 -0
  104. telegrinder/tools/global_context/global_context.py +65 -67
  105. telegrinder/tools/global_context/telegrinder_ctx.py +0 -0
  106. telegrinder/tools/i18n/__init__.py +0 -0
  107. telegrinder/tools/i18n/base.py +0 -0
  108. telegrinder/tools/i18n/middleware/__init__.py +0 -0
  109. telegrinder/tools/i18n/middleware/base.py +0 -0
  110. telegrinder/tools/i18n/simple.py +0 -0
  111. telegrinder/tools/kb_set/__init__.py +0 -0
  112. telegrinder/tools/kb_set/base.py +0 -0
  113. telegrinder/tools/kb_set/yaml.py +3 -3
  114. telegrinder/tools/keyboard.py +17 -26
  115. telegrinder/tools/loop_wrapper/__init__.py +0 -0
  116. telegrinder/tools/loop_wrapper/abc.py +0 -0
  117. telegrinder/tools/loop_wrapper/loop_wrapper.py +0 -0
  118. telegrinder/tools/magic.py +1 -1
  119. telegrinder/tools/parse_mode.py +0 -0
  120. telegrinder/types/__init__.py +0 -0
  121. telegrinder/types/enums.py +13 -9
  122. telegrinder/types/methods.py +783 -673
  123. telegrinder/types/objects.py +317 -163
  124. {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/LICENSE +0 -0
  125. {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/METADATA +9 -7
  126. {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/RECORD +42 -41
  127. {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/WHEEL +1 -1
  128. telegrinder/tools/inline_query.py +0 -684
@@ -4,7 +4,6 @@ from fntypes.co import Result, Variative
4
4
 
5
5
  from telegrinder.api.error import APIError
6
6
  from telegrinder.model import full_result, get_params
7
- from telegrinder.msgspec_utils import Nothing, Option
8
7
  from telegrinder.types.objects import * # noqa: F403
9
8
 
10
9
  if typing.TYPE_CHECKING:
@@ -17,12 +16,12 @@ class APIMethods:
17
16
 
18
17
  async def get_updates(
19
18
  self,
20
- offset: int | Option[int] = Nothing,
21
- limit: int | Option[int] = Nothing,
22
- timeout: int | Option[int] = Nothing,
23
- allowed_updates: list[str] | Option[list[str]] = Nothing,
19
+ offset: int | None = None,
20
+ limit: int | None = None,
21
+ timeout: int | None = None,
22
+ allowed_updates: list[str] | None = None,
24
23
  **other: typing.Any,
25
- ) -> Result[list[Update], "APIError"]:
24
+ ) -> Result[list[Update], APIError]:
26
25
  """Method `getUpdates`, see the [documentation](https://core.telegram.org/bots/api#getupdates)
27
26
 
28
27
  Use this method to receive incoming updates using long polling (wiki).
@@ -53,20 +52,23 @@ class APIMethods:
53
52
  of time.
54
53
  """
55
54
 
56
- method_response = await self.api.request_raw("getUpdates", get_params(locals()))
55
+ method_response = await self.api.request_raw(
56
+ "getUpdates",
57
+ get_params(locals()),
58
+ )
57
59
  return full_result(method_response, list[Update])
58
60
 
59
61
  async def set_webhook(
60
62
  self,
61
63
  url: str,
62
- certificate: InputFile | Option[InputFile] = Nothing,
63
- ip_address: str | Option[str] = Nothing,
64
- max_connections: int | Option[int] = Nothing,
65
- allowed_updates: list[str] | Option[list[str]] = Nothing,
66
- drop_pending_updates: bool | Option[bool] = Nothing,
67
- secret_token: str | Option[str] = Nothing,
68
- **other: typing.Any,
69
- ) -> Result[bool, "APIError"]:
64
+ certificate: InputFile | None = None,
65
+ ip_address: str | None = None,
66
+ max_connections: int | None = None,
67
+ allowed_updates: list[str] | None = None,
68
+ drop_pending_updates: bool | None = None,
69
+ secret_token: str | None = None,
70
+ **other: typing.Any,
71
+ ) -> Result[bool, APIError]:
70
72
  """Method `setWebhook`, see the [documentation](https://core.telegram.org/bots/api#setwebhook)
71
73
 
72
74
  Use this method to specify a URL and receive incoming updates via an outgoing
@@ -108,14 +110,17 @@ class APIMethods:
108
110
  from a webhook set by you.
109
111
  """
110
112
 
111
- method_response = await self.api.request_raw("setWebhook", get_params(locals()))
113
+ method_response = await self.api.request_raw(
114
+ "setWebhook",
115
+ get_params(locals()),
116
+ )
112
117
  return full_result(method_response, bool)
113
118
 
114
119
  async def delete_webhook(
115
120
  self,
116
- drop_pending_updates: bool | Option[bool] = Nothing,
121
+ drop_pending_updates: bool | None = None,
117
122
  **other: typing.Any,
118
- ) -> Result[bool, "APIError"]:
123
+ ) -> Result[bool, APIError]:
119
124
  """Method `deleteWebhook`, see the [documentation](https://core.telegram.org/bots/api#deletewebhook)
120
125
 
121
126
  Use this method to remove webhook integration if you decide to switch back
@@ -125,13 +130,14 @@ class APIMethods:
125
130
  """
126
131
 
127
132
  method_response = await self.api.request_raw(
128
- "deleteWebhook", get_params(locals())
133
+ "deleteWebhook",
134
+ get_params(locals()),
129
135
  )
130
136
  return full_result(method_response, bool)
131
137
 
132
138
  async def get_webhook_info(
133
139
  self, **other: typing.Any
134
- ) -> Result[WebhookInfo, "APIError"]:
140
+ ) -> Result[WebhookInfo, APIError]:
135
141
  """Method `getWebhookInfo`, see the [documentation](https://core.telegram.org/bots/api#getwebhookinfo)
136
142
 
137
143
  Use this method to get current webhook status. Requires no parameters.
@@ -140,11 +146,12 @@ class APIMethods:
140
146
  """
141
147
 
142
148
  method_response = await self.api.request_raw(
143
- "getWebhookInfo", get_params(locals())
149
+ "getWebhookInfo",
150
+ get_params(locals()),
144
151
  )
145
152
  return full_result(method_response, WebhookInfo)
146
153
 
147
- async def get_me(self, **other: typing.Any) -> Result[User, "APIError"]:
154
+ async def get_me(self, **other: typing.Any) -> Result[User, APIError]:
148
155
  """Method `getMe`, see the [documentation](https://core.telegram.org/bots/api#getme)
149
156
 
150
157
  A simple method for testing your bot's authentication token. Requires
@@ -152,10 +159,13 @@ class APIMethods:
152
159
  object.
153
160
  """
154
161
 
155
- method_response = await self.api.request_raw("getMe", get_params(locals()))
162
+ method_response = await self.api.request_raw(
163
+ "getMe",
164
+ get_params(locals()),
165
+ )
156
166
  return full_result(method_response, User)
157
167
 
158
- async def log_out(self, **other: typing.Any) -> Result[bool, "APIError"]:
168
+ async def log_out(self, **other: typing.Any) -> Result[bool, APIError]:
159
169
  """Method `logOut`, see the [documentation](https://core.telegram.org/bots/api#logout)
160
170
 
161
171
  Use this method to log out from the cloud Bot API server before launching
@@ -166,10 +176,13 @@ class APIMethods:
166
176
  Requires no parameters.
167
177
  """
168
178
 
169
- method_response = await self.api.request_raw("logOut", get_params(locals()))
179
+ method_response = await self.api.request_raw(
180
+ "logOut",
181
+ get_params(locals()),
182
+ )
170
183
  return full_result(method_response, bool)
171
184
 
172
- async def close(self, **other: typing.Any) -> Result[bool, "APIError"]:
185
+ async def close(self, **other: typing.Any) -> Result[bool, APIError]:
173
186
  """Method `close`, see the [documentation](https://core.telegram.org/bots/api#close)
174
187
 
175
188
  Use this method to close the bot instance before moving it from one local
@@ -179,32 +192,32 @@ class APIMethods:
179
192
  True on success. Requires no parameters.
180
193
  """
181
194
 
182
- method_response = await self.api.request_raw("close", get_params(locals()))
195
+ method_response = await self.api.request_raw(
196
+ "close",
197
+ get_params(locals()),
198
+ )
183
199
  return full_result(method_response, bool)
184
200
 
185
201
  async def send_message(
186
202
  self,
187
203
  chat_id: int | str,
188
204
  text: str,
189
- message_thread_id: int | Option[int] = Nothing,
190
- parse_mode: str | Option[str] = Nothing,
191
- entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
192
- link_preview_options: LinkPreviewOptions | Option[LinkPreviewOptions] = Nothing,
193
- disable_notification: bool | Option[bool] = Nothing,
194
- protect_content: bool | Option[bool] = Nothing,
195
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
196
- reply_markup: InlineKeyboardMarkup
197
- | ReplyKeyboardMarkup
198
- | ReplyKeyboardRemove
199
- | ForceReply
200
- | Option[
205
+ message_thread_id: int | None = None,
206
+ parse_mode: str | None = None,
207
+ entities: list[MessageEntity] | None = None,
208
+ link_preview_options: LinkPreviewOptions | None = None,
209
+ disable_notification: bool | None = None,
210
+ protect_content: bool | None = None,
211
+ reply_parameters: ReplyParameters | None = None,
212
+ reply_markup: (
201
213
  InlineKeyboardMarkup
202
214
  | ReplyKeyboardMarkup
203
215
  | ReplyKeyboardRemove
204
216
  | ForceReply
205
- ] = Nothing,
217
+ | None
218
+ ) = None,
206
219
  **other: typing.Any,
207
- ) -> Result[Message, "APIError"]:
220
+ ) -> Result[Message, APIError]:
208
221
  """Method `sendMessage`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
209
222
 
210
223
  Use this method to send text messages. On success, the sent Message is returned.
@@ -237,7 +250,8 @@ class APIMethods:
237
250
  """
238
251
 
239
252
  method_response = await self.api.request_raw(
240
- "sendMessage", get_params(locals())
253
+ "sendMessage",
254
+ get_params(locals()),
241
255
  )
242
256
  return full_result(method_response, Message)
243
257
 
@@ -246,11 +260,11 @@ class APIMethods:
246
260
  chat_id: int | str,
247
261
  from_chat_id: int | str,
248
262
  message_id: int,
249
- message_thread_id: int | Option[int] = Nothing,
250
- disable_notification: bool | Option[bool] = Nothing,
251
- protect_content: bool | Option[bool] = Nothing,
263
+ message_thread_id: int | None = None,
264
+ disable_notification: bool | None = None,
265
+ protect_content: bool | None = None,
252
266
  **other: typing.Any,
253
- ) -> Result[Message, "APIError"]:
267
+ ) -> Result[Message, APIError]:
254
268
  """Method `forwardMessage`, see the [documentation](https://core.telegram.org/bots/api#forwardmessage)
255
269
 
256
270
  Use this method to forward messages of any kind. Service messages and messages
@@ -274,7 +288,8 @@ class APIMethods:
274
288
  """
275
289
 
276
290
  method_response = await self.api.request_raw(
277
- "forwardMessage", get_params(locals())
291
+ "forwardMessage",
292
+ get_params(locals()),
278
293
  )
279
294
  return full_result(method_response, Message)
280
295
 
@@ -283,11 +298,11 @@ class APIMethods:
283
298
  chat_id: int | str,
284
299
  from_chat_id: int | str,
285
300
  message_ids: list[int],
286
- message_thread_id: int | Option[int] = Nothing,
287
- disable_notification: bool | Option[bool] = Nothing,
288
- protect_content: bool | Option[bool] = Nothing,
301
+ message_thread_id: int | None = None,
302
+ disable_notification: bool | None = None,
303
+ protect_content: bool | None = None,
289
304
  **other: typing.Any,
290
- ) -> Result[list[MessageId], "APIError"]:
305
+ ) -> Result[list[MessageId], APIError]:
291
306
  """Method `forwardMessages`, see the [documentation](https://core.telegram.org/bots/api#forwardmessages)
292
307
 
293
308
  Use this method to forward multiple messages of any kind. If some of the specified
@@ -305,8 +320,9 @@ class APIMethods:
305
320
  :param from_chat_id: Unique identifier for the chat where the original messages were sent (or \
306
321
  channel username in the format @channelusername).
307
322
 
308
- :param message_ids: Identifiers of 1-100 messages in the chat from_chat_id to forward. The \
309
- identifiers must be specified in a strictly increasing order.
323
+ :param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id \
324
+ to forward. The identifiers must be specified in a strictly increasing \
325
+ order.
310
326
 
311
327
  :param disable_notification: Sends the messages silently. Users will receive a notification with no \
312
328
  sound.
@@ -315,7 +331,8 @@ class APIMethods:
315
331
  """
316
332
 
317
333
  method_response = await self.api.request_raw(
318
- "forwardMessages", get_params(locals())
334
+ "forwardMessages",
335
+ get_params(locals()),
319
336
  )
320
337
  return full_result(method_response, list[MessageId])
321
338
 
@@ -324,25 +341,22 @@ class APIMethods:
324
341
  chat_id: int | str,
325
342
  from_chat_id: int | str,
326
343
  message_id: int,
327
- message_thread_id: int | Option[int] = Nothing,
328
- caption: str | Option[str] = Nothing,
329
- parse_mode: str | Option[str] = Nothing,
330
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
331
- disable_notification: bool | Option[bool] = Nothing,
332
- protect_content: bool | Option[bool] = Nothing,
333
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
334
- reply_markup: InlineKeyboardMarkup
335
- | ReplyKeyboardMarkup
336
- | ReplyKeyboardRemove
337
- | ForceReply
338
- | Option[
344
+ message_thread_id: int | None = None,
345
+ caption: str | None = None,
346
+ parse_mode: str | None = None,
347
+ caption_entities: list[MessageEntity] | None = None,
348
+ disable_notification: bool | None = None,
349
+ protect_content: bool | None = None,
350
+ reply_parameters: ReplyParameters | None = None,
351
+ reply_markup: (
339
352
  InlineKeyboardMarkup
340
353
  | ReplyKeyboardMarkup
341
354
  | ReplyKeyboardRemove
342
355
  | ForceReply
343
- ] = Nothing,
356
+ | None
357
+ ) = None,
344
358
  **other: typing.Any,
345
- ) -> Result[MessageId, "APIError"]:
359
+ ) -> Result[MessageId, APIError]:
346
360
  """Method `copyMessage`, see the [documentation](https://core.telegram.org/bots/api#copymessage)
347
361
 
348
362
  Use this method to copy messages of any kind. Service messages, giveaway
@@ -384,7 +398,8 @@ class APIMethods:
384
398
  """
385
399
 
386
400
  method_response = await self.api.request_raw(
387
- "copyMessage", get_params(locals())
401
+ "copyMessage",
402
+ get_params(locals()),
388
403
  )
389
404
  return full_result(method_response, MessageId)
390
405
 
@@ -393,12 +408,12 @@ class APIMethods:
393
408
  chat_id: int | str,
394
409
  from_chat_id: int | str,
395
410
  message_ids: list[int],
396
- message_thread_id: int | Option[int] = Nothing,
397
- disable_notification: bool | Option[bool] = Nothing,
398
- protect_content: bool | Option[bool] = Nothing,
399
- remove_caption: bool | Option[bool] = Nothing,
411
+ message_thread_id: int | None = None,
412
+ disable_notification: bool | None = None,
413
+ protect_content: bool | None = None,
414
+ remove_caption: bool | None = None,
400
415
  **other: typing.Any,
401
- ) -> Result[list[MessageId], "APIError"]:
416
+ ) -> Result[list[MessageId], APIError]:
402
417
  """Method `copyMessages`, see the [documentation](https://core.telegram.org/bots/api#copymessages)
403
418
 
404
419
  Use this method to copy messages of any kind. If some of the specified messages
@@ -419,8 +434,8 @@ class APIMethods:
419
434
  :param from_chat_id: Unique identifier for the chat where the original messages were sent (or \
420
435
  channel username in the format @channelusername).
421
436
 
422
- :param message_ids: Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers \
423
- must be specified in a strictly increasing order.
437
+ :param message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id \
438
+ to copy. The identifiers must be specified in a strictly increasing order. \
424
439
 
425
440
  :param disable_notification: Sends the messages silently. Users will receive a notification with no \
426
441
  sound.
@@ -431,7 +446,8 @@ class APIMethods:
431
446
  """
432
447
 
433
448
  method_response = await self.api.request_raw(
434
- "copyMessages", get_params(locals())
449
+ "copyMessages",
450
+ get_params(locals()),
435
451
  )
436
452
  return full_result(method_response, list[MessageId])
437
453
 
@@ -439,26 +455,23 @@ class APIMethods:
439
455
  self,
440
456
  chat_id: int | str,
441
457
  photo: InputFile | str,
442
- message_thread_id: int | Option[int] = Nothing,
443
- caption: str | Option[str] = Nothing,
444
- parse_mode: str | Option[str] = Nothing,
445
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
446
- has_spoiler: bool | Option[bool] = Nothing,
447
- disable_notification: bool | Option[bool] = Nothing,
448
- protect_content: bool | Option[bool] = Nothing,
449
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
450
- reply_markup: InlineKeyboardMarkup
451
- | ReplyKeyboardMarkup
452
- | ReplyKeyboardRemove
453
- | ForceReply
454
- | Option[
458
+ message_thread_id: int | None = None,
459
+ caption: str | None = None,
460
+ parse_mode: str | None = None,
461
+ caption_entities: list[MessageEntity] | None = None,
462
+ has_spoiler: bool | None = None,
463
+ disable_notification: bool | None = None,
464
+ protect_content: bool | None = None,
465
+ reply_parameters: ReplyParameters | None = None,
466
+ reply_markup: (
455
467
  InlineKeyboardMarkup
456
468
  | ReplyKeyboardMarkup
457
469
  | ReplyKeyboardRemove
458
470
  | ForceReply
459
- ] = Nothing,
471
+ | None
472
+ ) = None,
460
473
  **other: typing.Any,
461
- ) -> Result[Message, "APIError"]:
474
+ ) -> Result[Message, APIError]:
462
475
  """Method `sendPhoto`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
463
476
 
464
477
  Use this method to send photos. On success, the sent Message is returned.
@@ -498,36 +511,36 @@ class APIMethods:
498
511
  or to force a reply from the user.
499
512
  """
500
513
 
501
- method_response = await self.api.request_raw("sendPhoto", get_params(locals()))
514
+ method_response = await self.api.request_raw(
515
+ "sendPhoto",
516
+ get_params(locals()),
517
+ )
502
518
  return full_result(method_response, Message)
503
519
 
504
520
  async def send_audio(
505
521
  self,
506
522
  chat_id: int | str,
507
523
  audio: InputFile | str,
508
- message_thread_id: int | Option[int] = Nothing,
509
- caption: str | Option[str] = Nothing,
510
- parse_mode: str | Option[str] = Nothing,
511
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
512
- duration: int | Option[int] = Nothing,
513
- performer: str | Option[str] = Nothing,
514
- title: str | Option[str] = Nothing,
515
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
516
- disable_notification: bool | Option[bool] = Nothing,
517
- protect_content: bool | Option[bool] = Nothing,
518
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
519
- reply_markup: InlineKeyboardMarkup
520
- | ReplyKeyboardMarkup
521
- | ReplyKeyboardRemove
522
- | ForceReply
523
- | Option[
524
+ message_thread_id: int | None = None,
525
+ caption: str | None = None,
526
+ parse_mode: str | None = None,
527
+ caption_entities: list[MessageEntity] | None = None,
528
+ duration: int | None = None,
529
+ performer: str | None = None,
530
+ title: str | None = None,
531
+ thumbnail: InputFile | str | None = None,
532
+ disable_notification: bool | None = None,
533
+ protect_content: bool | None = None,
534
+ reply_parameters: ReplyParameters | None = None,
535
+ reply_markup: (
524
536
  InlineKeyboardMarkup
525
537
  | ReplyKeyboardMarkup
526
538
  | ReplyKeyboardRemove
527
539
  | ForceReply
528
- ] = Nothing,
540
+ | None
541
+ ) = None,
529
542
  **other: typing.Any,
530
- ) -> Result[Message, "APIError"]:
543
+ ) -> Result[Message, APIError]:
531
544
  """Method `sendAudio`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
532
545
 
533
546
  Use this method to send audio files, if you want Telegram clients to display
@@ -580,34 +593,34 @@ class APIMethods:
580
593
  or to force a reply from the user.
581
594
  """
582
595
 
583
- method_response = await self.api.request_raw("sendAudio", get_params(locals()))
596
+ method_response = await self.api.request_raw(
597
+ "sendAudio",
598
+ get_params(locals()),
599
+ )
584
600
  return full_result(method_response, Message)
585
601
 
586
602
  async def send_document(
587
603
  self,
588
604
  chat_id: int | str,
589
605
  document: InputFile | str,
590
- message_thread_id: int | Option[int] = Nothing,
591
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
592
- caption: str | Option[str] = Nothing,
593
- parse_mode: str | Option[str] = Nothing,
594
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
595
- disable_content_type_detection: bool | Option[bool] = Nothing,
596
- disable_notification: bool | Option[bool] = Nothing,
597
- protect_content: bool | Option[bool] = Nothing,
598
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
599
- reply_markup: InlineKeyboardMarkup
600
- | ReplyKeyboardMarkup
601
- | ReplyKeyboardRemove
602
- | ForceReply
603
- | Option[
606
+ message_thread_id: int | None = None,
607
+ thumbnail: InputFile | str | None = None,
608
+ caption: str | None = None,
609
+ parse_mode: str | None = None,
610
+ caption_entities: list[MessageEntity] | None = None,
611
+ disable_content_type_detection: bool | None = None,
612
+ disable_notification: bool | None = None,
613
+ protect_content: bool | None = None,
614
+ reply_parameters: ReplyParameters | None = None,
615
+ reply_markup: (
604
616
  InlineKeyboardMarkup
605
617
  | ReplyKeyboardMarkup
606
618
  | ReplyKeyboardRemove
607
619
  | ForceReply
608
- ] = Nothing,
620
+ | None
621
+ ) = None,
609
622
  **other: typing.Any,
610
- ) -> Result[Message, "APIError"]:
623
+ ) -> Result[Message, APIError]:
611
624
  """Method `sendDocument`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
612
625
 
613
626
  Use this method to send general files. On success, the sent Message is returned.
@@ -657,7 +670,8 @@ class APIMethods:
657
670
  """
658
671
 
659
672
  method_response = await self.api.request_raw(
660
- "sendDocument", get_params(locals())
673
+ "sendDocument",
674
+ get_params(locals()),
661
675
  )
662
676
  return full_result(method_response, Message)
663
677
 
@@ -665,31 +679,28 @@ class APIMethods:
665
679
  self,
666
680
  chat_id: int | str,
667
681
  video: InputFile | str,
668
- message_thread_id: int | Option[int] = Nothing,
669
- duration: int | Option[int] = Nothing,
670
- width: int | Option[int] = Nothing,
671
- height: int | Option[int] = Nothing,
672
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
673
- caption: str | Option[str] = Nothing,
674
- parse_mode: str | Option[str] = Nothing,
675
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
676
- has_spoiler: bool | Option[bool] = Nothing,
677
- supports_streaming: bool | Option[bool] = Nothing,
678
- disable_notification: bool | Option[bool] = Nothing,
679
- protect_content: bool | Option[bool] = Nothing,
680
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
681
- reply_markup: InlineKeyboardMarkup
682
- | ReplyKeyboardMarkup
683
- | ReplyKeyboardRemove
684
- | ForceReply
685
- | Option[
682
+ message_thread_id: int | None = None,
683
+ duration: int | None = None,
684
+ width: int | None = None,
685
+ height: int | None = None,
686
+ thumbnail: InputFile | str | None = None,
687
+ caption: str | None = None,
688
+ parse_mode: str | None = None,
689
+ caption_entities: list[MessageEntity] | None = None,
690
+ has_spoiler: bool | None = None,
691
+ supports_streaming: bool | None = None,
692
+ disable_notification: bool | None = None,
693
+ protect_content: bool | None = None,
694
+ reply_parameters: ReplyParameters | None = None,
695
+ reply_markup: (
686
696
  InlineKeyboardMarkup
687
697
  | ReplyKeyboardMarkup
688
698
  | ReplyKeyboardRemove
689
699
  | ForceReply
690
- ] = Nothing,
700
+ | None
701
+ ) = None,
691
702
  **other: typing.Any,
692
- ) -> Result[Message, "APIError"]:
703
+ ) -> Result[Message, APIError]:
693
704
  """Method `sendVideo`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
694
705
 
695
706
  Use this method to send video files, Telegram clients support MPEG4 videos
@@ -746,37 +757,37 @@ class APIMethods:
746
757
  or to force a reply from the user.
747
758
  """
748
759
 
749
- method_response = await self.api.request_raw("sendVideo", get_params(locals()))
760
+ method_response = await self.api.request_raw(
761
+ "sendVideo",
762
+ get_params(locals()),
763
+ )
750
764
  return full_result(method_response, Message)
751
765
 
752
766
  async def send_animation(
753
767
  self,
754
768
  chat_id: int | str,
755
769
  animation: InputFile | str,
756
- message_thread_id: int | Option[int] = Nothing,
757
- duration: int | Option[int] = Nothing,
758
- width: int | Option[int] = Nothing,
759
- height: int | Option[int] = Nothing,
760
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
761
- caption: str | Option[str] = Nothing,
762
- parse_mode: str | Option[str] = Nothing,
763
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
764
- has_spoiler: bool | Option[bool] = Nothing,
765
- disable_notification: bool | Option[bool] = Nothing,
766
- protect_content: bool | Option[bool] = Nothing,
767
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
768
- reply_markup: InlineKeyboardMarkup
769
- | ReplyKeyboardMarkup
770
- | ReplyKeyboardRemove
771
- | ForceReply
772
- | Option[
770
+ message_thread_id: int | None = None,
771
+ duration: int | None = None,
772
+ width: int | None = None,
773
+ height: int | None = None,
774
+ thumbnail: InputFile | str | None = None,
775
+ caption: str | None = None,
776
+ parse_mode: str | None = None,
777
+ caption_entities: list[MessageEntity] | None = None,
778
+ has_spoiler: bool | None = None,
779
+ disable_notification: bool | None = None,
780
+ protect_content: bool | None = None,
781
+ reply_parameters: ReplyParameters | None = None,
782
+ reply_markup: (
773
783
  InlineKeyboardMarkup
774
784
  | ReplyKeyboardMarkup
775
785
  | ReplyKeyboardRemove
776
786
  | ForceReply
777
- ] = Nothing,
787
+ | None
788
+ ) = None,
778
789
  **other: typing.Any,
779
- ) -> Result[Message, "APIError"]:
790
+ ) -> Result[Message, APIError]:
780
791
  """Method `sendAnimation`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
781
792
 
782
793
  Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without
@@ -831,7 +842,8 @@ class APIMethods:
831
842
  """
832
843
 
833
844
  method_response = await self.api.request_raw(
834
- "sendAnimation", get_params(locals())
845
+ "sendAnimation",
846
+ get_params(locals()),
835
847
  )
836
848
  return full_result(method_response, Message)
837
849
 
@@ -839,26 +851,23 @@ class APIMethods:
839
851
  self,
840
852
  chat_id: int | str,
841
853
  voice: InputFile | str,
842
- message_thread_id: int | Option[int] = Nothing,
843
- caption: str | Option[str] = Nothing,
844
- parse_mode: str | Option[str] = Nothing,
845
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
846
- duration: int | Option[int] = Nothing,
847
- disable_notification: bool | Option[bool] = Nothing,
848
- protect_content: bool | Option[bool] = Nothing,
849
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
850
- reply_markup: InlineKeyboardMarkup
851
- | ReplyKeyboardMarkup
852
- | ReplyKeyboardRemove
853
- | ForceReply
854
- | Option[
854
+ message_thread_id: int | None = None,
855
+ caption: str | None = None,
856
+ parse_mode: str | None = None,
857
+ caption_entities: list[MessageEntity] | None = None,
858
+ duration: int | None = None,
859
+ disable_notification: bool | None = None,
860
+ protect_content: bool | None = None,
861
+ reply_parameters: ReplyParameters | None = None,
862
+ reply_markup: (
855
863
  InlineKeyboardMarkup
856
864
  | ReplyKeyboardMarkup
857
865
  | ReplyKeyboardRemove
858
866
  | ForceReply
859
- ] = Nothing,
867
+ | None
868
+ ) = None,
860
869
  **other: typing.Any,
861
- ) -> Result[Message, "APIError"]:
870
+ ) -> Result[Message, APIError]:
862
871
  """Method `sendVoice`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
863
872
 
864
873
  Use this method to send audio files, if you want Telegram clients to display
@@ -899,32 +908,32 @@ class APIMethods:
899
908
  or to force a reply from the user.
900
909
  """
901
910
 
902
- method_response = await self.api.request_raw("sendVoice", get_params(locals()))
911
+ method_response = await self.api.request_raw(
912
+ "sendVoice",
913
+ get_params(locals()),
914
+ )
903
915
  return full_result(method_response, Message)
904
916
 
905
917
  async def send_video_note(
906
918
  self,
907
919
  chat_id: int | str,
908
920
  video_note: InputFile | str,
909
- message_thread_id: int | Option[int] = Nothing,
910
- duration: int | Option[int] = Nothing,
911
- length: int | Option[int] = Nothing,
912
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
913
- disable_notification: bool | Option[bool] = Nothing,
914
- protect_content: bool | Option[bool] = Nothing,
915
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
916
- reply_markup: InlineKeyboardMarkup
917
- | ReplyKeyboardMarkup
918
- | ReplyKeyboardRemove
919
- | ForceReply
920
- | Option[
921
+ message_thread_id: int | None = None,
922
+ duration: int | None = None,
923
+ length: int | None = None,
924
+ thumbnail: InputFile | str | None = None,
925
+ disable_notification: bool | None = None,
926
+ protect_content: bool | None = None,
927
+ reply_parameters: ReplyParameters | None = None,
928
+ reply_markup: (
921
929
  InlineKeyboardMarkup
922
930
  | ReplyKeyboardMarkup
923
931
  | ReplyKeyboardRemove
924
932
  | ForceReply
925
- ] = Nothing,
933
+ | None
934
+ ) = None,
926
935
  **other: typing.Any,
927
- ) -> Result[Message, "APIError"]:
936
+ ) -> Result[Message, APIError]:
928
937
  """Method `sendVideoNote`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
929
938
 
930
939
  As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
@@ -966,23 +975,23 @@ class APIMethods:
966
975
  """
967
976
 
968
977
  method_response = await self.api.request_raw(
969
- "sendVideoNote", get_params(locals())
978
+ "sendVideoNote",
979
+ get_params(locals()),
970
980
  )
971
981
  return full_result(method_response, Message)
972
982
 
973
983
  async def send_media_group(
974
984
  self,
975
985
  chat_id: int | str,
976
- media: list[InputMediaAudio]
977
- | list[InputMediaDocument]
978
- | list[InputMediaPhoto]
979
- | list[InputMediaVideo],
980
- message_thread_id: int | Option[int] = Nothing,
981
- disable_notification: bool | Option[bool] = Nothing,
982
- protect_content: bool | Option[bool] = Nothing,
983
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
986
+ media: list[
987
+ InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo
988
+ ],
989
+ message_thread_id: int | None = None,
990
+ disable_notification: bool | None = None,
991
+ protect_content: bool | None = None,
992
+ reply_parameters: ReplyParameters | None = None,
984
993
  **other: typing.Any,
985
- ) -> Result[list[Message], "APIError"]:
994
+ ) -> Result[list[Message], APIError]:
986
995
  """Method `sendMediaGroup`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
987
996
 
988
997
  Use this method to send a group of photos, videos, documents or audios as
@@ -1006,7 +1015,8 @@ class APIMethods:
1006
1015
  """
1007
1016
 
1008
1017
  method_response = await self.api.request_raw(
1009
- "sendMediaGroup", get_params(locals())
1018
+ "sendMediaGroup",
1019
+ get_params(locals()),
1010
1020
  )
1011
1021
  return full_result(method_response, list[Message])
1012
1022
 
@@ -1015,26 +1025,23 @@ class APIMethods:
1015
1025
  chat_id: int | str,
1016
1026
  latitude: float,
1017
1027
  longitude: float,
1018
- message_thread_id: int | Option[int] = Nothing,
1019
- horizontal_accuracy: float | Option[float] = Nothing,
1020
- live_period: int | Option[int] = Nothing,
1021
- heading: int | Option[int] = Nothing,
1022
- proximity_alert_radius: int | Option[int] = Nothing,
1023
- disable_notification: bool | Option[bool] = Nothing,
1024
- protect_content: bool | Option[bool] = Nothing,
1025
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
1026
- reply_markup: InlineKeyboardMarkup
1027
- | ReplyKeyboardMarkup
1028
- | ReplyKeyboardRemove
1029
- | ForceReply
1030
- | Option[
1028
+ message_thread_id: int | None = None,
1029
+ horizontal_accuracy: float | None = None,
1030
+ live_period: int | None = None,
1031
+ heading: int | None = None,
1032
+ proximity_alert_radius: int | None = None,
1033
+ disable_notification: bool | None = None,
1034
+ protect_content: bool | None = None,
1035
+ reply_parameters: ReplyParameters | None = None,
1036
+ reply_markup: (
1031
1037
  InlineKeyboardMarkup
1032
1038
  | ReplyKeyboardMarkup
1033
1039
  | ReplyKeyboardRemove
1034
1040
  | ForceReply
1035
- ] = Nothing,
1041
+ | None
1042
+ ) = None,
1036
1043
  **other: typing.Any,
1037
- ) -> Result[Message, "APIError"]:
1044
+ ) -> Result[Message, APIError]:
1038
1045
  """Method `sendLocation`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
1039
1046
 
1040
1047
  Use this method to send point on the map. On success, the sent Message is returned.
@@ -1072,7 +1079,8 @@ class APIMethods:
1072
1079
  """
1073
1080
 
1074
1081
  method_response = await self.api.request_raw(
1075
- "sendLocation", get_params(locals())
1082
+ "sendLocation",
1083
+ get_params(locals()),
1076
1084
  )
1077
1085
  return full_result(method_response, Message)
1078
1086
 
@@ -1083,26 +1091,23 @@ class APIMethods:
1083
1091
  longitude: float,
1084
1092
  title: str,
1085
1093
  address: str,
1086
- message_thread_id: int | Option[int] = Nothing,
1087
- foursquare_id: str | Option[str] = Nothing,
1088
- foursquare_type: str | Option[str] = Nothing,
1089
- google_place_id: str | Option[str] = Nothing,
1090
- google_place_type: str | Option[str] = Nothing,
1091
- disable_notification: bool | Option[bool] = Nothing,
1092
- protect_content: bool | Option[bool] = Nothing,
1093
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
1094
- reply_markup: InlineKeyboardMarkup
1095
- | ReplyKeyboardMarkup
1096
- | ReplyKeyboardRemove
1097
- | ForceReply
1098
- | Option[
1094
+ message_thread_id: int | None = None,
1095
+ foursquare_id: str | None = None,
1096
+ foursquare_type: str | None = None,
1097
+ google_place_id: str | None = None,
1098
+ google_place_type: str | None = None,
1099
+ disable_notification: bool | None = None,
1100
+ protect_content: bool | None = None,
1101
+ reply_parameters: ReplyParameters | None = None,
1102
+ reply_markup: (
1099
1103
  InlineKeyboardMarkup
1100
1104
  | ReplyKeyboardMarkup
1101
1105
  | ReplyKeyboardRemove
1102
1106
  | ForceReply
1103
- ] = Nothing,
1107
+ | None
1108
+ ) = None,
1104
1109
  **other: typing.Any,
1105
- ) -> Result[Message, "APIError"]:
1110
+ ) -> Result[Message, APIError]:
1106
1111
  """Method `sendVenue`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
1107
1112
 
1108
1113
  Use this method to send information about a venue. On success, the sent Message
@@ -1142,7 +1147,10 @@ class APIMethods:
1142
1147
  or to force a reply from the user.
1143
1148
  """
1144
1149
 
1145
- method_response = await self.api.request_raw("sendVenue", get_params(locals()))
1150
+ method_response = await self.api.request_raw(
1151
+ "sendVenue",
1152
+ get_params(locals()),
1153
+ )
1146
1154
  return full_result(method_response, Message)
1147
1155
 
1148
1156
  async def send_contact(
@@ -1150,24 +1158,21 @@ class APIMethods:
1150
1158
  chat_id: int | str,
1151
1159
  phone_number: str,
1152
1160
  first_name: str,
1153
- message_thread_id: int | Option[int] = Nothing,
1154
- last_name: str | Option[str] = Nothing,
1155
- vcard: str | Option[str] = Nothing,
1156
- disable_notification: bool | Option[bool] = Nothing,
1157
- protect_content: bool | Option[bool] = Nothing,
1158
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
1159
- reply_markup: InlineKeyboardMarkup
1160
- | ReplyKeyboardMarkup
1161
- | ReplyKeyboardRemove
1162
- | ForceReply
1163
- | Option[
1161
+ message_thread_id: int | None = None,
1162
+ last_name: str | None = None,
1163
+ vcard: str | None = None,
1164
+ disable_notification: bool | None = None,
1165
+ protect_content: bool | None = None,
1166
+ reply_parameters: ReplyParameters | None = None,
1167
+ reply_markup: (
1164
1168
  InlineKeyboardMarkup
1165
1169
  | ReplyKeyboardMarkup
1166
1170
  | ReplyKeyboardRemove
1167
1171
  | ForceReply
1168
- ] = Nothing,
1172
+ | None
1173
+ ) = None,
1169
1174
  **other: typing.Any,
1170
- ) -> Result[Message, "APIError"]:
1175
+ ) -> Result[Message, APIError]:
1171
1176
  """Method `sendContact`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
1172
1177
 
1173
1178
  Use this method to send phone contacts. On success, the sent Message is returned.
@@ -1198,7 +1203,8 @@ class APIMethods:
1198
1203
  """
1199
1204
 
1200
1205
  method_response = await self.api.request_raw(
1201
- "sendContact", get_params(locals())
1206
+ "sendContact",
1207
+ get_params(locals()),
1202
1208
  )
1203
1209
  return full_result(method_response, Message)
1204
1210
 
@@ -1207,33 +1213,29 @@ class APIMethods:
1207
1213
  chat_id: int | str,
1208
1214
  question: str,
1209
1215
  options: list[str],
1210
- message_thread_id: int | Option[int] = Nothing,
1211
- is_anonymous: bool | Option[bool] = Nothing,
1212
- type: str | Option[str] = Nothing,
1213
- allows_multiple_answers: bool | Option[bool] = Nothing,
1214
- correct_option_id: int | Option[int] = Nothing,
1215
- explanation: str | Option[str] = Nothing,
1216
- explanation_parse_mode: str | Option[str] = Nothing,
1217
- explanation_entities: list[MessageEntity]
1218
- | Option[list[MessageEntity]] = Nothing,
1219
- open_period: int | Option[int] = Nothing,
1220
- close_date: int | Option[int] = Nothing,
1221
- is_closed: bool | Option[bool] = Nothing,
1222
- disable_notification: bool | Option[bool] = Nothing,
1223
- protect_content: bool | Option[bool] = Nothing,
1224
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
1225
- reply_markup: InlineKeyboardMarkup
1226
- | ReplyKeyboardMarkup
1227
- | ReplyKeyboardRemove
1228
- | ForceReply
1229
- | Option[
1216
+ message_thread_id: int | None = None,
1217
+ is_anonymous: bool | None = None,
1218
+ type: typing.Literal["quiz", "regular"] | None = None,
1219
+ allows_multiple_answers: bool | None = None,
1220
+ correct_option_id: int | None = None,
1221
+ explanation: str | None = None,
1222
+ explanation_parse_mode: str | None = None,
1223
+ explanation_entities: list[MessageEntity] | None = None,
1224
+ open_period: int | None = None,
1225
+ close_date: datetime | int | None = None,
1226
+ is_closed: bool | None = None,
1227
+ disable_notification: bool | None = None,
1228
+ protect_content: bool | None = None,
1229
+ reply_parameters: ReplyParameters | None = None,
1230
+ reply_markup: (
1230
1231
  InlineKeyboardMarkup
1231
1232
  | ReplyKeyboardMarkup
1232
1233
  | ReplyKeyboardRemove
1233
1234
  | ForceReply
1234
- ] = Nothing,
1235
+ | None
1236
+ ) = None,
1235
1237
  **other: typing.Any,
1236
- ) -> Result[Message, "APIError"]:
1238
+ ) -> Result[Message, APIError]:
1237
1239
  """Method `sendPoll`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
1238
1240
 
1239
1241
  Use this method to send a native poll. On success, the sent Message is returned.
@@ -1290,29 +1292,29 @@ class APIMethods:
1290
1292
  or to force a reply from the user.
1291
1293
  """
1292
1294
 
1293
- method_response = await self.api.request_raw("sendPoll", get_params(locals()))
1295
+ method_response = await self.api.request_raw(
1296
+ "sendPoll",
1297
+ get_params(locals()),
1298
+ )
1294
1299
  return full_result(method_response, Message)
1295
1300
 
1296
1301
  async def send_dice(
1297
1302
  self,
1298
1303
  chat_id: int | str,
1299
- message_thread_id: int | Option[int] = Nothing,
1300
- emoji: str | Option[str] = Nothing,
1301
- disable_notification: bool | Option[bool] = Nothing,
1302
- protect_content: bool | Option[bool] = Nothing,
1303
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
1304
- reply_markup: InlineKeyboardMarkup
1305
- | ReplyKeyboardMarkup
1306
- | ReplyKeyboardRemove
1307
- | ForceReply
1308
- | Option[
1304
+ message_thread_id: int | None = None,
1305
+ emoji: DiceEmoji | None = None,
1306
+ disable_notification: bool | None = None,
1307
+ protect_content: bool | None = None,
1308
+ reply_parameters: ReplyParameters | None = None,
1309
+ reply_markup: (
1309
1310
  InlineKeyboardMarkup
1310
1311
  | ReplyKeyboardMarkup
1311
1312
  | ReplyKeyboardRemove
1312
1313
  | ForceReply
1313
- ] = Nothing,
1314
+ | None
1315
+ ) = None,
1314
1316
  **other: typing.Any,
1315
- ) -> Result[Message, "APIError"]:
1317
+ ) -> Result[Message, APIError]:
1316
1318
  """Method `sendDice`, see the [documentation](https://core.telegram.org/bots/api#senddice)
1317
1319
 
1318
1320
  Use this method to send an animated emoji that will display a random value.
@@ -1339,16 +1341,19 @@ class APIMethods:
1339
1341
  or to force a reply from the user.
1340
1342
  """
1341
1343
 
1342
- method_response = await self.api.request_raw("sendDice", get_params(locals()))
1344
+ method_response = await self.api.request_raw(
1345
+ "sendDice",
1346
+ get_params(locals()),
1347
+ )
1343
1348
  return full_result(method_response, Message)
1344
1349
 
1345
1350
  async def send_chat_action(
1346
1351
  self,
1347
1352
  chat_id: int | str,
1348
- action: str,
1349
- message_thread_id: int | Option[int] = Nothing,
1353
+ action: ChatAction,
1354
+ message_thread_id: int | None = None,
1350
1355
  **other: typing.Any,
1351
- ) -> Result[bool, "APIError"]:
1356
+ ) -> Result[bool, APIError]:
1352
1357
  """Method `sendChatAction`, see the [documentation](https://core.telegram.org/bots/api#sendchataction)
1353
1358
 
1354
1359
  Use this method when you need to tell the user that something is happening
@@ -1360,7 +1365,7 @@ class APIMethods:
1360
1365
  :param chat_id: Unique identifier for the target chat or username of the target channel \
1361
1366
  (in the format @channelusername).
1362
1367
 
1363
- :param message_thread_id: Unique identifier for the target message thread; supergroups only.
1368
+ :param message_thread_id: Unique identifier for the target message thread; for supergroups only. \
1364
1369
 
1365
1370
  :param action: Type of action to broadcast. Choose one, depending on what the user is about \
1366
1371
  to receive: typing for text messages, upload_photo for photos, record_video \
@@ -1371,7 +1376,8 @@ class APIMethods:
1371
1376
  """
1372
1377
 
1373
1378
  method_response = await self.api.request_raw(
1374
- "sendChatAction", get_params(locals())
1379
+ "sendChatAction",
1380
+ get_params(locals()),
1375
1381
  )
1376
1382
  return full_result(method_response, bool)
1377
1383
 
@@ -1379,10 +1385,10 @@ class APIMethods:
1379
1385
  self,
1380
1386
  chat_id: int | str,
1381
1387
  message_id: int,
1382
- reaction: list[ReactionType] | Option[list[ReactionType]] = Nothing,
1383
- is_big: bool | Option[bool] = Nothing,
1388
+ reaction: list[ReactionType] | None = None,
1389
+ is_big: bool | None = None,
1384
1390
  **other: typing.Any,
1385
- ) -> Result[bool, "APIError"]:
1391
+ ) -> Result[bool, APIError]:
1386
1392
  """Method `setMessageReaction`, see the [documentation](https://core.telegram.org/bots/api#setmessagereaction)
1387
1393
 
1388
1394
  Use this method to change the chosen reactions on a message. Service messages
@@ -1396,26 +1402,27 @@ class APIMethods:
1396
1402
  :param message_id: Identifier of the target message. If the message belongs to a media group, \
1397
1403
  the reaction is set to the first non-deleted message in the group instead. \
1398
1404
 
1399
- :param reaction: New list of reaction types to set on the message. Currently, as non-premium \
1400
- users, bots can set up to one reaction per message. A custom emoji reaction \
1401
- can be used if it is either already present on the message or explicitly allowed \
1402
- by chat administrators.
1405
+ :param reaction: A JSON-serialized list of reaction types to set on the message. Currently, \
1406
+ as non-premium users, bots can set up to one reaction per message. A custom \
1407
+ emoji reaction can be used if it is either already present on the message \
1408
+ or explicitly allowed by chat administrators.
1403
1409
 
1404
1410
  :param is_big: Pass True to set the reaction with a big animation.
1405
1411
  """
1406
1412
 
1407
1413
  method_response = await self.api.request_raw(
1408
- "setMessageReaction", get_params(locals())
1414
+ "setMessageReaction",
1415
+ get_params(locals()),
1409
1416
  )
1410
1417
  return full_result(method_response, bool)
1411
1418
 
1412
1419
  async def get_user_profile_photos(
1413
1420
  self,
1414
1421
  user_id: int,
1415
- offset: int | Option[int] = Nothing,
1416
- limit: int | Option[int] = Nothing,
1422
+ offset: int | None = None,
1423
+ limit: int | None = None,
1417
1424
  **other: typing.Any,
1418
- ) -> Result[UserProfilePhotos, "APIError"]:
1425
+ ) -> Result[UserProfilePhotos, APIError]:
1419
1426
  """Method `getUserProfilePhotos`, see the [documentation](https://core.telegram.org/bots/api#getuserprofilephotos)
1420
1427
 
1421
1428
  Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos
@@ -1431,7 +1438,8 @@ class APIMethods:
1431
1438
  """
1432
1439
 
1433
1440
  method_response = await self.api.request_raw(
1434
- "getUserProfilePhotos", get_params(locals())
1441
+ "getUserProfilePhotos",
1442
+ get_params(locals()),
1435
1443
  )
1436
1444
  return full_result(method_response, UserProfilePhotos)
1437
1445
 
@@ -1439,7 +1447,7 @@ class APIMethods:
1439
1447
  self,
1440
1448
  file_id: str,
1441
1449
  **other: typing.Any,
1442
- ) -> Result[File, "APIError"]:
1450
+ ) -> Result[File, APIError]:
1443
1451
  """Method `getFile`, see the [documentation](https://core.telegram.org/bots/api#getfile)
1444
1452
 
1445
1453
  Use this method to get basic information about a file and prepare it for downloading.
@@ -1454,17 +1462,20 @@ class APIMethods:
1454
1462
  :param file_id: File identifier to get information about.
1455
1463
  """
1456
1464
 
1457
- method_response = await self.api.request_raw("getFile", get_params(locals()))
1465
+ method_response = await self.api.request_raw(
1466
+ "getFile",
1467
+ get_params(locals()),
1468
+ )
1458
1469
  return full_result(method_response, File)
1459
1470
 
1460
1471
  async def ban_chat_member(
1461
1472
  self,
1462
1473
  chat_id: int | str,
1463
1474
  user_id: int,
1464
- until_date: int | Option[int] = Nothing,
1465
- revoke_messages: bool | Option[bool] = Nothing,
1475
+ until_date: datetime | int | None = None,
1476
+ revoke_messages: bool | None = None,
1466
1477
  **other: typing.Any,
1467
- ) -> Result[bool, "APIError"]:
1478
+ ) -> Result[bool, APIError]:
1468
1479
  """Method `banChatMember`, see the [documentation](https://core.telegram.org/bots/api#banchatmember)
1469
1480
 
1470
1481
  Use this method to ban a user in a group, a supergroup or a channel. In the case
@@ -1488,7 +1499,8 @@ class APIMethods:
1488
1499
  """
1489
1500
 
1490
1501
  method_response = await self.api.request_raw(
1491
- "banChatMember", get_params(locals())
1502
+ "banChatMember",
1503
+ get_params(locals()),
1492
1504
  )
1493
1505
  return full_result(method_response, bool)
1494
1506
 
@@ -1496,9 +1508,9 @@ class APIMethods:
1496
1508
  self,
1497
1509
  chat_id: int | str,
1498
1510
  user_id: int,
1499
- only_if_banned: bool | Option[bool] = Nothing,
1511
+ only_if_banned: bool | None = None,
1500
1512
  **other: typing.Any,
1501
- ) -> Result[bool, "APIError"]:
1513
+ ) -> Result[bool, APIError]:
1502
1514
  """Method `unbanChatMember`, see the [documentation](https://core.telegram.org/bots/api#unbanchatmember)
1503
1515
 
1504
1516
  Use this method to unban a previously banned user in a supergroup or channel.
@@ -1518,7 +1530,8 @@ class APIMethods:
1518
1530
  """
1519
1531
 
1520
1532
  method_response = await self.api.request_raw(
1521
- "unbanChatMember", get_params(locals())
1533
+ "unbanChatMember",
1534
+ get_params(locals()),
1522
1535
  )
1523
1536
  return full_result(method_response, bool)
1524
1537
 
@@ -1527,10 +1540,10 @@ class APIMethods:
1527
1540
  chat_id: int | str,
1528
1541
  user_id: int,
1529
1542
  permissions: ChatPermissions,
1530
- use_independent_chat_permissions: bool | Option[bool] = Nothing,
1531
- until_date: int | Option[int] = Nothing,
1543
+ use_independent_chat_permissions: bool | None = None,
1544
+ until_date: datetime | int | None = None,
1532
1545
  **other: typing.Any,
1533
- ) -> Result[bool, "APIError"]:
1546
+ ) -> Result[bool, APIError]:
1534
1547
  """Method `restrictChatMember`, see the [documentation](https://core.telegram.org/bots/api#restrictchatmember)
1535
1548
 
1536
1549
  Use this method to restrict a user in a supergroup. The bot must be an administrator
@@ -1557,7 +1570,8 @@ class APIMethods:
1557
1570
  """
1558
1571
 
1559
1572
  method_response = await self.api.request_raw(
1560
- "restrictChatMember", get_params(locals())
1573
+ "restrictChatMember",
1574
+ get_params(locals()),
1561
1575
  )
1562
1576
  return full_result(method_response, bool)
1563
1577
 
@@ -1565,23 +1579,23 @@ class APIMethods:
1565
1579
  self,
1566
1580
  chat_id: int | str,
1567
1581
  user_id: int,
1568
- is_anonymous: bool | Option[bool] = Nothing,
1569
- can_manage_chat: bool | Option[bool] = Nothing,
1570
- can_delete_messages: bool | Option[bool] = Nothing,
1571
- can_manage_video_chats: bool | Option[bool] = Nothing,
1572
- can_restrict_members: bool | Option[bool] = Nothing,
1573
- can_promote_members: bool | Option[bool] = Nothing,
1574
- can_change_info: bool | Option[bool] = Nothing,
1575
- can_invite_users: bool | Option[bool] = Nothing,
1576
- can_post_stories: bool | Option[bool] = Nothing,
1577
- can_edit_stories: bool | Option[bool] = Nothing,
1578
- can_delete_stories: bool | Option[bool] = Nothing,
1579
- can_post_messages: bool | Option[bool] = Nothing,
1580
- can_edit_messages: bool | Option[bool] = Nothing,
1581
- can_pin_messages: bool | Option[bool] = Nothing,
1582
- can_manage_topics: bool | Option[bool] = Nothing,
1583
- **other: typing.Any,
1584
- ) -> Result[bool, "APIError"]:
1582
+ is_anonymous: bool | None = None,
1583
+ can_manage_chat: bool | None = None,
1584
+ can_delete_messages: bool | None = None,
1585
+ can_manage_video_chats: bool | None = None,
1586
+ can_restrict_members: bool | None = None,
1587
+ can_promote_members: bool | None = None,
1588
+ can_change_info: bool | None = None,
1589
+ can_invite_users: bool | None = None,
1590
+ can_post_stories: bool | None = None,
1591
+ can_edit_stories: bool | None = None,
1592
+ can_delete_stories: bool | None = None,
1593
+ can_post_messages: bool | None = None,
1594
+ can_edit_messages: bool | None = None,
1595
+ can_pin_messages: bool | None = None,
1596
+ can_manage_topics: bool | None = None,
1597
+ **other: typing.Any,
1598
+ ) -> Result[bool, APIError]:
1585
1599
  """Method `promoteChatMember`, see the [documentation](https://core.telegram.org/bots/api#promotechatmember)
1586
1600
 
1587
1601
  Use this method to promote or demote a user in a supergroup or a channel. The
@@ -1623,19 +1637,20 @@ class APIMethods:
1623
1637
  :param can_delete_stories: Pass True if the administrator can delete stories posted by other users. \
1624
1638
 
1625
1639
  :param can_post_messages: Pass True if the administrator can post messages in the channel, or access \
1626
- channel statistics; channels only.
1640
+ channel statistics; for channels only.
1627
1641
 
1628
1642
  :param can_edit_messages: Pass True if the administrator can edit messages of other users and can pin \
1629
- messages; channels only.
1643
+ messages; for channels only.
1630
1644
 
1631
- :param can_pin_messages: Pass True if the administrator can pin messages, supergroups only.
1645
+ :param can_pin_messages: Pass True if the administrator can pin messages; for supergroups only. \
1632
1646
 
1633
1647
  :param can_manage_topics: Pass True if the user is allowed to create, rename, close, and reopen forum \
1634
- topics, supergroups only.
1648
+ topics; for supergroups only.
1635
1649
  """
1636
1650
 
1637
1651
  method_response = await self.api.request_raw(
1638
- "promoteChatMember", get_params(locals())
1652
+ "promoteChatMember",
1653
+ get_params(locals()),
1639
1654
  )
1640
1655
  return full_result(method_response, bool)
1641
1656
 
@@ -1645,7 +1660,7 @@ class APIMethods:
1645
1660
  user_id: int,
1646
1661
  custom_title: str,
1647
1662
  **other: typing.Any,
1648
- ) -> Result[bool, "APIError"]:
1663
+ ) -> Result[bool, APIError]:
1649
1664
  """Method `setChatAdministratorCustomTitle`, see the [documentation](https://core.telegram.org/bots/api#setchatadministratorcustomtitle)
1650
1665
 
1651
1666
  Use this method to set a custom title for an administrator in a supergroup
@@ -1661,7 +1676,8 @@ class APIMethods:
1661
1676
  """
1662
1677
 
1663
1678
  method_response = await self.api.request_raw(
1664
- "setChatAdministratorCustomTitle", get_params(locals())
1679
+ "setChatAdministratorCustomTitle",
1680
+ get_params(locals()),
1665
1681
  )
1666
1682
  return full_result(method_response, bool)
1667
1683
 
@@ -1670,7 +1686,7 @@ class APIMethods:
1670
1686
  chat_id: int | str,
1671
1687
  sender_chat_id: int,
1672
1688
  **other: typing.Any,
1673
- ) -> Result[bool, "APIError"]:
1689
+ ) -> Result[bool, APIError]:
1674
1690
  """Method `banChatSenderChat`, see the [documentation](https://core.telegram.org/bots/api#banchatsenderchat)
1675
1691
 
1676
1692
  Use this method to ban a channel chat in a supergroup or a channel. Until the
@@ -1686,7 +1702,8 @@ class APIMethods:
1686
1702
  """
1687
1703
 
1688
1704
  method_response = await self.api.request_raw(
1689
- "banChatSenderChat", get_params(locals())
1705
+ "banChatSenderChat",
1706
+ get_params(locals()),
1690
1707
  )
1691
1708
  return full_result(method_response, bool)
1692
1709
 
@@ -1695,7 +1712,7 @@ class APIMethods:
1695
1712
  chat_id: int | str,
1696
1713
  sender_chat_id: int,
1697
1714
  **other: typing.Any,
1698
- ) -> Result[bool, "APIError"]:
1715
+ ) -> Result[bool, APIError]:
1699
1716
  """Method `unbanChatSenderChat`, see the [documentation](https://core.telegram.org/bots/api#unbanchatsenderchat)
1700
1717
 
1701
1718
  Use this method to unban a previously banned channel chat in a supergroup
@@ -1709,7 +1726,8 @@ class APIMethods:
1709
1726
  """
1710
1727
 
1711
1728
  method_response = await self.api.request_raw(
1712
- "unbanChatSenderChat", get_params(locals())
1729
+ "unbanChatSenderChat",
1730
+ get_params(locals()),
1713
1731
  )
1714
1732
  return full_result(method_response, bool)
1715
1733
 
@@ -1717,9 +1735,9 @@ class APIMethods:
1717
1735
  self,
1718
1736
  chat_id: int | str,
1719
1737
  permissions: ChatPermissions,
1720
- use_independent_chat_permissions: bool | Option[bool] = Nothing,
1738
+ use_independent_chat_permissions: bool | None = None,
1721
1739
  **other: typing.Any,
1722
- ) -> Result[bool, "APIError"]:
1740
+ ) -> Result[bool, APIError]:
1723
1741
  """Method `setChatPermissions`, see the [documentation](https://core.telegram.org/bots/api#setchatpermissions)
1724
1742
 
1725
1743
  Use this method to set default chat permissions for all members. The bot
@@ -1740,7 +1758,8 @@ class APIMethods:
1740
1758
  """
1741
1759
 
1742
1760
  method_response = await self.api.request_raw(
1743
- "setChatPermissions", get_params(locals())
1761
+ "setChatPermissions",
1762
+ get_params(locals()),
1744
1763
  )
1745
1764
  return full_result(method_response, bool)
1746
1765
 
@@ -1748,7 +1767,7 @@ class APIMethods:
1748
1767
  self,
1749
1768
  chat_id: int | str,
1750
1769
  **other: typing.Any,
1751
- ) -> Result[str, "APIError"]:
1770
+ ) -> Result[str, APIError]:
1752
1771
  """Method `exportChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#exportchatinvitelink)
1753
1772
 
1754
1773
  Use this method to generate a new primary invite link for a chat; any previously
@@ -1761,19 +1780,20 @@ class APIMethods:
1761
1780
  """
1762
1781
 
1763
1782
  method_response = await self.api.request_raw(
1764
- "exportChatInviteLink", get_params(locals())
1783
+ "exportChatInviteLink",
1784
+ get_params(locals()),
1765
1785
  )
1766
1786
  return full_result(method_response, str)
1767
1787
 
1768
1788
  async def create_chat_invite_link(
1769
1789
  self,
1770
1790
  chat_id: int | str,
1771
- name: str | Option[str] = Nothing,
1772
- expire_date: int | Option[int] = Nothing,
1773
- member_limit: int | Option[int] = Nothing,
1774
- creates_join_request: bool | Option[bool] = Nothing,
1791
+ name: str | None = None,
1792
+ expire_date: datetime | int | None = None,
1793
+ member_limit: int | None = None,
1794
+ creates_join_request: bool | None = None,
1775
1795
  **other: typing.Any,
1776
- ) -> Result[ChatInviteLink, "APIError"]:
1796
+ ) -> Result[ChatInviteLink, APIError]:
1777
1797
  """Method `createChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#createchatinvitelink)
1778
1798
 
1779
1799
  Use this method to create an additional invite link for a chat. The bot must
@@ -1796,7 +1816,8 @@ class APIMethods:
1796
1816
  """
1797
1817
 
1798
1818
  method_response = await self.api.request_raw(
1799
- "createChatInviteLink", get_params(locals())
1819
+ "createChatInviteLink",
1820
+ get_params(locals()),
1800
1821
  )
1801
1822
  return full_result(method_response, ChatInviteLink)
1802
1823
 
@@ -1804,12 +1825,12 @@ class APIMethods:
1804
1825
  self,
1805
1826
  chat_id: int | str,
1806
1827
  invite_link: str,
1807
- name: str | Option[str] = Nothing,
1808
- expire_date: int | Option[int] = Nothing,
1809
- member_limit: int | Option[int] = Nothing,
1810
- creates_join_request: bool | Option[bool] = Nothing,
1828
+ name: str | None = None,
1829
+ expire_date: datetime | int | None = None,
1830
+ member_limit: int | None = None,
1831
+ creates_join_request: bool | None = None,
1811
1832
  **other: typing.Any,
1812
- ) -> Result[ChatInviteLink, "APIError"]:
1833
+ ) -> Result[ChatInviteLink, APIError]:
1813
1834
  """Method `editChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#editchatinvitelink)
1814
1835
 
1815
1836
  Use this method to edit a non-primary invite link created by the bot. The
@@ -1834,7 +1855,8 @@ class APIMethods:
1834
1855
  """
1835
1856
 
1836
1857
  method_response = await self.api.request_raw(
1837
- "editChatInviteLink", get_params(locals())
1858
+ "editChatInviteLink",
1859
+ get_params(locals()),
1838
1860
  )
1839
1861
  return full_result(method_response, ChatInviteLink)
1840
1862
 
@@ -1843,7 +1865,7 @@ class APIMethods:
1843
1865
  chat_id: int | str,
1844
1866
  invite_link: str,
1845
1867
  **other: typing.Any,
1846
- ) -> Result[ChatInviteLink, "APIError"]:
1868
+ ) -> Result[ChatInviteLink, APIError]:
1847
1869
  """Method `revokeChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#revokechatinvitelink)
1848
1870
 
1849
1871
  Use this method to revoke an invite link created by the bot. If the primary
@@ -1859,7 +1881,8 @@ class APIMethods:
1859
1881
  """
1860
1882
 
1861
1883
  method_response = await self.api.request_raw(
1862
- "revokeChatInviteLink", get_params(locals())
1884
+ "revokeChatInviteLink",
1885
+ get_params(locals()),
1863
1886
  )
1864
1887
  return full_result(method_response, ChatInviteLink)
1865
1888
 
@@ -1868,7 +1891,7 @@ class APIMethods:
1868
1891
  chat_id: int | str,
1869
1892
  user_id: int,
1870
1893
  **other: typing.Any,
1871
- ) -> Result[bool, "APIError"]:
1894
+ ) -> Result[bool, APIError]:
1872
1895
  """Method `approveChatJoinRequest`, see the [documentation](https://core.telegram.org/bots/api#approvechatjoinrequest)
1873
1896
 
1874
1897
  Use this method to approve a chat join request. The bot must be an administrator
@@ -1882,7 +1905,8 @@ class APIMethods:
1882
1905
  """
1883
1906
 
1884
1907
  method_response = await self.api.request_raw(
1885
- "approveChatJoinRequest", get_params(locals())
1908
+ "approveChatJoinRequest",
1909
+ get_params(locals()),
1886
1910
  )
1887
1911
  return full_result(method_response, bool)
1888
1912
 
@@ -1891,7 +1915,7 @@ class APIMethods:
1891
1915
  chat_id: int | str,
1892
1916
  user_id: int,
1893
1917
  **other: typing.Any,
1894
- ) -> Result[bool, "APIError"]:
1918
+ ) -> Result[bool, APIError]:
1895
1919
  """Method `declineChatJoinRequest`, see the [documentation](https://core.telegram.org/bots/api#declinechatjoinrequest)
1896
1920
 
1897
1921
  Use this method to decline a chat join request. The bot must be an administrator
@@ -1905,7 +1929,8 @@ class APIMethods:
1905
1929
  """
1906
1930
 
1907
1931
  method_response = await self.api.request_raw(
1908
- "declineChatJoinRequest", get_params(locals())
1932
+ "declineChatJoinRequest",
1933
+ get_params(locals()),
1909
1934
  )
1910
1935
  return full_result(method_response, bool)
1911
1936
 
@@ -1914,7 +1939,7 @@ class APIMethods:
1914
1939
  chat_id: int | str,
1915
1940
  photo: InputFile,
1916
1941
  **other: typing.Any,
1917
- ) -> Result[bool, "APIError"]:
1942
+ ) -> Result[bool, APIError]:
1918
1943
  """Method `setChatPhoto`, see the [documentation](https://core.telegram.org/bots/api#setchatphoto)
1919
1944
 
1920
1945
  Use this method to set a new profile photo for the chat. Photos can't be changed
@@ -1929,7 +1954,8 @@ class APIMethods:
1929
1954
  """
1930
1955
 
1931
1956
  method_response = await self.api.request_raw(
1932
- "setChatPhoto", get_params(locals())
1957
+ "setChatPhoto",
1958
+ get_params(locals()),
1933
1959
  )
1934
1960
  return full_result(method_response, bool)
1935
1961
 
@@ -1937,7 +1963,7 @@ class APIMethods:
1937
1963
  self,
1938
1964
  chat_id: int | str,
1939
1965
  **other: typing.Any,
1940
- ) -> Result[bool, "APIError"]:
1966
+ ) -> Result[bool, APIError]:
1941
1967
  """Method `deleteChatPhoto`, see the [documentation](https://core.telegram.org/bots/api#deletechatphoto)
1942
1968
 
1943
1969
  Use this method to delete a chat photo. Photos can't be changed for private
@@ -1949,7 +1975,8 @@ class APIMethods:
1949
1975
  """
1950
1976
 
1951
1977
  method_response = await self.api.request_raw(
1952
- "deleteChatPhoto", get_params(locals())
1978
+ "deleteChatPhoto",
1979
+ get_params(locals()),
1953
1980
  )
1954
1981
  return full_result(method_response, bool)
1955
1982
 
@@ -1958,7 +1985,7 @@ class APIMethods:
1958
1985
  chat_id: int | str,
1959
1986
  title: str,
1960
1987
  **other: typing.Any,
1961
- ) -> Result[bool, "APIError"]:
1988
+ ) -> Result[bool, APIError]:
1962
1989
  """Method `setChatTitle`, see the [documentation](https://core.telegram.org/bots/api#setchattitle)
1963
1990
 
1964
1991
  Use this method to change the title of a chat. Titles can't be changed for
@@ -1972,16 +1999,17 @@ class APIMethods:
1972
1999
  """
1973
2000
 
1974
2001
  method_response = await self.api.request_raw(
1975
- "setChatTitle", get_params(locals())
2002
+ "setChatTitle",
2003
+ get_params(locals()),
1976
2004
  )
1977
2005
  return full_result(method_response, bool)
1978
2006
 
1979
2007
  async def set_chat_description(
1980
2008
  self,
1981
2009
  chat_id: int | str,
1982
- description: str | Option[str] = Nothing,
2010
+ description: str | None = None,
1983
2011
  **other: typing.Any,
1984
- ) -> Result[bool, "APIError"]:
2012
+ ) -> Result[bool, APIError]:
1985
2013
  """Method `setChatDescription`, see the [documentation](https://core.telegram.org/bots/api#setchatdescription)
1986
2014
 
1987
2015
  Use this method to change the description of a group, a supergroup or a channel.
@@ -1995,7 +2023,8 @@ class APIMethods:
1995
2023
  """
1996
2024
 
1997
2025
  method_response = await self.api.request_raw(
1998
- "setChatDescription", get_params(locals())
2026
+ "setChatDescription",
2027
+ get_params(locals()),
1999
2028
  )
2000
2029
  return full_result(method_response, bool)
2001
2030
 
@@ -2003,9 +2032,9 @@ class APIMethods:
2003
2032
  self,
2004
2033
  chat_id: int | str,
2005
2034
  message_id: int,
2006
- disable_notification: bool | Option[bool] = Nothing,
2035
+ disable_notification: bool | None = None,
2007
2036
  **other: typing.Any,
2008
- ) -> Result[bool, "APIError"]:
2037
+ ) -> Result[bool, APIError]:
2009
2038
  """Method `pinChatMessage`, see the [documentation](https://core.telegram.org/bots/api#pinchatmessage)
2010
2039
 
2011
2040
  Use this method to add a message to the list of pinned messages in a chat. If
@@ -2025,16 +2054,17 @@ class APIMethods:
2025
2054
  """
2026
2055
 
2027
2056
  method_response = await self.api.request_raw(
2028
- "pinChatMessage", get_params(locals())
2057
+ "pinChatMessage",
2058
+ get_params(locals()),
2029
2059
  )
2030
2060
  return full_result(method_response, bool)
2031
2061
 
2032
2062
  async def unpin_chat_message(
2033
2063
  self,
2034
2064
  chat_id: int | str,
2035
- message_id: int | Option[int] = Nothing,
2065
+ message_id: int | None = None,
2036
2066
  **other: typing.Any,
2037
- ) -> Result[bool, "APIError"]:
2067
+ ) -> Result[bool, APIError]:
2038
2068
  """Method `unpinChatMessage`, see the [documentation](https://core.telegram.org/bots/api#unpinchatmessage)
2039
2069
 
2040
2070
  Use this method to remove a message from the list of pinned messages in a chat.
@@ -2051,7 +2081,8 @@ class APIMethods:
2051
2081
  """
2052
2082
 
2053
2083
  method_response = await self.api.request_raw(
2054
- "unpinChatMessage", get_params(locals())
2084
+ "unpinChatMessage",
2085
+ get_params(locals()),
2055
2086
  )
2056
2087
  return full_result(method_response, bool)
2057
2088
 
@@ -2059,7 +2090,7 @@ class APIMethods:
2059
2090
  self,
2060
2091
  chat_id: int | str,
2061
2092
  **other: typing.Any,
2062
- ) -> Result[bool, "APIError"]:
2093
+ ) -> Result[bool, APIError]:
2063
2094
  """Method `unpinAllChatMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallchatmessages)
2064
2095
 
2065
2096
  Use this method to clear the list of pinned messages in a chat. If the chat
@@ -2073,7 +2104,8 @@ class APIMethods:
2073
2104
  """
2074
2105
 
2075
2106
  method_response = await self.api.request_raw(
2076
- "unpinAllChatMessages", get_params(locals())
2107
+ "unpinAllChatMessages",
2108
+ get_params(locals()),
2077
2109
  )
2078
2110
  return full_result(method_response, bool)
2079
2111
 
@@ -2081,7 +2113,7 @@ class APIMethods:
2081
2113
  self,
2082
2114
  chat_id: int | str,
2083
2115
  **other: typing.Any,
2084
- ) -> Result[bool, "APIError"]:
2116
+ ) -> Result[bool, APIError]:
2085
2117
  """Method `leaveChat`, see the [documentation](https://core.telegram.org/bots/api#leavechat)
2086
2118
 
2087
2119
  Use this method for your bot to leave a group, supergroup or channel. Returns
@@ -2091,14 +2123,17 @@ class APIMethods:
2091
2123
  or channel (in the format @channelusername).
2092
2124
  """
2093
2125
 
2094
- method_response = await self.api.request_raw("leaveChat", get_params(locals()))
2126
+ method_response = await self.api.request_raw(
2127
+ "leaveChat",
2128
+ get_params(locals()),
2129
+ )
2095
2130
  return full_result(method_response, bool)
2096
2131
 
2097
2132
  async def get_chat(
2098
2133
  self,
2099
2134
  chat_id: int | str,
2100
2135
  **other: typing.Any,
2101
- ) -> Result[Chat, "APIError"]:
2136
+ ) -> Result[Chat, APIError]:
2102
2137
  """Method `getChat`, see the [documentation](https://core.telegram.org/bots/api#getchat)
2103
2138
 
2104
2139
  Use this method to get up to date information about the chat. Returns a Chat
@@ -2108,7 +2143,10 @@ class APIMethods:
2108
2143
  or channel (in the format @channelusername).
2109
2144
  """
2110
2145
 
2111
- method_response = await self.api.request_raw("getChat", get_params(locals()))
2146
+ method_response = await self.api.request_raw(
2147
+ "getChat",
2148
+ get_params(locals()),
2149
+ )
2112
2150
  return full_result(method_response, Chat)
2113
2151
 
2114
2152
  async def get_chat_administrators(
@@ -2126,7 +2164,7 @@ class APIMethods:
2126
2164
  ChatMemberBanned,
2127
2165
  ]
2128
2166
  ],
2129
- "APIError",
2167
+ APIError,
2130
2168
  ]:
2131
2169
  """Method `getChatAdministrators`, see the [documentation](https://core.telegram.org/bots/api#getchatadministrators)
2132
2170
 
@@ -2138,7 +2176,8 @@ class APIMethods:
2138
2176
  """
2139
2177
 
2140
2178
  method_response = await self.api.request_raw(
2141
- "getChatAdministrators", get_params(locals())
2179
+ "getChatAdministrators",
2180
+ get_params(locals()),
2142
2181
  )
2143
2182
  return full_result(
2144
2183
  method_response,
@@ -2158,7 +2197,7 @@ class APIMethods:
2158
2197
  self,
2159
2198
  chat_id: int | str,
2160
2199
  **other: typing.Any,
2161
- ) -> Result[int, "APIError"]:
2200
+ ) -> Result[int, APIError]:
2162
2201
  """Method `getChatMemberCount`, see the [documentation](https://core.telegram.org/bots/api#getchatmembercount)
2163
2202
 
2164
2203
  Use this method to get the number of members in a chat. Returns Int on success.
@@ -2168,7 +2207,8 @@ class APIMethods:
2168
2207
  """
2169
2208
 
2170
2209
  method_response = await self.api.request_raw(
2171
- "getChatMemberCount", get_params(locals())
2210
+ "getChatMemberCount",
2211
+ get_params(locals()),
2172
2212
  )
2173
2213
  return full_result(method_response, int)
2174
2214
 
@@ -2186,7 +2226,7 @@ class APIMethods:
2186
2226
  ChatMemberLeft,
2187
2227
  ChatMemberBanned,
2188
2228
  ],
2189
- "APIError",
2229
+ APIError,
2190
2230
  ]:
2191
2231
  """Method `getChatMember`, see the [documentation](https://core.telegram.org/bots/api#getchatmember)
2192
2232
 
@@ -2201,7 +2241,8 @@ class APIMethods:
2201
2241
  """
2202
2242
 
2203
2243
  method_response = await self.api.request_raw(
2204
- "getChatMember", get_params(locals())
2244
+ "getChatMember",
2245
+ get_params(locals()),
2205
2246
  )
2206
2247
  return full_result(
2207
2248
  method_response,
@@ -2220,7 +2261,7 @@ class APIMethods:
2220
2261
  chat_id: int | str,
2221
2262
  sticker_set_name: str,
2222
2263
  **other: typing.Any,
2223
- ) -> Result[bool, "APIError"]:
2264
+ ) -> Result[bool, APIError]:
2224
2265
  """Method `setChatStickerSet`, see the [documentation](https://core.telegram.org/bots/api#setchatstickerset)
2225
2266
 
2226
2267
  Use this method to set a new group sticker set for a supergroup. The bot must
@@ -2236,7 +2277,8 @@ class APIMethods:
2236
2277
  """
2237
2278
 
2238
2279
  method_response = await self.api.request_raw(
2239
- "setChatStickerSet", get_params(locals())
2280
+ "setChatStickerSet",
2281
+ get_params(locals()),
2240
2282
  )
2241
2283
  return full_result(method_response, bool)
2242
2284
 
@@ -2244,7 +2286,7 @@ class APIMethods:
2244
2286
  self,
2245
2287
  chat_id: int | str,
2246
2288
  **other: typing.Any,
2247
- ) -> Result[bool, "APIError"]:
2289
+ ) -> Result[bool, APIError]:
2248
2290
  """Method `deleteChatStickerSet`, see the [documentation](https://core.telegram.org/bots/api#deletechatstickerset)
2249
2291
 
2250
2292
  Use this method to delete a group sticker set from a supergroup. The bot must
@@ -2258,13 +2300,14 @@ class APIMethods:
2258
2300
  """
2259
2301
 
2260
2302
  method_response = await self.api.request_raw(
2261
- "deleteChatStickerSet", get_params(locals())
2303
+ "deleteChatStickerSet",
2304
+ get_params(locals()),
2262
2305
  )
2263
2306
  return full_result(method_response, bool)
2264
2307
 
2265
2308
  async def get_forum_topic_icon_stickers(
2266
2309
  self, **other: typing.Any
2267
- ) -> Result[list[Sticker], "APIError"]:
2310
+ ) -> Result[list[Sticker], APIError]:
2268
2311
  """Method `getForumTopicIconStickers`, see the [documentation](https://core.telegram.org/bots/api#getforumtopiciconstickers)
2269
2312
 
2270
2313
  Use this method to get custom emoji stickers, which can be used as a forum
@@ -2273,7 +2316,8 @@ class APIMethods:
2273
2316
  """
2274
2317
 
2275
2318
  method_response = await self.api.request_raw(
2276
- "getForumTopicIconStickers", get_params(locals())
2319
+ "getForumTopicIconStickers",
2320
+ get_params(locals()),
2277
2321
  )
2278
2322
  return full_result(method_response, list[Sticker])
2279
2323
 
@@ -2281,10 +2325,10 @@ class APIMethods:
2281
2325
  self,
2282
2326
  chat_id: int | str,
2283
2327
  name: str,
2284
- icon_color: int | Option[int] = Nothing,
2285
- icon_custom_emoji_id: str | Option[str] = Nothing,
2328
+ icon_color: TopicIconColor | None = None,
2329
+ icon_custom_emoji_id: str | None = None,
2286
2330
  **other: typing.Any,
2287
- ) -> Result[ForumTopic, "APIError"]:
2331
+ ) -> Result[ForumTopic, APIError]:
2288
2332
  """Method `createForumTopic`, see the [documentation](https://core.telegram.org/bots/api#createforumtopic)
2289
2333
 
2290
2334
  Use this method to create a topic in a forum supergroup chat. The bot must
@@ -2306,7 +2350,8 @@ class APIMethods:
2306
2350
  """
2307
2351
 
2308
2352
  method_response = await self.api.request_raw(
2309
- "createForumTopic", get_params(locals())
2353
+ "createForumTopic",
2354
+ get_params(locals()),
2310
2355
  )
2311
2356
  return full_result(method_response, ForumTopic)
2312
2357
 
@@ -2314,10 +2359,10 @@ class APIMethods:
2314
2359
  self,
2315
2360
  chat_id: int | str,
2316
2361
  message_thread_id: int,
2317
- name: str | Option[str] = Nothing,
2318
- icon_custom_emoji_id: str | Option[str] = Nothing,
2362
+ name: str | None = None,
2363
+ icon_custom_emoji_id: str | None = None,
2319
2364
  **other: typing.Any,
2320
- ) -> Result[bool, "APIError"]:
2365
+ ) -> Result[bool, APIError]:
2321
2366
  """Method `editForumTopic`, see the [documentation](https://core.telegram.org/bots/api#editforumtopic)
2322
2367
 
2323
2368
  Use this method to edit name and icon of a topic in a forum supergroup chat.
@@ -2339,7 +2384,8 @@ class APIMethods:
2339
2384
  """
2340
2385
 
2341
2386
  method_response = await self.api.request_raw(
2342
- "editForumTopic", get_params(locals())
2387
+ "editForumTopic",
2388
+ get_params(locals()),
2343
2389
  )
2344
2390
  return full_result(method_response, bool)
2345
2391
 
@@ -2348,7 +2394,7 @@ class APIMethods:
2348
2394
  chat_id: int | str,
2349
2395
  message_thread_id: int,
2350
2396
  **other: typing.Any,
2351
- ) -> Result[bool, "APIError"]:
2397
+ ) -> Result[bool, APIError]:
2352
2398
  """Method `closeForumTopic`, see the [documentation](https://core.telegram.org/bots/api#closeforumtopic)
2353
2399
 
2354
2400
  Use this method to close an open topic in a forum supergroup chat. The bot
@@ -2363,7 +2409,8 @@ class APIMethods:
2363
2409
  """
2364
2410
 
2365
2411
  method_response = await self.api.request_raw(
2366
- "closeForumTopic", get_params(locals())
2412
+ "closeForumTopic",
2413
+ get_params(locals()),
2367
2414
  )
2368
2415
  return full_result(method_response, bool)
2369
2416
 
@@ -2372,7 +2419,7 @@ class APIMethods:
2372
2419
  chat_id: int | str,
2373
2420
  message_thread_id: int,
2374
2421
  **other: typing.Any,
2375
- ) -> Result[bool, "APIError"]:
2422
+ ) -> Result[bool, APIError]:
2376
2423
  """Method `reopenForumTopic`, see the [documentation](https://core.telegram.org/bots/api#reopenforumtopic)
2377
2424
 
2378
2425
  Use this method to reopen a closed topic in a forum supergroup chat. The bot
@@ -2387,7 +2434,8 @@ class APIMethods:
2387
2434
  """
2388
2435
 
2389
2436
  method_response = await self.api.request_raw(
2390
- "reopenForumTopic", get_params(locals())
2437
+ "reopenForumTopic",
2438
+ get_params(locals()),
2391
2439
  )
2392
2440
  return full_result(method_response, bool)
2393
2441
 
@@ -2396,7 +2444,7 @@ class APIMethods:
2396
2444
  chat_id: int | str,
2397
2445
  message_thread_id: int,
2398
2446
  **other: typing.Any,
2399
- ) -> Result[bool, "APIError"]:
2447
+ ) -> Result[bool, APIError]:
2400
2448
  """Method `deleteForumTopic`, see the [documentation](https://core.telegram.org/bots/api#deleteforumtopic)
2401
2449
 
2402
2450
  Use this method to delete a forum topic along with all its messages in a forum
@@ -2411,7 +2459,8 @@ class APIMethods:
2411
2459
  """
2412
2460
 
2413
2461
  method_response = await self.api.request_raw(
2414
- "deleteForumTopic", get_params(locals())
2462
+ "deleteForumTopic",
2463
+ get_params(locals()),
2415
2464
  )
2416
2465
  return full_result(method_response, bool)
2417
2466
 
@@ -2420,7 +2469,7 @@ class APIMethods:
2420
2469
  chat_id: int | str,
2421
2470
  message_thread_id: int,
2422
2471
  **other: typing.Any,
2423
- ) -> Result[bool, "APIError"]:
2472
+ ) -> Result[bool, APIError]:
2424
2473
  """Method `unpinAllForumTopicMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallforumtopicmessages)
2425
2474
 
2426
2475
  Use this method to clear the list of pinned messages in a forum topic. The
@@ -2435,7 +2484,8 @@ class APIMethods:
2435
2484
  """
2436
2485
 
2437
2486
  method_response = await self.api.request_raw(
2438
- "unpinAllForumTopicMessages", get_params(locals())
2487
+ "unpinAllForumTopicMessages",
2488
+ get_params(locals()),
2439
2489
  )
2440
2490
  return full_result(method_response, bool)
2441
2491
 
@@ -2444,7 +2494,7 @@ class APIMethods:
2444
2494
  chat_id: int | str,
2445
2495
  name: str,
2446
2496
  **other: typing.Any,
2447
- ) -> Result[bool, "APIError"]:
2497
+ ) -> Result[bool, APIError]:
2448
2498
  """Method `editGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#editgeneralforumtopic)
2449
2499
 
2450
2500
  Use this method to edit the name of the 'General' topic in a forum supergroup
@@ -2458,7 +2508,8 @@ class APIMethods:
2458
2508
  """
2459
2509
 
2460
2510
  method_response = await self.api.request_raw(
2461
- "editGeneralForumTopic", get_params(locals())
2511
+ "editGeneralForumTopic",
2512
+ get_params(locals()),
2462
2513
  )
2463
2514
  return full_result(method_response, bool)
2464
2515
 
@@ -2466,7 +2517,7 @@ class APIMethods:
2466
2517
  self,
2467
2518
  chat_id: int | str,
2468
2519
  **other: typing.Any,
2469
- ) -> Result[bool, "APIError"]:
2520
+ ) -> Result[bool, APIError]:
2470
2521
  """Method `closeGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#closegeneralforumtopic)
2471
2522
 
2472
2523
  Use this method to close an open 'General' topic in a forum supergroup chat.
@@ -2478,7 +2529,8 @@ class APIMethods:
2478
2529
  """
2479
2530
 
2480
2531
  method_response = await self.api.request_raw(
2481
- "closeGeneralForumTopic", get_params(locals())
2532
+ "closeGeneralForumTopic",
2533
+ get_params(locals()),
2482
2534
  )
2483
2535
  return full_result(method_response, bool)
2484
2536
 
@@ -2486,7 +2538,7 @@ class APIMethods:
2486
2538
  self,
2487
2539
  chat_id: int | str,
2488
2540
  **other: typing.Any,
2489
- ) -> Result[bool, "APIError"]:
2541
+ ) -> Result[bool, APIError]:
2490
2542
  """Method `reopenGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#reopengeneralforumtopic)
2491
2543
 
2492
2544
  Use this method to reopen a closed 'General' topic in a forum supergroup
@@ -2499,7 +2551,8 @@ class APIMethods:
2499
2551
  """
2500
2552
 
2501
2553
  method_response = await self.api.request_raw(
2502
- "reopenGeneralForumTopic", get_params(locals())
2554
+ "reopenGeneralForumTopic",
2555
+ get_params(locals()),
2503
2556
  )
2504
2557
  return full_result(method_response, bool)
2505
2558
 
@@ -2507,7 +2560,7 @@ class APIMethods:
2507
2560
  self,
2508
2561
  chat_id: int | str,
2509
2562
  **other: typing.Any,
2510
- ) -> Result[bool, "APIError"]:
2563
+ ) -> Result[bool, APIError]:
2511
2564
  """Method `hideGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#hidegeneralforumtopic)
2512
2565
 
2513
2566
  Use this method to hide the 'General' topic in a forum supergroup chat. The
@@ -2520,7 +2573,8 @@ class APIMethods:
2520
2573
  """
2521
2574
 
2522
2575
  method_response = await self.api.request_raw(
2523
- "hideGeneralForumTopic", get_params(locals())
2576
+ "hideGeneralForumTopic",
2577
+ get_params(locals()),
2524
2578
  )
2525
2579
  return full_result(method_response, bool)
2526
2580
 
@@ -2528,7 +2582,7 @@ class APIMethods:
2528
2582
  self,
2529
2583
  chat_id: int | str,
2530
2584
  **other: typing.Any,
2531
- ) -> Result[bool, "APIError"]:
2585
+ ) -> Result[bool, APIError]:
2532
2586
  """Method `unhideGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#unhidegeneralforumtopic)
2533
2587
 
2534
2588
  Use this method to unhide the 'General' topic in a forum supergroup chat.
@@ -2540,7 +2594,8 @@ class APIMethods:
2540
2594
  """
2541
2595
 
2542
2596
  method_response = await self.api.request_raw(
2543
- "unhideGeneralForumTopic", get_params(locals())
2597
+ "unhideGeneralForumTopic",
2598
+ get_params(locals()),
2544
2599
  )
2545
2600
  return full_result(method_response, bool)
2546
2601
 
@@ -2548,7 +2603,7 @@ class APIMethods:
2548
2603
  self,
2549
2604
  chat_id: int | str,
2550
2605
  **other: typing.Any,
2551
- ) -> Result[bool, "APIError"]:
2606
+ ) -> Result[bool, APIError]:
2552
2607
  """Method `unpinAllGeneralForumTopicMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages)
2553
2608
 
2554
2609
  Use this method to clear the list of pinned messages in a General forum topic.
@@ -2561,19 +2616,20 @@ class APIMethods:
2561
2616
  """
2562
2617
 
2563
2618
  method_response = await self.api.request_raw(
2564
- "unpinAllGeneralForumTopicMessages", get_params(locals())
2619
+ "unpinAllGeneralForumTopicMessages",
2620
+ get_params(locals()),
2565
2621
  )
2566
2622
  return full_result(method_response, bool)
2567
2623
 
2568
2624
  async def answer_callback_query(
2569
2625
  self,
2570
2626
  callback_query_id: str,
2571
- text: str | Option[str] = Nothing,
2572
- show_alert: bool | Option[bool] = Nothing,
2573
- url: str | Option[str] = Nothing,
2574
- cache_time: int | Option[int] = Nothing,
2627
+ text: str | None = None,
2628
+ show_alert: bool | None = None,
2629
+ url: str | None = None,
2630
+ cache_time: int | None = None,
2575
2631
  **other: typing.Any,
2576
- ) -> Result[bool, "APIError"]:
2632
+ ) -> Result[bool, APIError]:
2577
2633
  """Method `answerCallbackQuery`, see the [documentation](https://core.telegram.org/bots/api#answercallbackquery)
2578
2634
 
2579
2635
  Use this method to send answers to callback queries sent from inline keyboards.
@@ -2600,7 +2656,8 @@ class APIMethods:
2600
2656
  """
2601
2657
 
2602
2658
  method_response = await self.api.request_raw(
2603
- "answerCallbackQuery", get_params(locals())
2659
+ "answerCallbackQuery",
2660
+ get_params(locals()),
2604
2661
  )
2605
2662
  return full_result(method_response, bool)
2606
2663
 
@@ -2609,7 +2666,7 @@ class APIMethods:
2609
2666
  chat_id: int | str,
2610
2667
  user_id: int,
2611
2668
  **other: typing.Any,
2612
- ) -> Result[UserChatBoosts, "APIError"]:
2669
+ ) -> Result[UserChatBoosts, APIError]:
2613
2670
  """Method `getUserChatBoosts`, see the [documentation](https://core.telegram.org/bots/api#getuserchatboosts)
2614
2671
 
2615
2672
  Use this method to get the list of boosts added to a chat by a user. Requires
@@ -2622,17 +2679,18 @@ class APIMethods:
2622
2679
  """
2623
2680
 
2624
2681
  method_response = await self.api.request_raw(
2625
- "getUserChatBoosts", get_params(locals())
2682
+ "getUserChatBoosts",
2683
+ get_params(locals()),
2626
2684
  )
2627
2685
  return full_result(method_response, UserChatBoosts)
2628
2686
 
2629
2687
  async def set_my_commands(
2630
2688
  self,
2631
2689
  commands: list[BotCommand],
2632
- scope: BotCommandScope | Option[BotCommandScope] = Nothing,
2633
- language_code: str | Option[str] = Nothing,
2690
+ scope: BotCommandScope | None = None,
2691
+ language_code: str | None = None,
2634
2692
  **other: typing.Any,
2635
- ) -> Result[bool, "APIError"]:
2693
+ ) -> Result[bool, APIError]:
2636
2694
  """Method `setMyCommands`, see the [documentation](https://core.telegram.org/bots/api#setmycommands)
2637
2695
 
2638
2696
  Use this method to change the list of the bot's commands. See this manual
@@ -2650,16 +2708,17 @@ class APIMethods:
2650
2708
  """
2651
2709
 
2652
2710
  method_response = await self.api.request_raw(
2653
- "setMyCommands", get_params(locals())
2711
+ "setMyCommands",
2712
+ get_params(locals()),
2654
2713
  )
2655
2714
  return full_result(method_response, bool)
2656
2715
 
2657
2716
  async def delete_my_commands(
2658
2717
  self,
2659
- scope: BotCommandScope | Option[BotCommandScope] = Nothing,
2660
- language_code: str | Option[str] = Nothing,
2718
+ scope: BotCommandScope | None = None,
2719
+ language_code: str | None = None,
2661
2720
  **other: typing.Any,
2662
- ) -> Result[bool, "APIError"]:
2721
+ ) -> Result[bool, APIError]:
2663
2722
  """Method `deleteMyCommands`, see the [documentation](https://core.telegram.org/bots/api#deletemycommands)
2664
2723
 
2665
2724
  Use this method to delete the list of the bot's commands for the given scope
@@ -2675,16 +2734,17 @@ class APIMethods:
2675
2734
  """
2676
2735
 
2677
2736
  method_response = await self.api.request_raw(
2678
- "deleteMyCommands", get_params(locals())
2737
+ "deleteMyCommands",
2738
+ get_params(locals()),
2679
2739
  )
2680
2740
  return full_result(method_response, bool)
2681
2741
 
2682
2742
  async def get_my_commands(
2683
2743
  self,
2684
- scope: BotCommandScope | Option[BotCommandScope] = Nothing,
2685
- language_code: str | Option[str] = Nothing,
2744
+ scope: BotCommandScope | None = None,
2745
+ language_code: str | None = None,
2686
2746
  **other: typing.Any,
2687
- ) -> Result[list[BotCommand], "APIError"]:
2747
+ ) -> Result[list[BotCommand], APIError]:
2688
2748
  """Method `getMyCommands`, see the [documentation](https://core.telegram.org/bots/api#getmycommands)
2689
2749
 
2690
2750
  Use this method to get the current list of the bot's commands for the given
@@ -2697,16 +2757,17 @@ class APIMethods:
2697
2757
  """
2698
2758
 
2699
2759
  method_response = await self.api.request_raw(
2700
- "getMyCommands", get_params(locals())
2760
+ "getMyCommands",
2761
+ get_params(locals()),
2701
2762
  )
2702
2763
  return full_result(method_response, list[BotCommand])
2703
2764
 
2704
2765
  async def set_my_name(
2705
2766
  self,
2706
- name: str | Option[str] = Nothing,
2707
- language_code: str | Option[str] = Nothing,
2767
+ name: str | None = None,
2768
+ language_code: str | None = None,
2708
2769
  **other: typing.Any,
2709
- ) -> Result[bool, "APIError"]:
2770
+ ) -> Result[bool, APIError]:
2710
2771
  """Method `setMyName`, see the [documentation](https://core.telegram.org/bots/api#setmyname)
2711
2772
 
2712
2773
  Use this method to change the bot's name. Returns True on success.
@@ -2718,14 +2779,17 @@ class APIMethods:
2718
2779
  all users for whose language there is no dedicated name.
2719
2780
  """
2720
2781
 
2721
- method_response = await self.api.request_raw("setMyName", get_params(locals()))
2782
+ method_response = await self.api.request_raw(
2783
+ "setMyName",
2784
+ get_params(locals()),
2785
+ )
2722
2786
  return full_result(method_response, bool)
2723
2787
 
2724
2788
  async def get_my_name(
2725
2789
  self,
2726
- language_code: str | Option[str] = Nothing,
2790
+ language_code: str | None = None,
2727
2791
  **other: typing.Any,
2728
- ) -> Result[BotName, "APIError"]:
2792
+ ) -> Result[BotName, APIError]:
2729
2793
  """Method `getMyName`, see the [documentation](https://core.telegram.org/bots/api#getmyname)
2730
2794
 
2731
2795
  Use this method to get the current bot name for the given user language. Returns
@@ -2734,15 +2798,18 @@ class APIMethods:
2734
2798
  :param language_code: A two-letter ISO 639-1 language code or an empty string.
2735
2799
  """
2736
2800
 
2737
- method_response = await self.api.request_raw("getMyName", get_params(locals()))
2801
+ method_response = await self.api.request_raw(
2802
+ "getMyName",
2803
+ get_params(locals()),
2804
+ )
2738
2805
  return full_result(method_response, BotName)
2739
2806
 
2740
2807
  async def set_my_description(
2741
2808
  self,
2742
- description: str | Option[str] = Nothing,
2743
- language_code: str | Option[str] = Nothing,
2809
+ description: str | None = None,
2810
+ language_code: str | None = None,
2744
2811
  **other: typing.Any,
2745
- ) -> Result[bool, "APIError"]:
2812
+ ) -> Result[bool, APIError]:
2746
2813
  """Method `setMyDescription`, see the [documentation](https://core.telegram.org/bots/api#setmydescription)
2747
2814
 
2748
2815
  Use this method to change the bot's description, which is shown in the chat
@@ -2756,15 +2823,16 @@ class APIMethods:
2756
2823
  """
2757
2824
 
2758
2825
  method_response = await self.api.request_raw(
2759
- "setMyDescription", get_params(locals())
2826
+ "setMyDescription",
2827
+ get_params(locals()),
2760
2828
  )
2761
2829
  return full_result(method_response, bool)
2762
2830
 
2763
2831
  async def get_my_description(
2764
2832
  self,
2765
- language_code: str | Option[str] = Nothing,
2833
+ language_code: str | None = None,
2766
2834
  **other: typing.Any,
2767
- ) -> Result[BotDescription, "APIError"]:
2835
+ ) -> Result[BotDescription, APIError]:
2768
2836
  """Method `getMyDescription`, see the [documentation](https://core.telegram.org/bots/api#getmydescription)
2769
2837
 
2770
2838
  Use this method to get the current bot description for the given user language.
@@ -2774,16 +2842,17 @@ class APIMethods:
2774
2842
  """
2775
2843
 
2776
2844
  method_response = await self.api.request_raw(
2777
- "getMyDescription", get_params(locals())
2845
+ "getMyDescription",
2846
+ get_params(locals()),
2778
2847
  )
2779
2848
  return full_result(method_response, BotDescription)
2780
2849
 
2781
2850
  async def set_my_short_description(
2782
2851
  self,
2783
- short_description: str | Option[str] = Nothing,
2784
- language_code: str | Option[str] = Nothing,
2852
+ short_description: str | None = None,
2853
+ language_code: str | None = None,
2785
2854
  **other: typing.Any,
2786
- ) -> Result[bool, "APIError"]:
2855
+ ) -> Result[bool, APIError]:
2787
2856
  """Method `setMyShortDescription`, see the [documentation](https://core.telegram.org/bots/api#setmyshortdescription)
2788
2857
 
2789
2858
  Use this method to change the bot's short description, which is shown on
@@ -2798,15 +2867,16 @@ class APIMethods:
2798
2867
  """
2799
2868
 
2800
2869
  method_response = await self.api.request_raw(
2801
- "setMyShortDescription", get_params(locals())
2870
+ "setMyShortDescription",
2871
+ get_params(locals()),
2802
2872
  )
2803
2873
  return full_result(method_response, bool)
2804
2874
 
2805
2875
  async def get_my_short_description(
2806
2876
  self,
2807
- language_code: str | Option[str] = Nothing,
2877
+ language_code: str | None = None,
2808
2878
  **other: typing.Any,
2809
- ) -> Result[BotShortDescription, "APIError"]:
2879
+ ) -> Result[BotShortDescription, APIError]:
2810
2880
  """Method `getMyShortDescription`, see the [documentation](https://core.telegram.org/bots/api#getmyshortdescription)
2811
2881
 
2812
2882
  Use this method to get the current bot short description for the given user
@@ -2816,16 +2886,17 @@ class APIMethods:
2816
2886
  """
2817
2887
 
2818
2888
  method_response = await self.api.request_raw(
2819
- "getMyShortDescription", get_params(locals())
2889
+ "getMyShortDescription",
2890
+ get_params(locals()),
2820
2891
  )
2821
2892
  return full_result(method_response, BotShortDescription)
2822
2893
 
2823
2894
  async def set_chat_menu_button(
2824
2895
  self,
2825
- chat_id: int | Option[int] = Nothing,
2826
- menu_button: MenuButton | Option[MenuButton] = Nothing,
2896
+ chat_id: int | None = None,
2897
+ menu_button: MenuButton | None = None,
2827
2898
  **other: typing.Any,
2828
- ) -> Result[bool, "APIError"]:
2899
+ ) -> Result[bool, APIError]:
2829
2900
  """Method `setChatMenuButton`, see the [documentation](https://core.telegram.org/bots/api#setchatmenubutton)
2830
2901
 
2831
2902
  Use this method to change the bot's menu button in a private chat, or the default
@@ -2838,16 +2909,17 @@ class APIMethods:
2838
2909
  """
2839
2910
 
2840
2911
  method_response = await self.api.request_raw(
2841
- "setChatMenuButton", get_params(locals())
2912
+ "setChatMenuButton",
2913
+ get_params(locals()),
2842
2914
  )
2843
2915
  return full_result(method_response, bool)
2844
2916
 
2845
2917
  async def get_chat_menu_button(
2846
2918
  self,
2847
- chat_id: int | Option[int] = Nothing,
2919
+ chat_id: int | None = None,
2848
2920
  **other: typing.Any,
2849
2921
  ) -> Result[
2850
- Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault], "APIError"
2922
+ Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault], APIError
2851
2923
  ]:
2852
2924
  """Method `getChatMenuButton`, see the [documentation](https://core.telegram.org/bots/api#getchatmenubutton)
2853
2925
 
@@ -2859,7 +2931,8 @@ class APIMethods:
2859
2931
  """
2860
2932
 
2861
2933
  method_response = await self.api.request_raw(
2862
- "getChatMenuButton", get_params(locals())
2934
+ "getChatMenuButton",
2935
+ get_params(locals()),
2863
2936
  )
2864
2937
  return full_result(
2865
2938
  method_response,
@@ -2868,10 +2941,10 @@ class APIMethods:
2868
2941
 
2869
2942
  async def set_my_default_administrator_rights(
2870
2943
  self,
2871
- rights: ChatAdministratorRights | Option[ChatAdministratorRights] = Nothing,
2872
- for_channels: bool | Option[bool] = Nothing,
2944
+ rights: ChatAdministratorRights | None = None,
2945
+ for_channels: bool | None = None,
2873
2946
  **other: typing.Any,
2874
- ) -> Result[bool, "APIError"]:
2947
+ ) -> Result[bool, APIError]:
2875
2948
  """Method `setMyDefaultAdministratorRights`, see the [documentation](https://core.telegram.org/bots/api#setmydefaultadministratorrights)
2876
2949
 
2877
2950
  Use this method to change the default administrator rights requested by
@@ -2888,15 +2961,16 @@ class APIMethods:
2888
2961
  """
2889
2962
 
2890
2963
  method_response = await self.api.request_raw(
2891
- "setMyDefaultAdministratorRights", get_params(locals())
2964
+ "setMyDefaultAdministratorRights",
2965
+ get_params(locals()),
2892
2966
  )
2893
2967
  return full_result(method_response, bool)
2894
2968
 
2895
2969
  async def get_my_default_administrator_rights(
2896
2970
  self,
2897
- for_channels: bool | Option[bool] = Nothing,
2971
+ for_channels: bool | None = None,
2898
2972
  **other: typing.Any,
2899
- ) -> Result[ChatAdministratorRights, "APIError"]:
2973
+ ) -> Result[ChatAdministratorRights, APIError]:
2900
2974
  """Method `getMyDefaultAdministratorRights`, see the [documentation](https://core.telegram.org/bots/api#getmydefaultadministratorrights)
2901
2975
 
2902
2976
  Use this method to get the current default administrator rights of the bot.
@@ -2908,22 +2982,23 @@ class APIMethods:
2908
2982
  """
2909
2983
 
2910
2984
  method_response = await self.api.request_raw(
2911
- "getMyDefaultAdministratorRights", get_params(locals())
2985
+ "getMyDefaultAdministratorRights",
2986
+ get_params(locals()),
2912
2987
  )
2913
2988
  return full_result(method_response, ChatAdministratorRights)
2914
2989
 
2915
2990
  async def edit_message_text(
2916
2991
  self,
2917
2992
  text: str,
2918
- chat_id: int | str | Option[int | str] = Nothing,
2919
- message_id: int | Option[int] = Nothing,
2920
- inline_message_id: str | Option[str] = Nothing,
2921
- parse_mode: str | Option[str] = Nothing,
2922
- entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
2923
- link_preview_options: LinkPreviewOptions | Option[LinkPreviewOptions] = Nothing,
2924
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
2925
- **other: typing.Any,
2926
- ) -> Result[Variative[Message, bool], "APIError"]:
2993
+ chat_id: int | str | None = None,
2994
+ message_id: int | None = None,
2995
+ inline_message_id: str | None = None,
2996
+ parse_mode: str | None = None,
2997
+ entities: list[MessageEntity] | None = None,
2998
+ link_preview_options: LinkPreviewOptions | None = None,
2999
+ reply_markup: InlineKeyboardMarkup | None = None,
3000
+ **other: typing.Any,
3001
+ ) -> Result[Variative[Message, bool], APIError]:
2927
3002
  """Method `editMessageText`, see the [documentation](https://core.telegram.org/bots/api#editmessagetext)
2928
3003
 
2929
3004
  Use this method to edit text and game messages. On success, if the edited
@@ -2953,21 +3028,22 @@ class APIMethods:
2953
3028
  """
2954
3029
 
2955
3030
  method_response = await self.api.request_raw(
2956
- "editMessageText", get_params(locals())
3031
+ "editMessageText",
3032
+ get_params(locals()),
2957
3033
  )
2958
3034
  return full_result(method_response, Variative[Message, bool])
2959
3035
 
2960
3036
  async def edit_message_caption(
2961
3037
  self,
2962
- chat_id: int | str | Option[int | str] = Nothing,
2963
- message_id: int | Option[int] = Nothing,
2964
- inline_message_id: str | Option[str] = Nothing,
2965
- caption: str | Option[str] = Nothing,
2966
- parse_mode: str | Option[str] = Nothing,
2967
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
2968
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3038
+ chat_id: int | str | None = None,
3039
+ message_id: int | None = None,
3040
+ inline_message_id: str | None = None,
3041
+ caption: str | None = None,
3042
+ parse_mode: str | None = None,
3043
+ caption_entities: list[MessageEntity] | None = None,
3044
+ reply_markup: InlineKeyboardMarkup | None = None,
2969
3045
  **other: typing.Any,
2970
- ) -> Result[Variative[Message, bool], "APIError"]:
3046
+ ) -> Result[Variative[Message, bool], APIError]:
2971
3047
  """Method `editMessageCaption`, see the [documentation](https://core.telegram.org/bots/api#editmessagecaption)
2972
3048
 
2973
3049
  Use this method to edit captions of messages. On success, if the edited message
@@ -2995,19 +3071,20 @@ class APIMethods:
2995
3071
  """
2996
3072
 
2997
3073
  method_response = await self.api.request_raw(
2998
- "editMessageCaption", get_params(locals())
3074
+ "editMessageCaption",
3075
+ get_params(locals()),
2999
3076
  )
3000
3077
  return full_result(method_response, Variative[Message, bool])
3001
3078
 
3002
3079
  async def edit_message_media(
3003
3080
  self,
3004
3081
  media: InputMedia,
3005
- chat_id: int | str | Option[int | str] = Nothing,
3006
- message_id: int | Option[int] = Nothing,
3007
- inline_message_id: str | Option[str] = Nothing,
3008
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3082
+ chat_id: int | str | None = None,
3083
+ message_id: int | None = None,
3084
+ inline_message_id: str | None = None,
3085
+ reply_markup: InlineKeyboardMarkup | None = None,
3009
3086
  **other: typing.Any,
3010
- ) -> Result[Variative[Message, bool], "APIError"]:
3087
+ ) -> Result[Variative[Message, bool], APIError]:
3011
3088
  """Method `editMessageMedia`, see the [documentation](https://core.telegram.org/bots/api#editmessagemedia)
3012
3089
 
3013
3090
  Use this method to edit animation, audio, document, photo, or video messages.
@@ -3033,7 +3110,8 @@ class APIMethods:
3033
3110
  """
3034
3111
 
3035
3112
  method_response = await self.api.request_raw(
3036
- "editMessageMedia", get_params(locals())
3113
+ "editMessageMedia",
3114
+ get_params(locals()),
3037
3115
  )
3038
3116
  return full_result(method_response, Variative[Message, bool])
3039
3117
 
@@ -3041,15 +3119,15 @@ class APIMethods:
3041
3119
  self,
3042
3120
  latitude: float,
3043
3121
  longitude: float,
3044
- chat_id: int | str | Option[int | str] = Nothing,
3045
- message_id: int | Option[int] = Nothing,
3046
- inline_message_id: str | Option[str] = Nothing,
3047
- horizontal_accuracy: float | Option[float] = Nothing,
3048
- heading: int | Option[int] = Nothing,
3049
- proximity_alert_radius: int | Option[int] = Nothing,
3050
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3051
- **other: typing.Any,
3052
- ) -> Result[Variative[Message, bool], "APIError"]:
3122
+ chat_id: int | str | None = None,
3123
+ message_id: int | None = None,
3124
+ inline_message_id: str | None = None,
3125
+ horizontal_accuracy: float | None = None,
3126
+ heading: int | None = None,
3127
+ proximity_alert_radius: int | None = None,
3128
+ reply_markup: InlineKeyboardMarkup | None = None,
3129
+ **other: typing.Any,
3130
+ ) -> Result[Variative[Message, bool], APIError]:
3053
3131
  """Method `editMessageLiveLocation`, see the [documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
3054
3132
 
3055
3133
  Use this method to edit live location messages. A location can be edited
@@ -3082,18 +3160,19 @@ class APIMethods:
3082
3160
  """
3083
3161
 
3084
3162
  method_response = await self.api.request_raw(
3085
- "editMessageLiveLocation", get_params(locals())
3163
+ "editMessageLiveLocation",
3164
+ get_params(locals()),
3086
3165
  )
3087
3166
  return full_result(method_response, Variative[Message, bool])
3088
3167
 
3089
3168
  async def stop_message_live_location(
3090
3169
  self,
3091
- chat_id: int | str | Option[int | str] = Nothing,
3092
- message_id: int | Option[int] = Nothing,
3093
- inline_message_id: str | Option[str] = Nothing,
3094
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3170
+ chat_id: int | str | None = None,
3171
+ message_id: int | None = None,
3172
+ inline_message_id: str | None = None,
3173
+ reply_markup: InlineKeyboardMarkup | None = None,
3095
3174
  **other: typing.Any,
3096
- ) -> Result[Variative[Message, bool], "APIError"]:
3175
+ ) -> Result[Variative[Message, bool], APIError]:
3097
3176
  """Method `stopMessageLiveLocation`, see the [documentation](https://core.telegram.org/bots/api#stopmessagelivelocation)
3098
3177
 
3099
3178
  Use this method to stop updating a live location message before live_period
@@ -3113,18 +3192,19 @@ class APIMethods:
3113
3192
  """
3114
3193
 
3115
3194
  method_response = await self.api.request_raw(
3116
- "stopMessageLiveLocation", get_params(locals())
3195
+ "stopMessageLiveLocation",
3196
+ get_params(locals()),
3117
3197
  )
3118
3198
  return full_result(method_response, Variative[Message, bool])
3119
3199
 
3120
3200
  async def edit_message_reply_markup(
3121
3201
  self,
3122
- chat_id: int | str | Option[int | str] = Nothing,
3123
- message_id: int | Option[int] = Nothing,
3124
- inline_message_id: str | Option[str] = Nothing,
3125
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3202
+ chat_id: int | str | None = None,
3203
+ message_id: int | None = None,
3204
+ inline_message_id: str | None = None,
3205
+ reply_markup: InlineKeyboardMarkup | None = None,
3126
3206
  **other: typing.Any,
3127
- ) -> Result[Variative[Message, bool], "APIError"]:
3207
+ ) -> Result[Variative[Message, bool], APIError]:
3128
3208
  """Method `editMessageReplyMarkup`, see the [documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
3129
3209
 
3130
3210
  Use this method to edit only the reply markup of messages. On success, if
@@ -3144,7 +3224,8 @@ class APIMethods:
3144
3224
  """
3145
3225
 
3146
3226
  method_response = await self.api.request_raw(
3147
- "editMessageReplyMarkup", get_params(locals())
3227
+ "editMessageReplyMarkup",
3228
+ get_params(locals()),
3148
3229
  )
3149
3230
  return full_result(method_response, Variative[Message, bool])
3150
3231
 
@@ -3152,9 +3233,9 @@ class APIMethods:
3152
3233
  self,
3153
3234
  chat_id: int | str,
3154
3235
  message_id: int,
3155
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3236
+ reply_markup: InlineKeyboardMarkup | None = None,
3156
3237
  **other: typing.Any,
3157
- ) -> Result[Poll, "APIError"]:
3238
+ ) -> Result[Poll, APIError]:
3158
3239
  """Method `stopPoll`, see the [documentation](https://core.telegram.org/bots/api#stoppoll)
3159
3240
 
3160
3241
  Use this method to stop a poll which was sent by the bot. On success, the stopped
@@ -3168,7 +3249,10 @@ class APIMethods:
3168
3249
  :param reply_markup: A JSON-serialized object for a new message inline keyboard.
3169
3250
  """
3170
3251
 
3171
- method_response = await self.api.request_raw("stopPoll", get_params(locals()))
3252
+ method_response = await self.api.request_raw(
3253
+ "stopPoll",
3254
+ get_params(locals()),
3255
+ )
3172
3256
  return full_result(method_response, Poll)
3173
3257
 
3174
3258
  async def delete_message(
@@ -3176,7 +3260,7 @@ class APIMethods:
3176
3260
  chat_id: int | str,
3177
3261
  message_id: int,
3178
3262
  **other: typing.Any,
3179
- ) -> Result[bool, "APIError"]:
3263
+ ) -> Result[bool, APIError]:
3180
3264
  """Method `deleteMessage`, see the [documentation](https://core.telegram.org/bots/api#deletemessage)
3181
3265
 
3182
3266
  Use this method to delete a message, including service messages, with the
@@ -3198,7 +3282,8 @@ class APIMethods:
3198
3282
  """
3199
3283
 
3200
3284
  method_response = await self.api.request_raw(
3201
- "deleteMessage", get_params(locals())
3285
+ "deleteMessage",
3286
+ get_params(locals()),
3202
3287
  )
3203
3288
  return full_result(method_response, bool)
3204
3289
 
@@ -3207,7 +3292,7 @@ class APIMethods:
3207
3292
  chat_id: int | str,
3208
3293
  message_ids: list[int],
3209
3294
  **other: typing.Any,
3210
- ) -> Result[bool, "APIError"]:
3295
+ ) -> Result[bool, APIError]:
3211
3296
  """Method `deleteMessages`, see the [documentation](https://core.telegram.org/bots/api#deletemessages)
3212
3297
 
3213
3298
  Use this method to delete multiple messages simultaneously. If some of
@@ -3217,12 +3302,13 @@ class APIMethods:
3217
3302
  :param chat_id: Unique identifier for the target chat or username of the target channel \
3218
3303
  (in the format @channelusername).
3219
3304
 
3220
- :param message_ids: Identifiers of 1-100 messages to delete. See deleteMessage for limitations \
3221
- on which messages can be deleted.
3305
+ :param message_ids: A JSON-serialized list of 1-100 identifiers of messages to delete. See \
3306
+ deleteMessage for limitations on which messages can be deleted.
3222
3307
  """
3223
3308
 
3224
3309
  method_response = await self.api.request_raw(
3225
- "deleteMessages", get_params(locals())
3310
+ "deleteMessages",
3311
+ get_params(locals()),
3226
3312
  )
3227
3313
  return full_result(method_response, bool)
3228
3314
 
@@ -3230,23 +3316,20 @@ class APIMethods:
3230
3316
  self,
3231
3317
  chat_id: int | str,
3232
3318
  sticker: InputFile | str,
3233
- message_thread_id: int | Option[int] = Nothing,
3234
- emoji: str | Option[str] = Nothing,
3235
- disable_notification: bool | Option[bool] = Nothing,
3236
- protect_content: bool | Option[bool] = Nothing,
3237
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
3238
- reply_markup: InlineKeyboardMarkup
3239
- | ReplyKeyboardMarkup
3240
- | ReplyKeyboardRemove
3241
- | ForceReply
3242
- | Option[
3319
+ message_thread_id: int | None = None,
3320
+ emoji: str | None = None,
3321
+ disable_notification: bool | None = None,
3322
+ protect_content: bool | None = None,
3323
+ reply_parameters: ReplyParameters | None = None,
3324
+ reply_markup: (
3243
3325
  InlineKeyboardMarkup
3244
3326
  | ReplyKeyboardMarkup
3245
3327
  | ReplyKeyboardRemove
3246
3328
  | ForceReply
3247
- ] = Nothing,
3329
+ | None
3330
+ ) = None,
3248
3331
  **other: typing.Any,
3249
- ) -> Result[Message, "APIError"]:
3332
+ ) -> Result[Message, APIError]:
3250
3333
  """Method `sendSticker`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
3251
3334
 
3252
3335
  Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
@@ -3279,7 +3362,8 @@ class APIMethods:
3279
3362
  """
3280
3363
 
3281
3364
  method_response = await self.api.request_raw(
3282
- "sendSticker", get_params(locals())
3365
+ "sendSticker",
3366
+ get_params(locals()),
3283
3367
  )
3284
3368
  return full_result(method_response, Message)
3285
3369
 
@@ -3287,7 +3371,7 @@ class APIMethods:
3287
3371
  self,
3288
3372
  name: str,
3289
3373
  **other: typing.Any,
3290
- ) -> Result[StickerSet, "APIError"]:
3374
+ ) -> Result[StickerSet, APIError]:
3291
3375
  """Method `getStickerSet`, see the [documentation](https://core.telegram.org/bots/api#getstickerset)
3292
3376
 
3293
3377
  Use this method to get a sticker set. On success, a StickerSet object is returned.
@@ -3296,7 +3380,8 @@ class APIMethods:
3296
3380
  """
3297
3381
 
3298
3382
  method_response = await self.api.request_raw(
3299
- "getStickerSet", get_params(locals())
3383
+ "getStickerSet",
3384
+ get_params(locals()),
3300
3385
  )
3301
3386
  return full_result(method_response, StickerSet)
3302
3387
 
@@ -3304,18 +3389,19 @@ class APIMethods:
3304
3389
  self,
3305
3390
  custom_emoji_ids: list[str],
3306
3391
  **other: typing.Any,
3307
- ) -> Result[list[Sticker], "APIError"]:
3392
+ ) -> Result[list[Sticker], APIError]:
3308
3393
  """Method `getCustomEmojiStickers`, see the [documentation](https://core.telegram.org/bots/api#getcustomemojistickers)
3309
3394
 
3310
3395
  Use this method to get information about custom emoji stickers by their
3311
3396
  identifiers. Returns an Array of Sticker objects.
3312
3397
 
3313
- :param custom_emoji_ids: List of custom emoji identifiers. At most 200 custom emoji identifiers \
3314
- can be specified.
3398
+ :param custom_emoji_ids: A JSON-serialized list of custom emoji identifiers. At most 200 custom \
3399
+ emoji identifiers can be specified.
3315
3400
  """
3316
3401
 
3317
3402
  method_response = await self.api.request_raw(
3318
- "getCustomEmojiStickers", get_params(locals())
3403
+ "getCustomEmojiStickers",
3404
+ get_params(locals()),
3319
3405
  )
3320
3406
  return full_result(method_response, list[Sticker])
3321
3407
 
@@ -3323,9 +3409,9 @@ class APIMethods:
3323
3409
  self,
3324
3410
  user_id: int,
3325
3411
  sticker: InputFile,
3326
- sticker_format: str,
3412
+ sticker_format: typing.Literal["static", "animated", "video"],
3327
3413
  **other: typing.Any,
3328
- ) -> Result[File, "APIError"]:
3414
+ ) -> Result[File, APIError]:
3329
3415
  """Method `uploadStickerFile`, see the [documentation](https://core.telegram.org/bots/api#uploadstickerfile)
3330
3416
 
3331
3417
  Use this method to upload a file with a sticker for later use in the createNewStickerSet
@@ -3341,7 +3427,8 @@ class APIMethods:
3341
3427
  """
3342
3428
 
3343
3429
  method_response = await self.api.request_raw(
3344
- "uploadStickerFile", get_params(locals())
3430
+ "uploadStickerFile",
3431
+ get_params(locals()),
3345
3432
  )
3346
3433
  return full_result(method_response, File)
3347
3434
 
@@ -3351,11 +3438,11 @@ class APIMethods:
3351
3438
  name: str,
3352
3439
  title: str,
3353
3440
  stickers: list[InputSticker],
3354
- sticker_format: str,
3355
- sticker_type: str | Option[str] = Nothing,
3356
- needs_repainting: bool | Option[bool] = Nothing,
3441
+ sticker_format: typing.Literal["static", "animated", "video"],
3442
+ sticker_type: typing.Literal["regular", "mask", "custom_emoji"] | None = None,
3443
+ needs_repainting: bool | None = None,
3357
3444
  **other: typing.Any,
3358
- ) -> Result[bool, "APIError"]:
3445
+ ) -> Result[bool, APIError]:
3359
3446
  """Method `createNewStickerSet`, see the [documentation](https://core.telegram.org/bots/api#createnewstickerset)
3360
3447
 
3361
3448
  Use this method to create a new sticker set owned by a user. The bot will be
@@ -3385,7 +3472,8 @@ class APIMethods:
3385
3472
  """
3386
3473
 
3387
3474
  method_response = await self.api.request_raw(
3388
- "createNewStickerSet", get_params(locals())
3475
+ "createNewStickerSet",
3476
+ get_params(locals()),
3389
3477
  )
3390
3478
  return full_result(method_response, bool)
3391
3479
 
@@ -3395,7 +3483,7 @@ class APIMethods:
3395
3483
  name: str,
3396
3484
  sticker: InputSticker,
3397
3485
  **other: typing.Any,
3398
- ) -> Result[bool, "APIError"]:
3486
+ ) -> Result[bool, APIError]:
3399
3487
  """Method `addStickerToSet`, see the [documentation](https://core.telegram.org/bots/api#addstickertoset)
3400
3488
 
3401
3489
  Use this method to add a new sticker to a set created by the bot. The format
@@ -3414,7 +3502,8 @@ class APIMethods:
3414
3502
  """
3415
3503
 
3416
3504
  method_response = await self.api.request_raw(
3417
- "addStickerToSet", get_params(locals())
3505
+ "addStickerToSet",
3506
+ get_params(locals()),
3418
3507
  )
3419
3508
  return full_result(method_response, bool)
3420
3509
 
@@ -3423,7 +3512,7 @@ class APIMethods:
3423
3512
  sticker: str,
3424
3513
  position: int,
3425
3514
  **other: typing.Any,
3426
- ) -> Result[bool, "APIError"]:
3515
+ ) -> Result[bool, APIError]:
3427
3516
  """Method `setStickerPositionInSet`, see the [documentation](https://core.telegram.org/bots/api#setstickerpositioninset)
3428
3517
 
3429
3518
  Use this method to move a sticker in a set created by the bot to a specific position.
@@ -3435,7 +3524,8 @@ class APIMethods:
3435
3524
  """
3436
3525
 
3437
3526
  method_response = await self.api.request_raw(
3438
- "setStickerPositionInSet", get_params(locals())
3527
+ "setStickerPositionInSet",
3528
+ get_params(locals()),
3439
3529
  )
3440
3530
  return full_result(method_response, bool)
3441
3531
 
@@ -3443,7 +3533,7 @@ class APIMethods:
3443
3533
  self,
3444
3534
  sticker: str,
3445
3535
  **other: typing.Any,
3446
- ) -> Result[bool, "APIError"]:
3536
+ ) -> Result[bool, APIError]:
3447
3537
  """Method `deleteStickerFromSet`, see the [documentation](https://core.telegram.org/bots/api#deletestickerfromset)
3448
3538
 
3449
3539
  Use this method to delete a sticker from a set created by the bot. Returns
@@ -3453,7 +3543,8 @@ class APIMethods:
3453
3543
  """
3454
3544
 
3455
3545
  method_response = await self.api.request_raw(
3456
- "deleteStickerFromSet", get_params(locals())
3546
+ "deleteStickerFromSet",
3547
+ get_params(locals()),
3457
3548
  )
3458
3549
  return full_result(method_response, bool)
3459
3550
 
@@ -3462,7 +3553,7 @@ class APIMethods:
3462
3553
  sticker: str,
3463
3554
  emoji_list: list[str],
3464
3555
  **other: typing.Any,
3465
- ) -> Result[bool, "APIError"]:
3556
+ ) -> Result[bool, APIError]:
3466
3557
  """Method `setStickerEmojiList`, see the [documentation](https://core.telegram.org/bots/api#setstickeremojilist)
3467
3558
 
3468
3559
  Use this method to change the list of emoji assigned to a regular or custom
@@ -3475,16 +3566,17 @@ class APIMethods:
3475
3566
  """
3476
3567
 
3477
3568
  method_response = await self.api.request_raw(
3478
- "setStickerEmojiList", get_params(locals())
3569
+ "setStickerEmojiList",
3570
+ get_params(locals()),
3479
3571
  )
3480
3572
  return full_result(method_response, bool)
3481
3573
 
3482
3574
  async def set_sticker_keywords(
3483
3575
  self,
3484
3576
  sticker: str,
3485
- keywords: list[str] | Option[list[str]] = Nothing,
3577
+ keywords: list[str] | None = None,
3486
3578
  **other: typing.Any,
3487
- ) -> Result[bool, "APIError"]:
3579
+ ) -> Result[bool, APIError]:
3488
3580
  """Method `setStickerKeywords`, see the [documentation](https://core.telegram.org/bots/api#setstickerkeywords)
3489
3581
 
3490
3582
  Use this method to change search keywords assigned to a regular or custom
@@ -3498,16 +3590,17 @@ class APIMethods:
3498
3590
  """
3499
3591
 
3500
3592
  method_response = await self.api.request_raw(
3501
- "setStickerKeywords", get_params(locals())
3593
+ "setStickerKeywords",
3594
+ get_params(locals()),
3502
3595
  )
3503
3596
  return full_result(method_response, bool)
3504
3597
 
3505
3598
  async def set_sticker_mask_position(
3506
3599
  self,
3507
3600
  sticker: str,
3508
- mask_position: MaskPosition | Option[MaskPosition] = Nothing,
3601
+ mask_position: MaskPosition | None = None,
3509
3602
  **other: typing.Any,
3510
- ) -> Result[bool, "APIError"]:
3603
+ ) -> Result[bool, APIError]:
3511
3604
  """Method `setStickerMaskPosition`, see the [documentation](https://core.telegram.org/bots/api#setstickermaskposition)
3512
3605
 
3513
3606
  Use this method to change the mask position of a mask sticker. The sticker
@@ -3520,7 +3613,8 @@ class APIMethods:
3520
3613
  """
3521
3614
 
3522
3615
  method_response = await self.api.request_raw(
3523
- "setStickerMaskPosition", get_params(locals())
3616
+ "setStickerMaskPosition",
3617
+ get_params(locals()),
3524
3618
  )
3525
3619
  return full_result(method_response, bool)
3526
3620
 
@@ -3529,7 +3623,7 @@ class APIMethods:
3529
3623
  name: str,
3530
3624
  title: str,
3531
3625
  **other: typing.Any,
3532
- ) -> Result[bool, "APIError"]:
3626
+ ) -> Result[bool, APIError]:
3533
3627
  """Method `setStickerSetTitle`, see the [documentation](https://core.telegram.org/bots/api#setstickersettitle)
3534
3628
 
3535
3629
  Use this method to set the title of a created sticker set. Returns True on
@@ -3541,7 +3635,8 @@ class APIMethods:
3541
3635
  """
3542
3636
 
3543
3637
  method_response = await self.api.request_raw(
3544
- "setStickerSetTitle", get_params(locals())
3638
+ "setStickerSetTitle",
3639
+ get_params(locals()),
3545
3640
  )
3546
3641
  return full_result(method_response, bool)
3547
3642
 
@@ -3549,9 +3644,9 @@ class APIMethods:
3549
3644
  self,
3550
3645
  name: str,
3551
3646
  user_id: int,
3552
- thumbnail: InputFile | str | Option[InputFile | str] = Nothing,
3647
+ thumbnail: InputFile | str | None = None,
3553
3648
  **other: typing.Any,
3554
- ) -> Result[bool, "APIError"]:
3649
+ ) -> Result[bool, APIError]:
3555
3650
  """Method `setStickerSetThumbnail`, see the [documentation](https://core.telegram.org/bots/api#setstickersetthumbnail)
3556
3651
 
3557
3652
  Use this method to set the thumbnail of a regular or mask sticker set. The
@@ -3577,16 +3672,17 @@ class APIMethods:
3577
3672
  """
3578
3673
 
3579
3674
  method_response = await self.api.request_raw(
3580
- "setStickerSetThumbnail", get_params(locals())
3675
+ "setStickerSetThumbnail",
3676
+ get_params(locals()),
3581
3677
  )
3582
3678
  return full_result(method_response, bool)
3583
3679
 
3584
3680
  async def set_custom_emoji_sticker_set_thumbnail(
3585
3681
  self,
3586
3682
  name: str,
3587
- custom_emoji_id: str | Option[str] = Nothing,
3683
+ custom_emoji_id: str | None = None,
3588
3684
  **other: typing.Any,
3589
- ) -> Result[bool, "APIError"]:
3685
+ ) -> Result[bool, APIError]:
3590
3686
  """Method `setCustomEmojiStickerSetThumbnail`, see the [documentation](https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail)
3591
3687
 
3592
3688
  Use this method to set the thumbnail of a custom emoji sticker set. Returns
@@ -3599,7 +3695,8 @@ class APIMethods:
3599
3695
  """
3600
3696
 
3601
3697
  method_response = await self.api.request_raw(
3602
- "setCustomEmojiStickerSetThumbnail", get_params(locals())
3698
+ "setCustomEmojiStickerSetThumbnail",
3699
+ get_params(locals()),
3603
3700
  )
3604
3701
  return full_result(method_response, bool)
3605
3702
 
@@ -3607,7 +3704,7 @@ class APIMethods:
3607
3704
  self,
3608
3705
  name: str,
3609
3706
  **other: typing.Any,
3610
- ) -> Result[bool, "APIError"]:
3707
+ ) -> Result[bool, APIError]:
3611
3708
  """Method `deleteStickerSet`, see the [documentation](https://core.telegram.org/bots/api#deletestickerset)
3612
3709
 
3613
3710
  Use this method to delete a sticker set that was created by the bot. Returns
@@ -3617,7 +3714,8 @@ class APIMethods:
3617
3714
  """
3618
3715
 
3619
3716
  method_response = await self.api.request_raw(
3620
- "deleteStickerSet", get_params(locals())
3717
+ "deleteStickerSet",
3718
+ get_params(locals()),
3621
3719
  )
3622
3720
  return full_result(method_response, bool)
3623
3721
 
@@ -3625,12 +3723,12 @@ class APIMethods:
3625
3723
  self,
3626
3724
  inline_query_id: str,
3627
3725
  results: list[InlineQueryResult],
3628
- cache_time: int | Option[int] = Nothing,
3629
- is_personal: bool | Option[bool] = Nothing,
3630
- next_offset: str | Option[str] = Nothing,
3631
- button: InlineQueryResultsButton | Option[InlineQueryResultsButton] = Nothing,
3726
+ cache_time: int | None = None,
3727
+ is_personal: bool | None = None,
3728
+ next_offset: str | None = None,
3729
+ button: InlineQueryResultsButton | None = None,
3632
3730
  **other: typing.Any,
3633
- ) -> Result[bool, "APIError"]:
3731
+ ) -> Result[bool, APIError]:
3634
3732
  """Method `answerInlineQuery`, see the [documentation](https://core.telegram.org/bots/api#answerinlinequery)
3635
3733
 
3636
3734
  Use this method to send answers to an inline query. On success, True is returned.
@@ -3656,7 +3754,8 @@ class APIMethods:
3656
3754
  """
3657
3755
 
3658
3756
  method_response = await self.api.request_raw(
3659
- "answerInlineQuery", get_params(locals())
3757
+ "answerInlineQuery",
3758
+ get_params(locals()),
3660
3759
  )
3661
3760
  return full_result(method_response, bool)
3662
3761
 
@@ -3665,7 +3764,7 @@ class APIMethods:
3665
3764
  web_app_query_id: str,
3666
3765
  result: InlineQueryResult,
3667
3766
  **other: typing.Any,
3668
- ) -> Result[SentWebAppMessage, "APIError"]:
3767
+ ) -> Result[SentWebAppMessage, APIError]:
3669
3768
  """Method `answerWebAppQuery`, see the [documentation](https://core.telegram.org/bots/api#answerwebappquery)
3670
3769
 
3671
3770
  Use this method to set the result of an interaction with a Web App and send
@@ -3678,7 +3777,8 @@ class APIMethods:
3678
3777
  """
3679
3778
 
3680
3779
  method_response = await self.api.request_raw(
3681
- "answerWebAppQuery", get_params(locals())
3780
+ "answerWebAppQuery",
3781
+ get_params(locals()),
3682
3782
  )
3683
3783
  return full_result(method_response, SentWebAppMessage)
3684
3784
 
@@ -3691,28 +3791,28 @@ class APIMethods:
3691
3791
  provider_token: str,
3692
3792
  currency: str,
3693
3793
  prices: list[LabeledPrice],
3694
- message_thread_id: int | Option[int] = Nothing,
3695
- max_tip_amount: int | Option[int] = Nothing,
3696
- suggested_tip_amounts: list[int] | Option[list[int]] = Nothing,
3697
- start_parameter: str | Option[str] = Nothing,
3698
- provider_data: str | Option[str] = Nothing,
3699
- photo_url: str | Option[str] = Nothing,
3700
- photo_size: int | Option[int] = Nothing,
3701
- photo_width: int | Option[int] = Nothing,
3702
- photo_height: int | Option[int] = Nothing,
3703
- need_name: bool | Option[bool] = Nothing,
3704
- need_phone_number: bool | Option[bool] = Nothing,
3705
- need_email: bool | Option[bool] = Nothing,
3706
- need_shipping_address: bool | Option[bool] = Nothing,
3707
- send_phone_number_to_provider: bool | Option[bool] = Nothing,
3708
- send_email_to_provider: bool | Option[bool] = Nothing,
3709
- is_flexible: bool | Option[bool] = Nothing,
3710
- disable_notification: bool | Option[bool] = Nothing,
3711
- protect_content: bool | Option[bool] = Nothing,
3712
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
3713
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
3714
- **other: typing.Any,
3715
- ) -> Result[Message, "APIError"]:
3794
+ message_thread_id: int | None = None,
3795
+ max_tip_amount: int | None = None,
3796
+ suggested_tip_amounts: list[int] | None = None,
3797
+ start_parameter: str | None = None,
3798
+ provider_data: str | None = None,
3799
+ photo_url: str | None = None,
3800
+ photo_size: int | None = None,
3801
+ photo_width: int | None = None,
3802
+ photo_height: int | None = None,
3803
+ need_name: bool | None = None,
3804
+ need_phone_number: bool | None = None,
3805
+ need_email: bool | None = None,
3806
+ need_shipping_address: bool | None = None,
3807
+ send_phone_number_to_provider: bool | None = None,
3808
+ send_email_to_provider: bool | None = None,
3809
+ is_flexible: bool | None = None,
3810
+ disable_notification: bool | None = None,
3811
+ protect_content: bool | None = None,
3812
+ reply_parameters: ReplyParameters | None = None,
3813
+ reply_markup: InlineKeyboardMarkup | None = None,
3814
+ **other: typing.Any,
3815
+ ) -> Result[Message, APIError]:
3716
3816
  """Method `sendInvoice`, see the [documentation](https://core.telegram.org/bots/api#sendinvoice)
3717
3817
 
3718
3818
  Use this method to send invoices. On success, the sent Message is returned.
@@ -3793,7 +3893,8 @@ class APIMethods:
3793
3893
  """
3794
3894
 
3795
3895
  method_response = await self.api.request_raw(
3796
- "sendInvoice", get_params(locals())
3896
+ "sendInvoice",
3897
+ get_params(locals()),
3797
3898
  )
3798
3899
  return full_result(method_response, Message)
3799
3900
 
@@ -3805,22 +3906,22 @@ class APIMethods:
3805
3906
  provider_token: str,
3806
3907
  currency: str,
3807
3908
  prices: list[LabeledPrice],
3808
- max_tip_amount: int | Option[int] = Nothing,
3809
- suggested_tip_amounts: list[int] | Option[list[int]] = Nothing,
3810
- provider_data: str | Option[str] = Nothing,
3811
- photo_url: str | Option[str] = Nothing,
3812
- photo_size: int | Option[int] = Nothing,
3813
- photo_width: int | Option[int] = Nothing,
3814
- photo_height: int | Option[int] = Nothing,
3815
- need_name: bool | Option[bool] = Nothing,
3816
- need_phone_number: bool | Option[bool] = Nothing,
3817
- need_email: bool | Option[bool] = Nothing,
3818
- need_shipping_address: bool | Option[bool] = Nothing,
3819
- send_phone_number_to_provider: bool | Option[bool] = Nothing,
3820
- send_email_to_provider: bool | Option[bool] = Nothing,
3821
- is_flexible: bool | Option[bool] = Nothing,
3822
- **other: typing.Any,
3823
- ) -> Result[str, "APIError"]:
3909
+ max_tip_amount: int | None = None,
3910
+ suggested_tip_amounts: list[int] | None = None,
3911
+ provider_data: str | None = None,
3912
+ photo_url: str | None = None,
3913
+ photo_size: int | None = None,
3914
+ photo_width: int | None = None,
3915
+ photo_height: int | None = None,
3916
+ need_name: bool | None = None,
3917
+ need_phone_number: bool | None = None,
3918
+ need_email: bool | None = None,
3919
+ need_shipping_address: bool | None = None,
3920
+ send_phone_number_to_provider: bool | None = None,
3921
+ send_email_to_provider: bool | None = None,
3922
+ is_flexible: bool | None = None,
3923
+ **other: typing.Any,
3924
+ ) -> Result[str, APIError]:
3824
3925
  """Method `createInvoiceLink`, see the [documentation](https://core.telegram.org/bots/api#createinvoicelink)
3825
3926
 
3826
3927
  Use this method to create a link for an invoice. Returns the created invoice
@@ -3880,7 +3981,8 @@ class APIMethods:
3880
3981
  """
3881
3982
 
3882
3983
  method_response = await self.api.request_raw(
3883
- "createInvoiceLink", get_params(locals())
3984
+ "createInvoiceLink",
3985
+ get_params(locals()),
3884
3986
  )
3885
3987
  return full_result(method_response, str)
3886
3988
 
@@ -3888,10 +3990,10 @@ class APIMethods:
3888
3990
  self,
3889
3991
  shipping_query_id: str,
3890
3992
  ok: bool,
3891
- shipping_options: list[ShippingOption] | Option[list[ShippingOption]] = Nothing,
3892
- error_message: str | Option[str] = Nothing,
3993
+ shipping_options: list[ShippingOption] | None = None,
3994
+ error_message: str | None = None,
3893
3995
  **other: typing.Any,
3894
- ) -> Result[bool, "APIError"]:
3996
+ ) -> Result[bool, APIError]:
3895
3997
  """Method `answerShippingQuery`, see the [documentation](https://core.telegram.org/bots/api#answershippingquery)
3896
3998
 
3897
3999
  If you sent an invoice requesting a shipping address and the parameter is_flexible
@@ -3914,7 +4016,8 @@ class APIMethods:
3914
4016
  """
3915
4017
 
3916
4018
  method_response = await self.api.request_raw(
3917
- "answerShippingQuery", get_params(locals())
4019
+ "answerShippingQuery",
4020
+ get_params(locals()),
3918
4021
  )
3919
4022
  return full_result(method_response, bool)
3920
4023
 
@@ -3922,9 +4025,9 @@ class APIMethods:
3922
4025
  self,
3923
4026
  pre_checkout_query_id: str,
3924
4027
  ok: bool,
3925
- error_message: str | Option[str] = Nothing,
4028
+ error_message: str | None = None,
3926
4029
  **other: typing.Any,
3927
- ) -> Result[bool, "APIError"]:
4030
+ ) -> Result[bool, APIError]:
3928
4031
  """Method `answerPreCheckoutQuery`, see the [documentation](https://core.telegram.org/bots/api#answerprecheckoutquery)
3929
4032
 
3930
4033
  Once the user has confirmed their payment and shipping details, the Bot
@@ -3946,7 +4049,8 @@ class APIMethods:
3946
4049
  """
3947
4050
 
3948
4051
  method_response = await self.api.request_raw(
3949
- "answerPreCheckoutQuery", get_params(locals())
4052
+ "answerPreCheckoutQuery",
4053
+ get_params(locals()),
3950
4054
  )
3951
4055
  return full_result(method_response, bool)
3952
4056
 
@@ -3955,7 +4059,7 @@ class APIMethods:
3955
4059
  user_id: int,
3956
4060
  errors: list[PassportElementError],
3957
4061
  **other: typing.Any,
3958
- ) -> Result[bool, "APIError"]:
4062
+ ) -> Result[bool, APIError]:
3959
4063
  """Method `setPassportDataErrors`, see the [documentation](https://core.telegram.org/bots/api#setpassportdataerrors)
3960
4064
 
3961
4065
  Informs a user that some of the Telegram Passport elements they provided
@@ -3973,7 +4077,8 @@ class APIMethods:
3973
4077
  """
3974
4078
 
3975
4079
  method_response = await self.api.request_raw(
3976
- "setPassportDataErrors", get_params(locals())
4080
+ "setPassportDataErrors",
4081
+ get_params(locals()),
3977
4082
  )
3978
4083
  return full_result(method_response, bool)
3979
4084
 
@@ -3981,13 +4086,13 @@ class APIMethods:
3981
4086
  self,
3982
4087
  chat_id: int,
3983
4088
  game_short_name: str,
3984
- message_thread_id: int | Option[int] = Nothing,
3985
- disable_notification: bool | Option[bool] = Nothing,
3986
- protect_content: bool | Option[bool] = Nothing,
3987
- reply_parameters: ReplyParameters | Option[ReplyParameters] = Nothing,
3988
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
4089
+ message_thread_id: int | None = None,
4090
+ disable_notification: bool | None = None,
4091
+ protect_content: bool | None = None,
4092
+ reply_parameters: ReplyParameters | None = None,
4093
+ reply_markup: InlineKeyboardMarkup | None = None,
3989
4094
  **other: typing.Any,
3990
- ) -> Result[Message, "APIError"]:
4095
+ ) -> Result[Message, APIError]:
3991
4096
  """Method `sendGame`, see the [documentation](https://core.telegram.org/bots/api#sendgame)
3992
4097
 
3993
4098
  Use this method to send a game. On success, the sent Message is returned.
@@ -4010,20 +4115,23 @@ class APIMethods:
4010
4115
  button will be shown. If not empty, the first button must launch the game. \
4011
4116
  """
4012
4117
 
4013
- method_response = await self.api.request_raw("sendGame", get_params(locals()))
4118
+ method_response = await self.api.request_raw(
4119
+ "sendGame",
4120
+ get_params(locals()),
4121
+ )
4014
4122
  return full_result(method_response, Message)
4015
4123
 
4016
4124
  async def set_game_score(
4017
4125
  self,
4018
4126
  user_id: int,
4019
4127
  score: int,
4020
- force: bool | Option[bool] = Nothing,
4021
- disable_edit_message: bool | Option[bool] = Nothing,
4022
- chat_id: int | Option[int] = Nothing,
4023
- message_id: int | Option[int] = Nothing,
4024
- inline_message_id: str | Option[str] = Nothing,
4128
+ force: bool | None = None,
4129
+ disable_edit_message: bool | None = None,
4130
+ chat_id: int | None = None,
4131
+ message_id: int | None = None,
4132
+ inline_message_id: str | None = None,
4025
4133
  **other: typing.Any,
4026
- ) -> Result[Variative[Message, bool], "APIError"]:
4134
+ ) -> Result[Variative[Message, bool], APIError]:
4027
4135
  """Method `setGameScore`, see the [documentation](https://core.telegram.org/bots/api#setgamescore)
4028
4136
 
4029
4137
  Use this method to set the score of the specified user in a game message. On
@@ -4052,18 +4160,19 @@ class APIMethods:
4052
4160
  """
4053
4161
 
4054
4162
  method_response = await self.api.request_raw(
4055
- "setGameScore", get_params(locals())
4163
+ "setGameScore",
4164
+ get_params(locals()),
4056
4165
  )
4057
4166
  return full_result(method_response, Variative[Message, bool])
4058
4167
 
4059
4168
  async def get_game_high_scores(
4060
4169
  self,
4061
4170
  user_id: int,
4062
- chat_id: int | Option[int] = Nothing,
4063
- message_id: int | Option[int] = Nothing,
4064
- inline_message_id: str | Option[str] = Nothing,
4171
+ chat_id: int | None = None,
4172
+ message_id: int | None = None,
4173
+ inline_message_id: str | None = None,
4065
4174
  **other: typing.Any,
4066
- ) -> Result[list[GameHighScore], "APIError"]:
4175
+ ) -> Result[list[GameHighScore], APIError]:
4067
4176
  """Method `getGameHighScores`, see the [documentation](https://core.telegram.org/bots/api#getgamehighscores)
4068
4177
 
4069
4178
  Use this method to get data for high score tables. Will return the score of
@@ -4083,6 +4192,7 @@ class APIMethods:
4083
4192
  """
4084
4193
 
4085
4194
  method_response = await self.api.request_raw(
4086
- "getGameHighScores", get_params(locals())
4195
+ "getGameHighScores",
4196
+ get_params(locals()),
4087
4197
  )
4088
4198
  return full_result(method_response, list[GameHighScore])