telegrinder 0.1.dev19__py3-none-any.whl → 0.1.dev158__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 (136) hide show
  1. telegrinder/__init__.py +129 -22
  2. telegrinder/api/__init__.py +11 -2
  3. telegrinder/api/abc.py +25 -9
  4. telegrinder/api/api.py +29 -24
  5. telegrinder/api/error.py +14 -4
  6. telegrinder/api/response.py +11 -7
  7. telegrinder/bot/__init__.py +68 -7
  8. telegrinder/bot/bot.py +30 -24
  9. telegrinder/bot/cute_types/__init__.py +11 -1
  10. telegrinder/bot/cute_types/base.py +47 -0
  11. telegrinder/bot/cute_types/callback_query.py +64 -14
  12. telegrinder/bot/cute_types/inline_query.py +22 -16
  13. telegrinder/bot/cute_types/message.py +163 -43
  14. telegrinder/bot/cute_types/update.py +23 -0
  15. telegrinder/bot/dispatch/__init__.py +56 -3
  16. telegrinder/bot/dispatch/abc.py +9 -7
  17. telegrinder/bot/dispatch/composition.py +74 -0
  18. telegrinder/bot/dispatch/context.py +71 -0
  19. telegrinder/bot/dispatch/dispatch.py +86 -49
  20. telegrinder/bot/dispatch/handler/__init__.py +3 -0
  21. telegrinder/bot/dispatch/handler/abc.py +11 -5
  22. telegrinder/bot/dispatch/handler/func.py +41 -32
  23. telegrinder/bot/dispatch/handler/message_reply.py +46 -0
  24. telegrinder/bot/dispatch/middleware/__init__.py +2 -0
  25. telegrinder/bot/dispatch/middleware/abc.py +10 -4
  26. telegrinder/bot/dispatch/process.py +53 -49
  27. telegrinder/bot/dispatch/return_manager/__init__.py +19 -0
  28. telegrinder/bot/dispatch/return_manager/abc.py +95 -0
  29. telegrinder/bot/dispatch/return_manager/callback_query.py +19 -0
  30. telegrinder/bot/dispatch/return_manager/inline_query.py +14 -0
  31. telegrinder/bot/dispatch/return_manager/message.py +25 -0
  32. telegrinder/bot/dispatch/view/__init__.py +14 -2
  33. telegrinder/bot/dispatch/view/abc.py +121 -2
  34. telegrinder/bot/dispatch/view/box.py +38 -0
  35. telegrinder/bot/dispatch/view/callback_query.py +13 -38
  36. telegrinder/bot/dispatch/view/inline_query.py +11 -38
  37. telegrinder/bot/dispatch/view/message.py +11 -46
  38. telegrinder/bot/dispatch/waiter_machine/__init__.py +9 -0
  39. telegrinder/bot/dispatch/waiter_machine/machine.py +116 -0
  40. telegrinder/bot/dispatch/waiter_machine/middleware.py +76 -0
  41. telegrinder/bot/dispatch/waiter_machine/short_state.py +37 -0
  42. telegrinder/bot/polling/__init__.py +2 -0
  43. telegrinder/bot/polling/abc.py +11 -4
  44. telegrinder/bot/polling/polling.py +89 -40
  45. telegrinder/bot/rules/__init__.py +92 -5
  46. telegrinder/bot/rules/abc.py +81 -63
  47. telegrinder/bot/rules/adapter/__init__.py +11 -0
  48. telegrinder/bot/rules/adapter/abc.py +21 -0
  49. telegrinder/bot/rules/adapter/errors.py +5 -0
  50. telegrinder/bot/rules/adapter/event.py +43 -0
  51. telegrinder/bot/rules/adapter/raw_update.py +24 -0
  52. telegrinder/bot/rules/callback_data.py +159 -38
  53. telegrinder/bot/rules/command.py +116 -0
  54. telegrinder/bot/rules/enum_text.py +28 -0
  55. telegrinder/bot/rules/func.py +17 -17
  56. telegrinder/bot/rules/fuzzy.py +13 -10
  57. telegrinder/bot/rules/inline.py +61 -0
  58. telegrinder/bot/rules/integer.py +12 -7
  59. telegrinder/bot/rules/is_from.py +148 -7
  60. telegrinder/bot/rules/markup.py +21 -18
  61. telegrinder/bot/rules/mention.py +17 -0
  62. telegrinder/bot/rules/message_entities.py +33 -0
  63. telegrinder/bot/rules/regex.py +27 -19
  64. telegrinder/bot/rules/rule_enum.py +74 -0
  65. telegrinder/bot/rules/start.py +42 -0
  66. telegrinder/bot/rules/text.py +23 -14
  67. telegrinder/bot/scenario/__init__.py +2 -0
  68. telegrinder/bot/scenario/abc.py +12 -5
  69. telegrinder/bot/scenario/checkbox.py +48 -30
  70. telegrinder/bot/scenario/choice.py +16 -10
  71. telegrinder/client/__init__.py +2 -0
  72. telegrinder/client/abc.py +8 -21
  73. telegrinder/client/aiohttp.py +30 -21
  74. telegrinder/model.py +68 -37
  75. telegrinder/modules.py +189 -21
  76. telegrinder/msgspec_json.py +14 -0
  77. telegrinder/msgspec_utils.py +207 -0
  78. telegrinder/node/__init__.py +31 -0
  79. telegrinder/node/attachment.py +71 -0
  80. telegrinder/node/base.py +93 -0
  81. telegrinder/node/composer.py +71 -0
  82. telegrinder/node/container.py +22 -0
  83. telegrinder/node/message.py +18 -0
  84. telegrinder/node/rule.py +56 -0
  85. telegrinder/node/source.py +31 -0
  86. telegrinder/node/text.py +13 -0
  87. telegrinder/node/tools/__init__.py +3 -0
  88. telegrinder/node/tools/generator.py +40 -0
  89. telegrinder/node/update.py +12 -0
  90. telegrinder/rules.py +1 -1
  91. telegrinder/tools/__init__.py +165 -4
  92. telegrinder/tools/buttons.py +75 -51
  93. telegrinder/tools/error_handler/__init__.py +8 -0
  94. telegrinder/tools/error_handler/abc.py +30 -0
  95. telegrinder/tools/error_handler/error_handler.py +156 -0
  96. telegrinder/tools/formatting/__init__.py +81 -3
  97. telegrinder/tools/formatting/html.py +283 -37
  98. telegrinder/tools/formatting/links.py +32 -0
  99. telegrinder/tools/formatting/spec_html_formats.py +121 -0
  100. telegrinder/tools/global_context/__init__.py +12 -0
  101. telegrinder/tools/global_context/abc.py +66 -0
  102. telegrinder/tools/global_context/global_context.py +451 -0
  103. telegrinder/tools/global_context/telegrinder_ctx.py +25 -0
  104. telegrinder/tools/i18n/__init__.py +12 -0
  105. telegrinder/tools/i18n/base.py +31 -0
  106. telegrinder/tools/i18n/middleware/__init__.py +3 -0
  107. telegrinder/tools/i18n/middleware/base.py +26 -0
  108. telegrinder/tools/i18n/simple.py +48 -0
  109. telegrinder/tools/inline_query.py +684 -0
  110. telegrinder/tools/kb_set/__init__.py +2 -0
  111. telegrinder/tools/kb_set/base.py +3 -0
  112. telegrinder/tools/kb_set/yaml.py +28 -17
  113. telegrinder/tools/keyboard.py +84 -62
  114. telegrinder/tools/loop_wrapper/__init__.py +4 -0
  115. telegrinder/tools/loop_wrapper/abc.py +18 -0
  116. telegrinder/tools/loop_wrapper/loop_wrapper.py +132 -0
  117. telegrinder/tools/magic.py +48 -23
  118. telegrinder/tools/parse_mode.py +1 -2
  119. telegrinder/types/__init__.py +1 -0
  120. telegrinder/types/enums.py +651 -0
  121. telegrinder/types/methods.py +3933 -1128
  122. telegrinder/types/objects.py +4755 -1633
  123. {telegrinder-0.1.dev19.dist-info → telegrinder-0.1.dev158.dist-info}/LICENSE +2 -1
  124. telegrinder-0.1.dev158.dist-info/METADATA +108 -0
  125. telegrinder-0.1.dev158.dist-info/RECORD +126 -0
  126. {telegrinder-0.1.dev19.dist-info → telegrinder-0.1.dev158.dist-info}/WHEEL +1 -1
  127. telegrinder/bot/dispatch/waiter.py +0 -37
  128. telegrinder/result.py +0 -38
  129. telegrinder/tools/formatting/abc.py +0 -52
  130. telegrinder/tools/formatting/markdown.py +0 -57
  131. telegrinder/typegen/__init__.py +0 -1
  132. telegrinder/typegen/__main__.py +0 -3
  133. telegrinder/typegen/nicification.py +0 -20
  134. telegrinder/typegen/schema_generator.py +0 -259
  135. telegrinder-0.1.dev19.dist-info/METADATA +0 -22
  136. telegrinder-0.1.dev19.dist-info/RECORD +0 -74
@@ -0,0 +1,684 @@
1
+ import typing
2
+
3
+ from telegrinder.model import get_params
4
+ from telegrinder.msgspec_utils import Nothing, Option
5
+ from telegrinder.types.objects import (
6
+ InlineKeyboardMarkup,
7
+ InlineQueryResultArticle,
8
+ InlineQueryResultAudio,
9
+ InlineQueryResultCachedAudio,
10
+ InlineQueryResultCachedDocument,
11
+ InlineQueryResultCachedGif,
12
+ InlineQueryResultCachedMpeg4Gif,
13
+ InlineQueryResultCachedPhoto,
14
+ InlineQueryResultCachedSticker,
15
+ InlineQueryResultCachedVideo,
16
+ InlineQueryResultCachedVoice,
17
+ InlineQueryResultContact,
18
+ InlineQueryResultDocument,
19
+ InlineQueryResultGame,
20
+ InlineQueryResultGif,
21
+ InlineQueryResultLocation,
22
+ InlineQueryResultMpeg4Gif,
23
+ InlineQueryResultPhoto,
24
+ InlineQueryResultType,
25
+ InlineQueryResultVenue,
26
+ InlineQueryResultVideo,
27
+ InlineQueryResultVoice,
28
+ InputContactMessageContent,
29
+ InputInvoiceMessageContent,
30
+ InputLocationMessageContent,
31
+ InputTextMessageContent,
32
+ InputVenueMessageContent,
33
+ LabeledPrice,
34
+ MessageEntity,
35
+ )
36
+
37
+
38
+ def input_contact_message_content(
39
+ phone_number: str,
40
+ first_name: str,
41
+ *,
42
+ last_name: str | Option[str] = Nothing,
43
+ vcard: str | Option[str] = Nothing,
44
+ ) -> InputContactMessageContent:
45
+ return InputContactMessageContent(**get_params(locals()))
46
+
47
+
48
+ def input_invoice_message_content(
49
+ title: str,
50
+ description: str,
51
+ payload: str,
52
+ provider_token: str,
53
+ currency: str,
54
+ *,
55
+ prices: list["LabeledPrice"],
56
+ max_tip_amount: int | Option[int] = Nothing,
57
+ suggested_tip_amounts: list[int] | Option[list[int]] = Nothing,
58
+ provider_data: str | Option[str] = Nothing,
59
+ photo_url: str | Option[str] = Nothing,
60
+ photo_size: int | Option[int] = Nothing,
61
+ photo_width: int | Option[int] = Nothing,
62
+ photo_height: int | Option[int] = Nothing,
63
+ need_name: bool | Option[bool] = Nothing,
64
+ need_phone_number: bool | Option[bool] = Nothing,
65
+ need_email: bool | Option[bool] = Nothing,
66
+ need_shipping_address: bool | Option[bool] = Nothing,
67
+ send_phone_number_to_provider: bool | Option[bool] = Nothing,
68
+ ) -> InputInvoiceMessageContent:
69
+ return InputInvoiceMessageContent(**get_params(locals()))
70
+
71
+
72
+ def input_location_message_content(
73
+ latitude: float,
74
+ longitude: float,
75
+ *,
76
+ horizontal_accuracy: float | Option[float] = Nothing,
77
+ live_period: int | Option[int] = Nothing,
78
+ heading: int | Option[int] = Nothing,
79
+ proximity_alert_radius: int | Option[int] = Nothing,
80
+ ) -> InputLocationMessageContent:
81
+ return InputLocationMessageContent(**get_params(locals()))
82
+
83
+
84
+ def input_text_message_content(
85
+ message_text: str,
86
+ *,
87
+ parse_mode: str | Option[str] = Nothing,
88
+ entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
89
+ disable_web_page_preview: bool | Option[bool] = Nothing,
90
+ ) -> InputTextMessageContent:
91
+ return InputTextMessageContent(**get_params(locals()))
92
+
93
+
94
+ def input_venue_message_content(
95
+ latitude: float,
96
+ longitude: float,
97
+ title: str,
98
+ address: str,
99
+ *,
100
+ foursquare_id: str | Option[str] = Nothing,
101
+ foursquare_type: str | Option[str] = Nothing,
102
+ google_place_id: str | Option[str] = Nothing,
103
+ google_place_type: str | Option[str] = Nothing,
104
+ ) -> InputVenueMessageContent:
105
+ return InputVenueMessageContent(**get_params(locals()))
106
+
107
+
108
+ def inline_query_article(
109
+ id: str,
110
+ title: str,
111
+ input_message_content: typing.Union[
112
+ "InputTextMessageContent",
113
+ "InputLocationMessageContent",
114
+ "InputVenueMessageContent",
115
+ "InputContactMessageContent",
116
+ "InputInvoiceMessageContent",
117
+ ],
118
+ *,
119
+ reply_markup: Option["InlineKeyboardMarkup"] = Nothing,
120
+ url: str | Option[str] = Nothing,
121
+ hide_url: bool | Option[bool] = Nothing,
122
+ description: str | Option[str] = Nothing,
123
+ thumbnail_url: str | Option[str] = Nothing,
124
+ thumbnail_width: int | Option[int] = Nothing,
125
+ thumbnail_height: int | Option[int] = Nothing,
126
+ ) -> InlineQueryResultArticle:
127
+ return InlineQueryResultArticle(type=InlineQueryResultType.ARTICLE, **get_params(locals()))
128
+
129
+
130
+ def inline_query_audio(
131
+ id: str,
132
+ audio_url: str,
133
+ *,
134
+ title: str | Option[str] = Nothing,
135
+ caption: str | Option[str] = Nothing,
136
+ parse_mode: str | Option[str] = Nothing,
137
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
138
+ performer: str | Option[str] = Nothing,
139
+ audio_duration: int | Option[int] = Nothing,
140
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
141
+ input_message_content: typing.Union[
142
+ "InputTextMessageContent",
143
+ "InputLocationMessageContent",
144
+ "InputVenueMessageContent",
145
+ "InputContactMessageContent",
146
+ "InputInvoiceMessageContent",
147
+ ] | Option[
148
+ typing.Union[
149
+ "InputTextMessageContent",
150
+ "InputLocationMessageContent",
151
+ "InputVenueMessageContent",
152
+ "InputContactMessageContent",
153
+ "InputInvoiceMessageContent",
154
+ ]
155
+ ] = Nothing,
156
+ ) -> InlineQueryResultAudio:
157
+ return InlineQueryResultAudio(type=InlineQueryResultType.AUDIO, **get_params(locals()))
158
+
159
+
160
+ def inline_query_contact(
161
+ id: str,
162
+ phone_number: str,
163
+ first_name: str,
164
+ *,
165
+ last_name: str | Option[str] = Nothing,
166
+ vcard: str | Option[str] = Nothing,
167
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
168
+ input_message_content: typing.Union[
169
+ "InputTextMessageContent",
170
+ "InputLocationMessageContent",
171
+ "InputVenueMessageContent",
172
+ "InputContactMessageContent",
173
+ "InputInvoiceMessageContent",
174
+ ] | Option[
175
+ typing.Union[
176
+ "InputTextMessageContent",
177
+ "InputLocationMessageContent",
178
+ "InputVenueMessageContent",
179
+ "InputContactMessageContent",
180
+ "InputInvoiceMessageContent",
181
+ ]
182
+ ] = Nothing,
183
+ thumbnail_url: str | Option[str] = Nothing,
184
+ thumbnail_width: int | Option[int] = Nothing,
185
+ thumbnail_height: int | Option[int] = Nothing,
186
+ ) -> InlineQueryResultContact:
187
+ return InlineQueryResultContact(type=InlineQueryResultType.CONTACT, **get_params(locals()))
188
+
189
+
190
+ def inline_query_document(
191
+ id: str,
192
+ title: str,
193
+ document_url: str,
194
+ mime_type: str,
195
+ *,
196
+ description: Option[str] = Nothing,
197
+ caption: Option[str] = Nothing,
198
+ parse_mode: Option[str] = Nothing,
199
+ caption_entities: Option[list["MessageEntity"]] = Nothing,
200
+ reply_markup: Option["InlineKeyboardMarkup"] = Nothing,
201
+ input_message_content: Option[
202
+ typing.Union[
203
+ "InputTextMessageContent",
204
+ "InputLocationMessageContent",
205
+ "InputVenueMessageContent",
206
+ "InputContactMessageContent",
207
+ "InputInvoiceMessageContent",
208
+ ]
209
+ ] = Nothing,
210
+ thumbnail_url: Option[str] = Nothing,
211
+ thumbnail_width: Option[int] = Nothing,
212
+ thumbnail_height: Option[int] = Nothing,
213
+ ) -> InlineQueryResultDocument:
214
+ return InlineQueryResultDocument(type=InlineQueryResultType.DOCUMENT, **get_params(locals()))
215
+
216
+
217
+ def inline_query_gif(
218
+ id: str,
219
+ gif_url: str,
220
+ *,
221
+ gif_width: int | Option[int] = Nothing,
222
+ gif_height: int | Option[int] = Nothing,
223
+ gif_duration: int | Option[int] = Nothing,
224
+ title: str | Option[str] = Nothing,
225
+ caption: str | Option[str] = Nothing,
226
+ parse_mode: str | Option[str] = Nothing,
227
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
228
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
229
+ input_message_content: typing.Union[
230
+ "InputTextMessageContent",
231
+ "InputLocationMessageContent",
232
+ "InputVenueMessageContent",
233
+ "InputContactMessageContent",
234
+ "InputInvoiceMessageContent",
235
+ ] | Option[
236
+ typing.Union[
237
+ "InputTextMessageContent",
238
+ "InputLocationMessageContent",
239
+ "InputVenueMessageContent",
240
+ "InputContactMessageContent",
241
+ "InputInvoiceMessageContent",
242
+ ]
243
+ ] = Nothing,
244
+ thumbnail_url: str | Option[str] = Nothing,
245
+ thumbnail_mime_type: str | Option[str] = Nothing,
246
+ ) -> InlineQueryResultGif:
247
+ return InlineQueryResultGif(type=InlineQueryResultType.GIF, **get_params(locals()))
248
+
249
+
250
+ def inline_query_location(
251
+ id: str,
252
+ latitude: float,
253
+ longitude: float,
254
+ *,
255
+ title: str | Option[str] = Nothing,
256
+ horizontal_accuracy: float | Option[float] = Nothing,
257
+ live_period: int | Option[int] = Nothing,
258
+ heading: int | Option[int] = Nothing,
259
+ proximity_alert_radius: int | Option[int] = Nothing,
260
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
261
+ input_message_content: typing.Union[
262
+ "InputTextMessageContent",
263
+ "InputLocationMessageContent",
264
+ "InputVenueMessageContent",
265
+ "InputContactMessageContent",
266
+ "InputInvoiceMessageContent",
267
+ ] | Option[
268
+ typing.Union[
269
+ "InputTextMessageContent",
270
+ "InputLocationMessageContent",
271
+ "InputVenueMessageContent",
272
+ "InputContactMessageContent",
273
+ "InputInvoiceMessageContent",
274
+ ]
275
+ ] = Nothing,
276
+ thumbnail_url: str | Option[str] = Nothing,
277
+ thumbnail_width: int | Option[int] = Nothing,
278
+ thumbnail_height: int | Option[int] = Nothing,
279
+ ) -> InlineQueryResultLocation:
280
+ return InlineQueryResultLocation(type=InlineQueryResultType.LOCATION, **get_params(locals()))
281
+
282
+
283
+ def inline_query_venue(
284
+ id: str,
285
+ latitude: float,
286
+ longitude: float,
287
+ title: str,
288
+ address: str,
289
+ *,
290
+ foursquare_id: str | Option[str] = Nothing,
291
+ foursquare_type: str | Option[str] = Nothing,
292
+ google_place_id: str | Option[str] = Nothing,
293
+ google_place_type: str | Option[str] = Nothing,
294
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
295
+ input_message_content: typing.Union[
296
+ "InputTextMessageContent",
297
+ "InputLocationMessageContent",
298
+ "InputVenueMessageContent",
299
+ "InputContactMessageContent",
300
+ "InputInvoiceMessageContent",
301
+ ] | Option[
302
+ typing.Union[
303
+ "InputTextMessageContent",
304
+ "InputLocationMessageContent",
305
+ "InputVenueMessageContent",
306
+ "InputContactMessageContent",
307
+ "InputInvoiceMessageContent",
308
+ ]
309
+ ] = Nothing,
310
+ thumbnail_url: str | Option[str] = Nothing,
311
+ thumbnail_width: int | Option[int] = Nothing,
312
+ thumbnail_height: int | Option[int] = Nothing,
313
+ ) -> InlineQueryResultVenue:
314
+ return InlineQueryResultVenue(type=InlineQueryResultType.VENUE, **get_params(locals()))
315
+
316
+
317
+ def inline_query_video(
318
+ id: str,
319
+ video_url: str,
320
+ mime_type: str,
321
+ thumb_url: str,
322
+ *,
323
+ title: str | Option[str] = Nothing,
324
+ caption: str | Option[str] = Nothing,
325
+ parse_mode: str | Option[str] = Nothing,
326
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
327
+ video_width: int | Option[int] = Nothing,
328
+ video_height: int | Option[int] = Nothing,
329
+ video_duration: int | Option[int] = Nothing,
330
+ description: str | Option[str] = Nothing,
331
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
332
+ input_message_content: typing.Union[
333
+ "InputTextMessageContent",
334
+ "InputLocationMessageContent",
335
+ "InputVenueMessageContent",
336
+ "InputContactMessageContent",
337
+ "InputInvoiceMessageContent",
338
+ ] | Option[
339
+ typing.Union[
340
+ "InputTextMessageContent",
341
+ "InputLocationMessageContent",
342
+ "InputVenueMessageContent",
343
+ "InputContactMessageContent",
344
+ "InputInvoiceMessageContent",
345
+ ]
346
+ ] = Nothing,
347
+ thumbnail_url: str | Option[str] = Nothing,
348
+ thumbnail_width: int | Option[int] = Nothing,
349
+ thumbnail_height: int | Option[int] = Nothing,
350
+ ) -> InlineQueryResultVideo:
351
+ return InlineQueryResultVideo(type=InlineQueryResultType.VIDEO, **get_params(locals()))
352
+
353
+
354
+ def inline_query_game(
355
+ id: str,
356
+ game_short_name: str,
357
+ *,
358
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
359
+ ) -> InlineQueryResultGame:
360
+ return InlineQueryResultGame(type=InlineQueryResultType.GAME, **get_params(locals()))
361
+
362
+
363
+ def inline_query_voice(
364
+ id: str,
365
+ voice_url: str,
366
+ title: str,
367
+ *,
368
+ caption: str | Option[str] = Nothing,
369
+ parse_mode: str | Option[str] = Nothing,
370
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
371
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
372
+ input_message_content: typing.Union[
373
+ "InputTextMessageContent",
374
+ "InputLocationMessageContent",
375
+ "InputVenueMessageContent",
376
+ "InputContactMessageContent",
377
+ "InputInvoiceMessageContent",
378
+ ] | Option[
379
+ typing.Union[
380
+ "InputTextMessageContent",
381
+ "InputLocationMessageContent",
382
+ "InputVenueMessageContent",
383
+ "InputContactMessageContent",
384
+ "InputInvoiceMessageContent",
385
+ ]
386
+ ] = Nothing,
387
+ duration: int | Option[int] = Nothing,
388
+ ) -> InlineQueryResultVoice:
389
+ return InlineQueryResultVoice(type=InlineQueryResultType.VOICE, **get_params(locals()))
390
+
391
+
392
+ def inline_query_photo(
393
+ id: str,
394
+ photo_url: str,
395
+ thumb_url: str,
396
+ *,
397
+ photo_width: int | Option[int] = Nothing,
398
+ photo_height: int | Option[int] = Nothing,
399
+ title: str | Option[str] = Nothing,
400
+ description: str | Option[str] = Nothing,
401
+ caption: str | Option[str] = Nothing,
402
+ parse_mode: str | Option[str] = Nothing,
403
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
404
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
405
+ input_message_content: typing.Union[
406
+ "InputTextMessageContent",
407
+ "InputLocationMessageContent",
408
+ "InputVenueMessageContent",
409
+ "InputContactMessageContent",
410
+ "InputInvoiceMessageContent",
411
+ ] | Option[
412
+ typing.Union[
413
+ "InputTextMessageContent",
414
+ "InputLocationMessageContent",
415
+ "InputVenueMessageContent",
416
+ "InputContactMessageContent",
417
+ "InputInvoiceMessageContent",
418
+ ]
419
+ ]
420
+ ) -> InlineQueryResultPhoto:
421
+ return InlineQueryResultPhoto(type=InlineQueryResultType.PHOTO, **get_params(locals()))
422
+
423
+
424
+ def inline_query_mpeg4_gif(
425
+ id: str,
426
+ mpeg4_url: str,
427
+ *,
428
+ mpeg4_width: int | Option[int] = Nothing,
429
+ mpeg4_height: int | Option[int] = Nothing,
430
+ mpeg4_duration: int | Option[int] = Nothing,
431
+ thumb_url: str | Option[str] = Nothing,
432
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
433
+ input_message_content: typing.Union[
434
+ "InputTextMessageContent",
435
+ "InputLocationMessageContent",
436
+ "InputVenueMessageContent",
437
+ "InputContactMessageContent",
438
+ "InputInvoiceMessageContent",
439
+ ] | Option[
440
+ typing.Union[
441
+ "InputTextMessageContent",
442
+ "InputLocationMessageContent",
443
+ "InputVenueMessageContent",
444
+ "InputContactMessageContent",
445
+ "InputInvoiceMessageContent",
446
+ ]
447
+ ] = Nothing,
448
+ ) -> InlineQueryResultMpeg4Gif:
449
+ return InlineQueryResultMpeg4Gif(type=InlineQueryResultType.MPEG4_GIF, **get_params(locals()))
450
+
451
+
452
+ def inline_query_cached_sticker(
453
+ id: str,
454
+ sticker_file_id: str,
455
+ *,
456
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
457
+ ) -> InlineQueryResultCachedSticker:
458
+ return InlineQueryResultCachedSticker(type=InlineQueryResultType.STICKER, **get_params(locals()))
459
+
460
+
461
+ def inline_query_cached_document(
462
+ id: str,
463
+ document_file_id: str,
464
+ *,
465
+ title: str | Option[str] = Nothing,
466
+ description: str | Option[str] = Nothing,
467
+ caption: str | Option[str] = Nothing,
468
+ parse_mode: str | Option[str] = Nothing,
469
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
470
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
471
+ input_message_content: typing.Union[
472
+ "InputTextMessageContent",
473
+ "InputLocationMessageContent",
474
+ "InputVenueMessageContent",
475
+ "InputContactMessageContent",
476
+ "InputInvoiceMessageContent",
477
+ ] | Option[
478
+ typing.Union[
479
+ "InputTextMessageContent",
480
+ "InputLocationMessageContent",
481
+ "InputVenueMessageContent",
482
+ "InputContactMessageContent",
483
+ "InputInvoiceMessageContent",
484
+ ]
485
+ ] = Nothing,
486
+ ) -> InlineQueryResultCachedDocument:
487
+ return InlineQueryResultCachedDocument(type=InlineQueryResultType.DOCUMENT, **get_params(locals()))
488
+
489
+
490
+ def inline_query_cached_audio(
491
+ id: str,
492
+ audio_file_id: str,
493
+ *,
494
+ caption: str | Option[str] = Nothing,
495
+ parse_mode: str | Option[str] = Nothing,
496
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
497
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
498
+ input_message_content: typing.Union[
499
+ "InputTextMessageContent",
500
+ "InputLocationMessageContent",
501
+ "InputVenueMessageContent",
502
+ "InputContactMessageContent",
503
+ "InputInvoiceMessageContent",
504
+ ] | Option[
505
+ typing.Union[
506
+ "InputTextMessageContent",
507
+ "InputLocationMessageContent",
508
+ "InputVenueMessageContent",
509
+ "InputContactMessageContent",
510
+ "InputInvoiceMessageContent",
511
+ ]
512
+ ] = Nothing,
513
+ ) -> InlineQueryResultCachedAudio:
514
+ return InlineQueryResultCachedAudio(type=InlineQueryResultType.AUDIO, **get_params(locals()))
515
+
516
+
517
+ def inline_query_cached_video(
518
+ id: str,
519
+ video_file_id: str,
520
+ *,
521
+ title: str | Option[str] = Nothing,
522
+ description: str | Option[str] = Nothing,
523
+ caption: str | Option[str] = Nothing,
524
+ parse_mode: str | Option[str] = Nothing,
525
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
526
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
527
+ input_message_content: typing.Union[
528
+ "InputTextMessageContent",
529
+ "InputLocationMessageContent",
530
+ "InputVenueMessageContent",
531
+ "InputContactMessageContent",
532
+ "InputInvoiceMessageContent",
533
+ ] | Option[
534
+ typing.Union[
535
+ "InputTextMessageContent",
536
+ "InputLocationMessageContent",
537
+ "InputVenueMessageContent",
538
+ "InputContactMessageContent",
539
+ "InputInvoiceMessageContent",
540
+ ]
541
+ ] = Nothing,
542
+ ) -> InlineQueryResultCachedVideo:
543
+ return InlineQueryResultCachedVideo(type=InlineQueryResultType.VIDEO, **get_params(locals()))
544
+
545
+
546
+ def inline_query_cached_gif(
547
+ id: str,
548
+ gif_file_id: str,
549
+ *,
550
+ title: str | Option[str] = Nothing,
551
+ caption: str | Option[str] = Nothing,
552
+ parse_mode: str | Option[str] = Nothing,
553
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
554
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
555
+ input_message_content: typing.Union[
556
+ "InputTextMessageContent",
557
+ "InputLocationMessageContent",
558
+ "InputVenueMessageContent",
559
+ "InputContactMessageContent",
560
+ "InputInvoiceMessageContent",
561
+ ] | Option[
562
+ typing.Union[
563
+ "InputTextMessageContent",
564
+ "InputLocationMessageContent",
565
+ "InputVenueMessageContent",
566
+ "InputContactMessageContent",
567
+ "InputInvoiceMessageContent",
568
+ ]
569
+ ] = Nothing,
570
+ ) -> InlineQueryResultCachedGif:
571
+ return InlineQueryResultCachedGif(type=InlineQueryResultType.GIF, **get_params(locals()))
572
+
573
+
574
+ def inline_query_cached_mpeg4_gif(
575
+ id: str,
576
+ mpeg4_file_id: str,
577
+ *,
578
+ title: str | Option[str] = Nothing,
579
+ caption: str | Option[str] = Nothing,
580
+ parse_mode: str | Option[str] = Nothing,
581
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
582
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
583
+ input_message_content: typing.Union[
584
+ "InputTextMessageContent",
585
+ "InputLocationMessageContent",
586
+ "InputVenueMessageContent",
587
+ "InputContactMessageContent",
588
+ "InputInvoiceMessageContent",
589
+ ] | Option[
590
+ typing.Union[
591
+ "InputTextMessageContent",
592
+ "InputLocationMessageContent",
593
+ "InputVenueMessageContent",
594
+ "InputContactMessageContent",
595
+ "InputInvoiceMessageContent",
596
+ ]
597
+ ] = Nothing,
598
+ ) -> InlineQueryResultCachedMpeg4Gif:
599
+ return InlineQueryResultCachedMpeg4Gif(type=InlineQueryResultType.MPEG4_GIF, **get_params(locals()))
600
+
601
+
602
+ def inline_query_cached_voice(
603
+ id: str,
604
+ voice_file_id: str,
605
+ *,
606
+ caption: str | Option[str] = Nothing,
607
+ parse_mode: str | Option[str] = Nothing,
608
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
609
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
610
+ input_message_content: typing.Union[
611
+ "InputTextMessageContent",
612
+ "InputLocationMessageContent",
613
+ "InputVenueMessageContent",
614
+ "InputContactMessageContent",
615
+ "InputInvoiceMessageContent",
616
+ ] | Option[
617
+ typing.Union[
618
+ "InputTextMessageContent",
619
+ "InputLocationMessageContent",
620
+ "InputVenueMessageContent",
621
+ "InputContactMessageContent",
622
+ "InputInvoiceMessageContent",
623
+ ]
624
+ ] = Nothing,
625
+ ) -> InlineQueryResultCachedVoice:
626
+ return InlineQueryResultCachedVoice(type=InlineQueryResultType.VOICE, **get_params(locals()))
627
+
628
+
629
+ def inline_query_cached_photo(
630
+ id: str,
631
+ photo_file_id: str,
632
+ *,
633
+ title: str | Option[str] = Nothing,
634
+ description: str | Option[str] = Nothing,
635
+ caption: str | Option[str] = Nothing,
636
+ parse_mode: str | Option[str] = Nothing,
637
+ caption_entities: list["MessageEntity"] | Option[list["MessageEntity"]] = Nothing,
638
+ reply_markup: InlineKeyboardMarkup | Option["InlineKeyboardMarkup"] = Nothing,
639
+ input_message_content: typing.Union[
640
+ "InputTextMessageContent",
641
+ "InputLocationMessageContent",
642
+ "InputVenueMessageContent",
643
+ "InputContactMessageContent",
644
+ "InputInvoiceMessageContent",
645
+ ] | Option[
646
+ typing.Union[
647
+ "InputTextMessageContent",
648
+ "InputLocationMessageContent",
649
+ "InputVenueMessageContent",
650
+ "InputContactMessageContent",
651
+ "InputInvoiceMessageContent",
652
+ ]
653
+ ] = Nothing,
654
+ ) -> InlineQueryResultCachedPhoto:
655
+ return InlineQueryResultCachedPhoto(type=InlineQueryResultType.PHOTO, **get_params(locals()))
656
+
657
+
658
+ __all__ = (
659
+ "inline_query_article",
660
+ "inline_query_photo",
661
+ "inline_query_mpeg4_gif",
662
+ "inline_query_gif",
663
+ "inline_query_video",
664
+ "inline_query_audio",
665
+ "inline_query_voice",
666
+ "inline_query_document",
667
+ "inline_query_location",
668
+ "inline_query_venue",
669
+ "inline_query_contact",
670
+ "inline_query_game",
671
+ "inline_query_cached_sticker",
672
+ "inline_query_cached_document",
673
+ "inline_query_cached_audio",
674
+ "inline_query_cached_video",
675
+ "inline_query_cached_gif",
676
+ "inline_query_cached_mpeg4_gif",
677
+ "inline_query_cached_voice",
678
+ "inline_query_cached_photo",
679
+ "input_text_message_content",
680
+ "input_location_message_content",
681
+ "input_venue_message_content",
682
+ "input_contact_message_content",
683
+ "input_invoice_message_content",
684
+ )
@@ -1,2 +1,4 @@
1
1
  from .base import KeyboardSetBase, KeyboardSetError
2
2
  from .yaml import KeyboardSetYAML
3
+
4
+ __all__ = ("KeyboardSetBase", "KeyboardSetError", "KeyboardSetYAML")
@@ -10,3 +10,6 @@ class KeyboardSetBase(ABC):
10
10
  @abstractmethod
11
11
  def load(cls) -> None:
12
12
  pass
13
+
14
+
15
+ __all__ = ("KeyboardSetBase", "KeyboardSetError")