telegrinder 0.1.dev159__py3-none-any.whl → 0.1.dev161__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 (127) hide show
  1. telegrinder/__init__.py +4 -2
  2. telegrinder/api/__init__.py +0 -0
  3. telegrinder/api/abc.py +5 -0
  4. telegrinder/api/api.py +4 -4
  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 +0 -0
  11. telegrinder/bot/cute_types/callback_query.py +81 -85
  12. telegrinder/bot/cute_types/inline_query.py +36 -9
  13. telegrinder/bot/cute_types/message.py +524 -568
  14. telegrinder/bot/cute_types/update.py +0 -0
  15. telegrinder/bot/cute_types/utils.py +201 -453
  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 +20 -16
  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 +0 -0
  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 +2 -2
  69. telegrinder/bot/scenario/abc.py +0 -0
  70. telegrinder/bot/scenario/checkbox.py +9 -13
  71. telegrinder/bot/scenario/choice.py +2 -2
  72. telegrinder/client/__init__.py +0 -0
  73. telegrinder/client/abc.py +0 -0
  74. telegrinder/client/aiohttp.py +0 -0
  75. telegrinder/model.py +35 -36
  76. telegrinder/modules.py +21 -11
  77. telegrinder/msgspec_json.py +0 -0
  78. telegrinder/msgspec_utils.py +2 -2
  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 -3
  93. telegrinder/tools/buttons.py +0 -0
  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 +2 -0
  122. telegrinder/types/methods.py +477 -526
  123. telegrinder/types/objects.py +209 -97
  124. {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/LICENSE +0 -0
  125. {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/METADATA +9 -8
  126. {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/RECORD +38 -37
  127. {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/WHEEL +1 -1
@@ -1,7 +1,6 @@
1
1
  import typing
2
2
 
3
3
  from telegrinder.model import get_params
4
- from telegrinder.msgspec_utils import Nothing, Option
5
4
  from telegrinder.types import (
6
5
  InlineKeyboardMarkup,
7
6
  InlineQueryResultArticle,
@@ -51,6 +50,13 @@ InputMedia: typing.TypeAlias = typing.Union[
51
50
  InputMediaPhoto,
52
51
  InputMediaVideo,
53
52
  ]
53
+ InputMessageContent: typing.TypeAlias = typing.Union[
54
+ InputTextMessageContent,
55
+ InputLocationMessageContent,
56
+ InputVenueMessageContent,
57
+ InputContactMessageContent,
58
+ InputInvoiceMessageContent,
59
+ ]
54
60
 
55
61
  INPUT_MEDIA_TYPES: typing.Final[dict[str, type[InputMedia]]] = {
56
62
  "animation": InputMediaAnimation,
@@ -62,33 +68,36 @@ INPUT_MEDIA_TYPES: typing.Final[dict[str, type[InputMedia]]] = {
62
68
 
63
69
 
64
70
  def compose_reactions(
65
- reactions: str
66
- | ReactionEmoji
67
- | ReactionType
68
- | list[str | ReactionEmoji | ReactionType],
71
+ reactions: (
72
+ str | ReactionEmoji | ReactionType | list[str | ReactionEmoji | ReactionType]
73
+ ),
69
74
  /,
70
75
  ) -> list[ReactionType]:
71
76
  if not isinstance(reactions, list):
72
77
  reactions = [reactions]
73
78
  return [
74
- ReactionTypeEmoji("emoji", emoji)
75
- if isinstance(emoji, ReactionEmoji)
76
- else ReactionTypeEmoji("emoji", ReactionEmoji(emoji))
77
- if isinstance(emoji, str)
78
- else emoji
79
+ (
80
+ ReactionTypeEmoji("emoji", emoji)
81
+ if isinstance(emoji, ReactionEmoji)
82
+ else (
83
+ ReactionTypeEmoji("emoji", ReactionEmoji(emoji))
84
+ if isinstance(emoji, str)
85
+ else emoji
86
+ )
87
+ )
79
88
  for emoji in ([reactions] if isinstance(reactions, str) else reactions)
80
89
  ]
81
90
 
82
91
 
83
92
  def compose_reply_params(
84
- message_id: int | Option[int],
85
- chat_id: int | str | Option[int | str],
93
+ message_id: int | None,
94
+ chat_id: int | str | None,
86
95
  *,
87
- allow_sending_without_reply: bool | Option[bool] = Nothing,
88
- quote: str | Option[str] = Nothing,
89
- quote_parse_mode: str | Option[str] = Nothing,
90
- quote_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
91
- quote_position: int | Option[int] = Nothing,
96
+ allow_sending_without_reply: bool | None = None,
97
+ quote: str | None = None,
98
+ quote_parse_mode: str | None = None,
99
+ quote_entities: list[MessageEntity] | None = None,
100
+ quote_position: int | None = None,
92
101
  **other: typing.Any,
93
102
  ) -> ReplyParameters:
94
103
  return ReplyParameters(**get_params(locals()))
@@ -96,11 +105,11 @@ def compose_reply_params(
96
105
 
97
106
  def compose_link_preview_options(
98
107
  *,
99
- is_disabled: bool | Option[bool] = Nothing,
100
- url: str | Option[str] = Nothing,
101
- prefer_small_media: bool | Option[bool] = Nothing,
102
- prefer_large_media: bool | Option[bool] = Nothing,
103
- show_above_text: bool | Option[bool] = Nothing,
108
+ is_disabled: bool | None = None,
109
+ url: str | None = None,
110
+ prefer_small_media: bool | None = None,
111
+ prefer_large_media: bool | None = None,
112
+ show_above_text: bool | None = None,
104
113
  **other: typing.Any,
105
114
  ) -> LinkPreviewOptions:
106
115
  return LinkPreviewOptions(**get_params(locals()))
@@ -110,9 +119,9 @@ def input_media(
110
119
  type: typing.Literal["animation", "audio", "document", "photo", "video"],
111
120
  media: str | InputFile,
112
121
  *,
113
- caption: str | Option[str] = Nothing,
114
- parse_mode: str | Option[str] = Nothing,
115
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
122
+ caption: str | None = None,
123
+ parse_mode: str | None = None,
124
+ caption_entities: list[MessageEntity] | None = None,
116
125
  **other: typing.Any,
117
126
  ) -> InputMedia:
118
127
  return INPUT_MEDIA_TYPES[type](**get_params(locals()))
@@ -122,8 +131,8 @@ def input_contact_message_content(
122
131
  phone_number: str,
123
132
  first_name: str,
124
133
  *,
125
- last_name: str | Option[str] = Nothing,
126
- vcard: str | Option[str] = Nothing,
134
+ last_name: str | None = None,
135
+ vcard: str | None = None,
127
136
  ) -> InputContactMessageContent:
128
137
  return InputContactMessageContent(**get_params(locals()))
129
138
 
@@ -134,20 +143,20 @@ def input_invoice_message_content(
134
143
  payload: str,
135
144
  provider_token: str,
136
145
  currency: str,
137
- *,
138
146
  prices: list[LabeledPrice],
139
- max_tip_amount: int | Option[int] = Nothing,
140
- suggested_tip_amounts: list[int] | Option[list[int]] = Nothing,
141
- provider_data: str | Option[str] = Nothing,
142
- photo_url: str | Option[str] = Nothing,
143
- photo_size: int | Option[int] = Nothing,
144
- photo_width: int | Option[int] = Nothing,
145
- photo_height: int | Option[int] = Nothing,
146
- need_name: bool | Option[bool] = Nothing,
147
- need_phone_number: bool | Option[bool] = Nothing,
148
- need_email: bool | Option[bool] = Nothing,
149
- need_shipping_address: bool | Option[bool] = Nothing,
150
- send_phone_number_to_provider: bool | Option[bool] = Nothing,
147
+ *,
148
+ max_tip_amount: int | None = None,
149
+ suggested_tip_amounts: list[int] | None = None,
150
+ provider_data: str | None = None,
151
+ photo_url: str | None = None,
152
+ photo_size: int | None = None,
153
+ photo_width: int | None = None,
154
+ photo_height: int | None = None,
155
+ need_name: bool | None = None,
156
+ need_phone_number: bool | None = None,
157
+ need_email: bool | None = None,
158
+ need_shipping_address: bool | None = None,
159
+ send_phone_number_to_provider: bool | None = None,
151
160
  ) -> InputInvoiceMessageContent:
152
161
  return InputInvoiceMessageContent(**get_params(locals()))
153
162
 
@@ -156,10 +165,10 @@ def input_location_message_content(
156
165
  latitude: float,
157
166
  longitude: float,
158
167
  *,
159
- horizontal_accuracy: float | Option[float] = Nothing,
160
- live_period: int | Option[int] = Nothing,
161
- heading: int | Option[int] = Nothing,
162
- proximity_alert_radius: int | Option[int] = Nothing,
168
+ horizontal_accuracy: float | None = None,
169
+ live_period: int | None = None,
170
+ heading: int | None = None,
171
+ proximity_alert_radius: int | None = None,
163
172
  ) -> InputLocationMessageContent:
164
173
  return InputLocationMessageContent(**get_params(locals()))
165
174
 
@@ -167,9 +176,9 @@ def input_location_message_content(
167
176
  def input_text_message_content(
168
177
  message_text: str,
169
178
  *,
170
- parse_mode: str | Option[str] = Nothing,
171
- entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
172
- disable_web_page_preview: bool | Option[bool] = Nothing,
179
+ parse_mode: str | None = None,
180
+ entities: list[MessageEntity] | None = None,
181
+ disable_web_page_preview: bool | None = None,
173
182
  ) -> InputTextMessageContent:
174
183
  return InputTextMessageContent(**get_params(locals()))
175
184
 
@@ -180,10 +189,10 @@ def input_venue_message_content(
180
189
  title: str,
181
190
  address: str,
182
191
  *,
183
- foursquare_id: str | Option[str] = Nothing,
184
- foursquare_type: str | Option[str] = Nothing,
185
- google_place_id: str | Option[str] = Nothing,
186
- google_place_type: str | Option[str] = Nothing,
192
+ foursquare_id: str | None = None,
193
+ foursquare_type: str | None = None,
194
+ google_place_id: str | None = None,
195
+ google_place_type: str | None = None,
187
196
  ) -> InputVenueMessageContent:
188
197
  return InputVenueMessageContent(**get_params(locals()))
189
198
 
@@ -191,21 +200,15 @@ def input_venue_message_content(
191
200
  def inline_query_article(
192
201
  id: str,
193
202
  title: str,
194
- input_message_content: typing.Union[
195
- InputTextMessageContent,
196
- InputLocationMessageContent,
197
- InputVenueMessageContent,
198
- InputContactMessageContent,
199
- InputInvoiceMessageContent,
200
- ],
203
+ input_message_content: InputMessageContent,
201
204
  *,
202
- reply_markup: Option[InlineKeyboardMarkup] = Nothing,
203
- url: str | Option[str] = Nothing,
204
- hide_url: bool | Option[bool] = Nothing,
205
- description: str | Option[str] = Nothing,
206
- thumbnail_url: str | Option[str] = Nothing,
207
- thumbnail_width: int | Option[int] = Nothing,
208
- thumbnail_height: int | Option[int] = Nothing,
205
+ reply_markup: InlineKeyboardMarkup | None = None,
206
+ url: str | None = None,
207
+ hide_url: bool | None = None,
208
+ description: str | None = None,
209
+ thumbnail_url: str | None = None,
210
+ thumbnail_width: int | None = None,
211
+ thumbnail_height: int | None = None,
209
212
  ) -> InlineQueryResultArticle:
210
213
  return InlineQueryResultArticle(type="article", **get_params(locals()))
211
214
 
@@ -214,29 +217,14 @@ def inline_query_audio(
214
217
  id: str,
215
218
  audio_url: str,
216
219
  *,
217
- title: str | Option[str] = Nothing,
218
- caption: str | Option[str] = Nothing,
219
- parse_mode: str | Option[str] = Nothing,
220
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
221
- performer: str | Option[str] = Nothing,
222
- audio_duration: int | Option[int] = Nothing,
223
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
224
- input_message_content: typing.Union[
225
- InputTextMessageContent,
226
- InputLocationMessageContent,
227
- InputVenueMessageContent,
228
- InputContactMessageContent,
229
- InputInvoiceMessageContent,
230
- ]
231
- | Option[
232
- typing.Union[
233
- InputTextMessageContent,
234
- InputLocationMessageContent,
235
- InputVenueMessageContent,
236
- InputContactMessageContent,
237
- InputInvoiceMessageContent,
238
- ]
239
- ] = Nothing,
220
+ title: str | None = None,
221
+ caption: str | None = None,
222
+ parse_mode: str | None = None,
223
+ caption_entities: list[MessageEntity] | None = None,
224
+ performer: str | None = None,
225
+ audio_duration: int | None = None,
226
+ reply_markup: InlineKeyboardMarkup | None = None,
227
+ input_message_content: InputMessageContent | None = None,
240
228
  ) -> InlineQueryResultAudio:
241
229
  return InlineQueryResultAudio(type="audio", **get_params(locals()))
242
230
 
@@ -246,28 +234,13 @@ def inline_query_contact(
246
234
  phone_number: str,
247
235
  first_name: str,
248
236
  *,
249
- last_name: str | Option[str] = Nothing,
250
- vcard: str | Option[str] = Nothing,
251
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
252
- input_message_content: typing.Union[
253
- InputTextMessageContent,
254
- InputLocationMessageContent,
255
- InputVenueMessageContent,
256
- InputContactMessageContent,
257
- InputInvoiceMessageContent,
258
- ]
259
- | Option[
260
- typing.Union[
261
- InputTextMessageContent,
262
- InputLocationMessageContent,
263
- InputVenueMessageContent,
264
- InputContactMessageContent,
265
- InputInvoiceMessageContent,
266
- ]
267
- ] = Nothing,
268
- thumbnail_url: str | Option[str] = Nothing,
269
- thumbnail_width: int | Option[int] = Nothing,
270
- thumbnail_height: int | Option[int] = Nothing,
237
+ last_name: str | None = None,
238
+ vcard: str | None = None,
239
+ reply_markup: InlineKeyboardMarkup | None = None,
240
+ input_message_content: InputMessageContent | None = None,
241
+ thumbnail_url: str | None = None,
242
+ thumbnail_width: int | None = None,
243
+ thumbnail_height: int | None = None,
271
244
  ) -> InlineQueryResultContact:
272
245
  return InlineQueryResultContact(type="contact", **get_params(locals()))
273
246
 
@@ -278,30 +251,15 @@ def inline_query_document(
278
251
  document_url: str,
279
252
  mime_type: str,
280
253
  *,
281
- description: Option[str] = Nothing,
282
- caption: Option[str] = Nothing,
283
- parse_mode: Option[str] = Nothing,
284
- caption_entities: Option[list[MessageEntity]] = Nothing,
285
- reply_markup: Option[InlineKeyboardMarkup] = Nothing,
286
- input_message_content: typing.Union[
287
- InputTextMessageContent,
288
- InputLocationMessageContent,
289
- InputVenueMessageContent,
290
- InputContactMessageContent,
291
- InputInvoiceMessageContent,
292
- ]
293
- | Option[
294
- typing.Union[
295
- InputTextMessageContent,
296
- InputLocationMessageContent,
297
- InputVenueMessageContent,
298
- InputContactMessageContent,
299
- InputInvoiceMessageContent,
300
- ]
301
- ] = Nothing,
302
- thumbnail_url: Option[str] = Nothing,
303
- thumbnail_width: Option[int] = Nothing,
304
- thumbnail_height: Option[int] = Nothing,
254
+ description: str | None = None,
255
+ caption: str | None = None,
256
+ parse_mode: str | None = None,
257
+ caption_entities: list[MessageEntity] | None = None,
258
+ reply_markup: InlineKeyboardMarkup | None = None,
259
+ input_message_content: InputMessageContent | None = None,
260
+ thumbnail_url: str | None = None,
261
+ thumbnail_width: int | None = None,
262
+ thumbnail_height: int | None = None,
305
263
  ) -> InlineQueryResultDocument:
306
264
  return InlineQueryResultDocument(type="document", **get_params(locals()))
307
265
 
@@ -310,32 +268,17 @@ def inline_query_gif(
310
268
  id: str,
311
269
  gif_url: str,
312
270
  *,
313
- gif_width: int | Option[int] = Nothing,
314
- gif_height: int | Option[int] = Nothing,
315
- gif_duration: int | Option[int] = Nothing,
316
- title: str | Option[str] = Nothing,
317
- caption: str | Option[str] = Nothing,
318
- parse_mode: str | Option[str] = Nothing,
319
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
320
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
321
- input_message_content: typing.Union[
322
- InputTextMessageContent,
323
- InputLocationMessageContent,
324
- InputVenueMessageContent,
325
- InputContactMessageContent,
326
- InputInvoiceMessageContent,
327
- ]
328
- | Option[
329
- typing.Union[
330
- InputTextMessageContent,
331
- InputLocationMessageContent,
332
- InputVenueMessageContent,
333
- InputContactMessageContent,
334
- InputInvoiceMessageContent,
335
- ]
336
- ] = Nothing,
337
- thumbnail_url: str | Option[str] = Nothing,
338
- thumbnail_mime_type: str | Option[str] = Nothing,
271
+ gif_width: int | None = None,
272
+ gif_height: int | None = None,
273
+ gif_duration: int | None = None,
274
+ title: str | None = None,
275
+ caption: str | None = None,
276
+ parse_mode: str | None = None,
277
+ caption_entities: list[MessageEntity] | None = None,
278
+ reply_markup: InlineKeyboardMarkup | None = None,
279
+ input_message_content: InputMessageContent | None = None,
280
+ thumbnail_url: str | None = None,
281
+ thumbnail_mime_type: str | None = None,
339
282
  ) -> InlineQueryResultGif:
340
283
  return InlineQueryResultGif(type="gif", **get_params(locals()))
341
284
 
@@ -345,31 +288,16 @@ def inline_query_location(
345
288
  latitude: float,
346
289
  longitude: float,
347
290
  *,
348
- title: str | Option[str] = Nothing,
349
- horizontal_accuracy: float | Option[float] = Nothing,
350
- live_period: int | Option[int] = Nothing,
351
- heading: int | Option[int] = Nothing,
352
- proximity_alert_radius: int | Option[int] = Nothing,
353
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
354
- input_message_content: typing.Union[
355
- InputTextMessageContent,
356
- InputLocationMessageContent,
357
- InputVenueMessageContent,
358
- InputContactMessageContent,
359
- InputInvoiceMessageContent,
360
- ]
361
- | Option[
362
- typing.Union[
363
- InputTextMessageContent,
364
- InputLocationMessageContent,
365
- InputVenueMessageContent,
366
- InputContactMessageContent,
367
- InputInvoiceMessageContent,
368
- ]
369
- ] = Nothing,
370
- thumbnail_url: str | Option[str] = Nothing,
371
- thumbnail_width: int | Option[int] = Nothing,
372
- thumbnail_height: int | Option[int] = Nothing,
291
+ title: str | None = None,
292
+ horizontal_accuracy: float | None = None,
293
+ live_period: int | None = None,
294
+ heading: int | None = None,
295
+ proximity_alert_radius: int | None = None,
296
+ reply_markup: InlineKeyboardMarkup | None = None,
297
+ input_message_content: InputMessageContent | None = None,
298
+ thumbnail_url: str | None = None,
299
+ thumbnail_width: int | None = None,
300
+ thumbnail_height: int | None = None,
373
301
  ) -> InlineQueryResultLocation:
374
302
  return InlineQueryResultLocation(type="location", **get_params(locals()))
375
303
 
@@ -381,30 +309,15 @@ def inline_query_venue(
381
309
  title: str,
382
310
  address: str,
383
311
  *,
384
- foursquare_id: str | Option[str] = Nothing,
385
- foursquare_type: str | Option[str] = Nothing,
386
- google_place_id: str | Option[str] = Nothing,
387
- google_place_type: str | Option[str] = Nothing,
388
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
389
- input_message_content: typing.Union[
390
- InputTextMessageContent,
391
- InputLocationMessageContent,
392
- InputVenueMessageContent,
393
- InputContactMessageContent,
394
- InputInvoiceMessageContent,
395
- ]
396
- | Option[
397
- typing.Union[
398
- InputTextMessageContent,
399
- InputLocationMessageContent,
400
- InputVenueMessageContent,
401
- InputContactMessageContent,
402
- InputInvoiceMessageContent,
403
- ]
404
- ] = Nothing,
405
- thumbnail_url: str | Option[str] = Nothing,
406
- thumbnail_width: int | Option[int] = Nothing,
407
- thumbnail_height: int | Option[int] = Nothing,
312
+ foursquare_id: str | None = None,
313
+ foursquare_type: str | None = None,
314
+ google_place_id: str | None = None,
315
+ google_place_type: str | None = None,
316
+ reply_markup: InlineKeyboardMarkup | None = None,
317
+ input_message_content: InputMessageContent | None = None,
318
+ thumbnail_url: str | None = None,
319
+ thumbnail_width: int | None = None,
320
+ thumbnail_height: int | None = None,
408
321
  ) -> InlineQueryResultVenue:
409
322
  return InlineQueryResultVenue(type="venue", **get_params(locals()))
410
323
 
@@ -415,34 +328,19 @@ def inline_query_video(
415
328
  mime_type: str,
416
329
  thumb_url: str,
417
330
  *,
418
- title: str | Option[str] = Nothing,
419
- caption: str | Option[str] = Nothing,
420
- parse_mode: str | Option[str] = Nothing,
421
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
422
- video_width: int | Option[int] = Nothing,
423
- video_height: int | Option[int] = Nothing,
424
- video_duration: int | Option[int] = Nothing,
425
- description: str | Option[str] = Nothing,
426
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
427
- input_message_content: typing.Union[
428
- InputTextMessageContent,
429
- InputLocationMessageContent,
430
- InputVenueMessageContent,
431
- InputContactMessageContent,
432
- InputInvoiceMessageContent,
433
- ]
434
- | Option[
435
- typing.Union[
436
- InputTextMessageContent,
437
- InputLocationMessageContent,
438
- InputVenueMessageContent,
439
- InputContactMessageContent,
440
- InputInvoiceMessageContent,
441
- ]
442
- ] = Nothing,
443
- thumbnail_url: str | Option[str] = Nothing,
444
- thumbnail_width: int | Option[int] = Nothing,
445
- thumbnail_height: int | Option[int] = Nothing,
331
+ title: str | None = None,
332
+ caption: str | None = None,
333
+ parse_mode: str | None = None,
334
+ caption_entities: list[MessageEntity] | None = None,
335
+ video_width: int | None = None,
336
+ video_height: int | None = None,
337
+ video_duration: int | None = None,
338
+ description: str | None = None,
339
+ reply_markup: InlineKeyboardMarkup | None = None,
340
+ input_message_content: InputMessageContent | None = None,
341
+ thumbnail_url: str | None = None,
342
+ thumbnail_width: int | None = None,
343
+ thumbnail_height: int | None = None,
446
344
  ) -> InlineQueryResultVideo:
447
345
  return InlineQueryResultVideo(type="video", **get_params(locals()))
448
346
 
@@ -451,7 +349,7 @@ def inline_query_game(
451
349
  id: str,
452
350
  game_short_name: str,
453
351
  *,
454
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
352
+ reply_markup: InlineKeyboardMarkup | None = None,
455
353
  ) -> InlineQueryResultGame:
456
354
  return InlineQueryResultGame(type="game", **get_params(locals()))
457
355
 
@@ -461,27 +359,12 @@ def inline_query_voice(
461
359
  voice_url: str,
462
360
  title: str,
463
361
  *,
464
- caption: str | Option[str] = Nothing,
465
- parse_mode: str | Option[str] = Nothing,
466
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
467
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
468
- input_message_content: typing.Union[
469
- InputTextMessageContent,
470
- InputLocationMessageContent,
471
- InputVenueMessageContent,
472
- InputContactMessageContent,
473
- InputInvoiceMessageContent,
474
- ]
475
- | Option[
476
- typing.Union[
477
- InputTextMessageContent,
478
- InputLocationMessageContent,
479
- InputVenueMessageContent,
480
- InputContactMessageContent,
481
- InputInvoiceMessageContent,
482
- ]
483
- ] = Nothing,
484
- duration: int | Option[int] = Nothing,
362
+ caption: str | None = None,
363
+ parse_mode: str | None = None,
364
+ caption_entities: list[MessageEntity] | None = None,
365
+ reply_markup: InlineKeyboardMarkup | None = None,
366
+ input_message_content: InputMessageContent | None = None,
367
+ duration: int | None = None,
485
368
  ) -> InlineQueryResultVoice:
486
369
  return InlineQueryResultVoice(type="voice", **get_params(locals()))
487
370
 
@@ -491,30 +374,15 @@ def inline_query_photo(
491
374
  photo_url: str,
492
375
  thumb_url: str,
493
376
  *,
494
- photo_width: int | Option[int] = Nothing,
495
- photo_height: int | Option[int] = Nothing,
496
- title: str | Option[str] = Nothing,
497
- description: str | Option[str] = Nothing,
498
- caption: str | Option[str] = Nothing,
499
- parse_mode: str | Option[str] = Nothing,
500
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
501
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
502
- input_message_content: typing.Union[
503
- InputTextMessageContent,
504
- InputLocationMessageContent,
505
- InputVenueMessageContent,
506
- InputContactMessageContent,
507
- InputInvoiceMessageContent,
508
- ]
509
- | Option[
510
- typing.Union[
511
- InputTextMessageContent,
512
- InputLocationMessageContent,
513
- InputVenueMessageContent,
514
- InputContactMessageContent,
515
- InputInvoiceMessageContent,
516
- ]
517
- ] = Nothing,
377
+ photo_width: int | None = None,
378
+ photo_height: int | None = None,
379
+ title: str | None = None,
380
+ description: str | None = None,
381
+ caption: str | None = None,
382
+ parse_mode: str | None = None,
383
+ caption_entities: list[MessageEntity] | None = None,
384
+ reply_markup: InlineKeyboardMarkup | None = None,
385
+ input_message_content: InputMessageContent | None = None,
518
386
  ) -> InlineQueryResultPhoto:
519
387
  return InlineQueryResultPhoto(type="photo", **get_params(locals()))
520
388
 
@@ -523,27 +391,12 @@ def inline_query_mpeg4_gif(
523
391
  id: str,
524
392
  mpeg4_url: str,
525
393
  *,
526
- mpeg4_width: int | Option[int] = Nothing,
527
- mpeg4_height: int | Option[int] = Nothing,
528
- mpeg4_duration: int | Option[int] = Nothing,
529
- thumb_url: str | Option[str] = Nothing,
530
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
531
- input_message_content: typing.Union[
532
- InputTextMessageContent,
533
- InputLocationMessageContent,
534
- InputVenueMessageContent,
535
- InputContactMessageContent,
536
- InputInvoiceMessageContent,
537
- ]
538
- | Option[
539
- typing.Union[
540
- InputTextMessageContent,
541
- InputLocationMessageContent,
542
- InputVenueMessageContent,
543
- InputContactMessageContent,
544
- InputInvoiceMessageContent,
545
- ]
546
- ] = Nothing,
394
+ mpeg4_width: int | None = None,
395
+ mpeg4_height: int | None = None,
396
+ mpeg4_duration: int | None = None,
397
+ thumb_url: str | None = None,
398
+ reply_markup: InlineKeyboardMarkup | None = None,
399
+ input_message_content: InputMessageContent | None = None,
547
400
  ) -> InlineQueryResultMpeg4Gif:
548
401
  return InlineQueryResultMpeg4Gif(type="mpeg4_gif", **get_params(locals()))
549
402
 
@@ -552,7 +405,7 @@ def inline_query_cached_sticker(
552
405
  id: str,
553
406
  sticker_file_id: str,
554
407
  *,
555
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
408
+ reply_markup: InlineKeyboardMarkup | None = None,
556
409
  ) -> InlineQueryResultCachedSticker:
557
410
  return InlineQueryResultCachedSticker(type="sticker", **get_params(locals()))
558
411
 
@@ -561,28 +414,13 @@ def inline_query_cached_document(
561
414
  id: str,
562
415
  document_file_id: str,
563
416
  *,
564
- title: str | Option[str] = Nothing,
565
- description: str | Option[str] = Nothing,
566
- caption: str | Option[str] = Nothing,
567
- parse_mode: str | Option[str] = Nothing,
568
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
569
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
570
- input_message_content: typing.Union[
571
- InputTextMessageContent,
572
- InputLocationMessageContent,
573
- InputVenueMessageContent,
574
- InputContactMessageContent,
575
- InputInvoiceMessageContent,
576
- ]
577
- | Option[
578
- typing.Union[
579
- InputTextMessageContent,
580
- InputLocationMessageContent,
581
- InputVenueMessageContent,
582
- InputContactMessageContent,
583
- InputInvoiceMessageContent,
584
- ]
585
- ] = Nothing,
417
+ title: str | None = None,
418
+ description: str | None = None,
419
+ caption: str | None = None,
420
+ parse_mode: str | None = None,
421
+ caption_entities: list[MessageEntity] | None = None,
422
+ reply_markup: InlineKeyboardMarkup | None = None,
423
+ input_message_content: InputMessageContent | None = None,
586
424
  ) -> InlineQueryResultCachedDocument:
587
425
  return InlineQueryResultCachedDocument(type="document", **get_params(locals()))
588
426
 
@@ -591,26 +429,11 @@ def inline_query_cached_audio(
591
429
  id: str,
592
430
  audio_file_id: str,
593
431
  *,
594
- caption: str | Option[str] = Nothing,
595
- parse_mode: str | Option[str] = Nothing,
596
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
597
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
598
- input_message_content: typing.Union[
599
- InputTextMessageContent,
600
- InputLocationMessageContent,
601
- InputVenueMessageContent,
602
- InputContactMessageContent,
603
- InputInvoiceMessageContent,
604
- ]
605
- | Option[
606
- typing.Union[
607
- InputTextMessageContent,
608
- InputLocationMessageContent,
609
- InputVenueMessageContent,
610
- InputContactMessageContent,
611
- InputInvoiceMessageContent,
612
- ]
613
- ] = Nothing,
432
+ caption: str | None = None,
433
+ parse_mode: str | None = None,
434
+ caption_entities: list[MessageEntity] | None = None,
435
+ reply_markup: InlineKeyboardMarkup | None = None,
436
+ input_message_content: InputMessageContent | None = None,
614
437
  ) -> InlineQueryResultCachedAudio:
615
438
  return InlineQueryResultCachedAudio(type="audio", **get_params(locals()))
616
439
 
@@ -619,28 +442,13 @@ def inline_query_cached_video(
619
442
  id: str,
620
443
  video_file_id: str,
621
444
  *,
622
- title: str | Option[str] = Nothing,
623
- description: str | Option[str] = Nothing,
624
- caption: str | Option[str] = Nothing,
625
- parse_mode: str | Option[str] = Nothing,
626
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
627
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
628
- input_message_content: typing.Union[
629
- InputTextMessageContent,
630
- InputLocationMessageContent,
631
- InputVenueMessageContent,
632
- InputContactMessageContent,
633
- InputInvoiceMessageContent,
634
- ]
635
- | Option[
636
- typing.Union[
637
- InputTextMessageContent,
638
- InputLocationMessageContent,
639
- InputVenueMessageContent,
640
- InputContactMessageContent,
641
- InputInvoiceMessageContent,
642
- ]
643
- ] = Nothing,
445
+ title: str | None = None,
446
+ description: str | None = None,
447
+ caption: str | None = None,
448
+ parse_mode: str | None = None,
449
+ caption_entities: list[MessageEntity] | None = None,
450
+ reply_markup: InlineKeyboardMarkup | None = None,
451
+ input_message_content: InputMessageContent | None = None,
644
452
  ) -> InlineQueryResultCachedVideo:
645
453
  return InlineQueryResultCachedVideo(type="video", **get_params(locals()))
646
454
 
@@ -649,27 +457,12 @@ def inline_query_cached_gif(
649
457
  id: str,
650
458
  gif_file_id: str,
651
459
  *,
652
- title: str | Option[str] = Nothing,
653
- caption: str | Option[str] = Nothing,
654
- parse_mode: str | Option[str] = Nothing,
655
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
656
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
657
- input_message_content: typing.Union[
658
- InputTextMessageContent,
659
- InputLocationMessageContent,
660
- InputVenueMessageContent,
661
- InputContactMessageContent,
662
- InputInvoiceMessageContent,
663
- ]
664
- | Option[
665
- typing.Union[
666
- InputTextMessageContent,
667
- InputLocationMessageContent,
668
- InputVenueMessageContent,
669
- InputContactMessageContent,
670
- InputInvoiceMessageContent,
671
- ]
672
- ] = Nothing,
460
+ title: str | None = None,
461
+ caption: str | None = None,
462
+ parse_mode: str | None = None,
463
+ caption_entities: list[MessageEntity] | None = None,
464
+ reply_markup: InlineKeyboardMarkup | None = None,
465
+ input_message_content: InputMessageContent | None = None,
673
466
  ) -> InlineQueryResultCachedGif:
674
467
  return InlineQueryResultCachedGif(type="gif", **get_params(locals()))
675
468
 
@@ -678,27 +471,12 @@ def inline_query_cached_mpeg4_gif(
678
471
  id: str,
679
472
  mpeg4_file_id: str,
680
473
  *,
681
- title: str | Option[str] = Nothing,
682
- caption: str | Option[str] = Nothing,
683
- parse_mode: str | Option[str] = Nothing,
684
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
685
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
686
- input_message_content: typing.Union[
687
- InputTextMessageContent,
688
- InputLocationMessageContent,
689
- InputVenueMessageContent,
690
- InputContactMessageContent,
691
- InputInvoiceMessageContent,
692
- ]
693
- | Option[
694
- typing.Union[
695
- InputTextMessageContent,
696
- InputLocationMessageContent,
697
- InputVenueMessageContent,
698
- InputContactMessageContent,
699
- InputInvoiceMessageContent,
700
- ]
701
- ] = Nothing,
474
+ title: str | None = None,
475
+ caption: str | None = None,
476
+ parse_mode: str | None = None,
477
+ caption_entities: list[MessageEntity] | None = None,
478
+ reply_markup: InlineKeyboardMarkup | None = None,
479
+ input_message_content: InputMessageContent | None = None,
702
480
  ) -> InlineQueryResultCachedMpeg4Gif:
703
481
  return InlineQueryResultCachedMpeg4Gif(type="mpeg4_gif", **get_params(locals()))
704
482
 
@@ -707,26 +485,11 @@ def inline_query_cached_voice(
707
485
  id: str,
708
486
  voice_file_id: str,
709
487
  *,
710
- caption: str | Option[str] = Nothing,
711
- parse_mode: str | Option[str] = Nothing,
712
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
713
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
714
- input_message_content: typing.Union[
715
- InputTextMessageContent,
716
- InputLocationMessageContent,
717
- InputVenueMessageContent,
718
- InputContactMessageContent,
719
- InputInvoiceMessageContent,
720
- ]
721
- | Option[
722
- typing.Union[
723
- InputTextMessageContent,
724
- InputLocationMessageContent,
725
- InputVenueMessageContent,
726
- InputContactMessageContent,
727
- InputInvoiceMessageContent,
728
- ]
729
- ] = Nothing,
488
+ caption: str | None = None,
489
+ parse_mode: str | None = None,
490
+ caption_entities: list[MessageEntity] | None = None,
491
+ reply_markup: InlineKeyboardMarkup | None = None,
492
+ input_message_content: InputMessageContent | None = None,
730
493
  ) -> InlineQueryResultCachedVoice:
731
494
  return InlineQueryResultCachedVoice(type="voice", **get_params(locals()))
732
495
 
@@ -735,28 +498,13 @@ def inline_query_cached_photo(
735
498
  id: str,
736
499
  photo_file_id: str,
737
500
  *,
738
- title: str | Option[str] = Nothing,
739
- description: str | Option[str] = Nothing,
740
- caption: str | Option[str] = Nothing,
741
- parse_mode: str | Option[str] = Nothing,
742
- caption_entities: list[MessageEntity] | Option[list[MessageEntity]] = Nothing,
743
- reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
744
- input_message_content: typing.Union[
745
- InputTextMessageContent,
746
- InputLocationMessageContent,
747
- InputVenueMessageContent,
748
- InputContactMessageContent,
749
- InputInvoiceMessageContent,
750
- ]
751
- | Option[
752
- typing.Union[
753
- InputTextMessageContent,
754
- InputLocationMessageContent,
755
- InputVenueMessageContent,
756
- InputContactMessageContent,
757
- InputInvoiceMessageContent,
758
- ]
759
- ] = Nothing,
501
+ title: str | None = None,
502
+ description: str | None = None,
503
+ caption: str | None = None,
504
+ parse_mode: str | None = None,
505
+ caption_entities: list[MessageEntity] | None = None,
506
+ reply_markup: InlineKeyboardMarkup | None = None,
507
+ input_message_content: InputMessageContent | None = None,
760
508
  ) -> InlineQueryResultCachedPhoto:
761
509
  return InlineQueryResultCachedPhoto(type="photo", **get_params(locals()))
762
510