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.
- telegrinder/__init__.py +4 -2
- telegrinder/api/__init__.py +0 -0
- telegrinder/api/abc.py +6 -4
- telegrinder/api/api.py +25 -11
- telegrinder/api/error.py +0 -0
- telegrinder/api/response.py +0 -0
- telegrinder/bot/__init__.py +0 -0
- telegrinder/bot/bot.py +0 -0
- telegrinder/bot/cute_types/__init__.py +0 -0
- telegrinder/bot/cute_types/base.py +100 -9
- telegrinder/bot/cute_types/callback_query.py +426 -37
- telegrinder/bot/cute_types/inline_query.py +44 -17
- telegrinder/bot/cute_types/message.py +2885 -117
- telegrinder/bot/cute_types/update.py +14 -7
- telegrinder/bot/cute_types/utils.py +542 -0
- telegrinder/bot/dispatch/__init__.py +0 -0
- telegrinder/bot/dispatch/abc.py +0 -0
- telegrinder/bot/dispatch/composition.py +0 -0
- telegrinder/bot/dispatch/context.py +0 -0
- telegrinder/bot/dispatch/dispatch.py +0 -0
- telegrinder/bot/dispatch/handler/__init__.py +0 -0
- telegrinder/bot/dispatch/handler/abc.py +0 -0
- telegrinder/bot/dispatch/handler/func.py +1 -1
- telegrinder/bot/dispatch/handler/message_reply.py +0 -0
- telegrinder/bot/dispatch/middleware/__init__.py +0 -0
- telegrinder/bot/dispatch/middleware/abc.py +0 -0
- telegrinder/bot/dispatch/process.py +0 -0
- telegrinder/bot/dispatch/return_manager/__init__.py +0 -0
- telegrinder/bot/dispatch/return_manager/abc.py +0 -0
- telegrinder/bot/dispatch/return_manager/callback_query.py +0 -0
- telegrinder/bot/dispatch/return_manager/inline_query.py +0 -0
- telegrinder/bot/dispatch/return_manager/message.py +0 -0
- telegrinder/bot/dispatch/view/__init__.py +0 -0
- telegrinder/bot/dispatch/view/abc.py +40 -29
- telegrinder/bot/dispatch/view/box.py +0 -0
- telegrinder/bot/dispatch/view/callback_query.py +0 -0
- telegrinder/bot/dispatch/view/inline_query.py +0 -0
- telegrinder/bot/dispatch/view/message.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/__init__.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/machine.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/middleware.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/short_state.py +0 -0
- telegrinder/bot/polling/__init__.py +0 -0
- telegrinder/bot/polling/abc.py +0 -0
- telegrinder/bot/polling/polling.py +7 -11
- telegrinder/bot/rules/__init__.py +0 -0
- telegrinder/bot/rules/abc.py +1 -1
- telegrinder/bot/rules/adapter/__init__.py +0 -0
- telegrinder/bot/rules/adapter/abc.py +0 -0
- telegrinder/bot/rules/adapter/errors.py +0 -0
- telegrinder/bot/rules/adapter/event.py +12 -6
- telegrinder/bot/rules/adapter/raw_update.py +0 -0
- telegrinder/bot/rules/callback_data.py +3 -11
- telegrinder/bot/rules/command.py +0 -0
- telegrinder/bot/rules/enum_text.py +0 -0
- telegrinder/bot/rules/func.py +0 -0
- telegrinder/bot/rules/fuzzy.py +0 -0
- telegrinder/bot/rules/inline.py +2 -1
- telegrinder/bot/rules/integer.py +0 -0
- telegrinder/bot/rules/is_from.py +0 -0
- telegrinder/bot/rules/markup.py +3 -1
- telegrinder/bot/rules/mention.py +0 -0
- telegrinder/bot/rules/message_entities.py +3 -1
- telegrinder/bot/rules/regex.py +1 -1
- telegrinder/bot/rules/rule_enum.py +0 -0
- telegrinder/bot/rules/start.py +0 -0
- telegrinder/bot/rules/text.py +0 -0
- telegrinder/bot/scenario/__init__.py +0 -0
- telegrinder/bot/scenario/abc.py +0 -0
- telegrinder/bot/scenario/checkbox.py +0 -0
- telegrinder/bot/scenario/choice.py +0 -0
- telegrinder/client/__init__.py +2 -2
- telegrinder/client/abc.py +35 -12
- telegrinder/client/aiohttp.py +35 -22
- telegrinder/model.py +70 -23
- telegrinder/modules.py +22 -12
- telegrinder/msgspec_json.py +0 -0
- telegrinder/msgspec_utils.py +30 -10
- telegrinder/node/__init__.py +0 -0
- telegrinder/node/attachment.py +0 -0
- telegrinder/node/base.py +0 -0
- telegrinder/node/composer.py +0 -0
- telegrinder/node/container.py +0 -0
- telegrinder/node/message.py +0 -0
- telegrinder/node/rule.py +0 -0
- telegrinder/node/source.py +0 -0
- telegrinder/node/text.py +0 -0
- telegrinder/node/tools/__init__.py +0 -0
- telegrinder/node/tools/generator.py +0 -0
- telegrinder/node/update.py +0 -0
- telegrinder/rules.py +0 -0
- telegrinder/tools/__init__.py +2 -30
- telegrinder/tools/buttons.py +19 -5
- telegrinder/tools/error_handler/__init__.py +2 -0
- telegrinder/tools/error_handler/abc.py +5 -1
- telegrinder/tools/error_handler/error.py +10 -0
- telegrinder/tools/error_handler/error_handler.py +100 -81
- telegrinder/tools/formatting/__init__.py +0 -0
- telegrinder/tools/formatting/html.py +0 -0
- telegrinder/tools/formatting/links.py +0 -0
- telegrinder/tools/formatting/spec_html_formats.py +0 -0
- telegrinder/tools/global_context/__init__.py +0 -0
- telegrinder/tools/global_context/abc.py +0 -0
- telegrinder/tools/global_context/global_context.py +65 -67
- telegrinder/tools/global_context/telegrinder_ctx.py +0 -0
- telegrinder/tools/i18n/__init__.py +0 -0
- telegrinder/tools/i18n/base.py +0 -0
- telegrinder/tools/i18n/middleware/__init__.py +0 -0
- telegrinder/tools/i18n/middleware/base.py +0 -0
- telegrinder/tools/i18n/simple.py +0 -0
- telegrinder/tools/kb_set/__init__.py +0 -0
- telegrinder/tools/kb_set/base.py +0 -0
- telegrinder/tools/kb_set/yaml.py +3 -3
- telegrinder/tools/keyboard.py +17 -26
- telegrinder/tools/loop_wrapper/__init__.py +0 -0
- telegrinder/tools/loop_wrapper/abc.py +0 -0
- telegrinder/tools/loop_wrapper/loop_wrapper.py +0 -0
- telegrinder/tools/magic.py +1 -1
- telegrinder/tools/parse_mode.py +0 -0
- telegrinder/types/__init__.py +0 -0
- telegrinder/types/enums.py +13 -9
- telegrinder/types/methods.py +783 -673
- telegrinder/types/objects.py +317 -163
- {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/LICENSE +0 -0
- {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/METADATA +9 -7
- {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/RECORD +42 -41
- {telegrinder-0.1.dev158.dist-info → telegrinder-0.1.dev160.dist-info}/WHEEL +1 -1
- telegrinder/tools/inline_query.py +0 -684
telegrinder/types/objects.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import typing
|
|
2
2
|
|
|
3
|
-
from fntypes.
|
|
3
|
+
from fntypes.co import Some, Variative
|
|
4
4
|
|
|
5
5
|
from telegrinder.model import Model
|
|
6
|
-
from telegrinder.msgspec_utils import Nothing, Option
|
|
6
|
+
from telegrinder.msgspec_utils import Nothing, Option, datetime
|
|
7
7
|
from telegrinder.types.enums import * # noqa: F403
|
|
8
8
|
|
|
9
9
|
|
|
@@ -12,7 +12,8 @@ class ReactionType(Model):
|
|
|
12
12
|
|
|
13
13
|
This object describes the type of a reaction. Currently, it can be one of
|
|
14
14
|
- ReactionTypeEmoji
|
|
15
|
-
- ReactionTypeCustomEmoji
|
|
15
|
+
- ReactionTypeCustomEmoji
|
|
16
|
+
"""
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class PassportElementError(Model):
|
|
@@ -27,7 +28,8 @@ class PassportElementError(Model):
|
|
|
27
28
|
- PassportElementErrorFiles
|
|
28
29
|
- PassportElementErrorTranslationFile
|
|
29
30
|
- PassportElementErrorTranslationFiles
|
|
30
|
-
- PassportElementErrorUnspecified
|
|
31
|
+
- PassportElementErrorUnspecified
|
|
32
|
+
"""
|
|
31
33
|
|
|
32
34
|
|
|
33
35
|
class MessageOrigin(Model):
|
|
@@ -37,7 +39,8 @@ class MessageOrigin(Model):
|
|
|
37
39
|
- MessageOriginUser
|
|
38
40
|
- MessageOriginHiddenUser
|
|
39
41
|
- MessageOriginChat
|
|
40
|
-
- MessageOriginChannel
|
|
42
|
+
- MessageOriginChannel
|
|
43
|
+
"""
|
|
41
44
|
|
|
42
45
|
|
|
43
46
|
class MaybeInaccessibleMessage(Model):
|
|
@@ -45,7 +48,8 @@ class MaybeInaccessibleMessage(Model):
|
|
|
45
48
|
|
|
46
49
|
This object describes a message that can be inaccessible to the bot. It can be one of
|
|
47
50
|
- Message
|
|
48
|
-
- InaccessibleMessage
|
|
51
|
+
- InaccessibleMessage
|
|
52
|
+
"""
|
|
49
53
|
|
|
50
54
|
|
|
51
55
|
class MenuButton(Model):
|
|
@@ -67,7 +71,8 @@ class InputMessageContent(Model):
|
|
|
67
71
|
- InputLocationMessageContent
|
|
68
72
|
- InputVenueMessageContent
|
|
69
73
|
- InputContactMessageContent
|
|
70
|
-
- InputInvoiceMessageContent
|
|
74
|
+
- InputInvoiceMessageContent
|
|
75
|
+
"""
|
|
71
76
|
|
|
72
77
|
|
|
73
78
|
class InputMedia(Model):
|
|
@@ -78,7 +83,8 @@ class InputMedia(Model):
|
|
|
78
83
|
- InputMediaDocument
|
|
79
84
|
- InputMediaAudio
|
|
80
85
|
- InputMediaPhoto
|
|
81
|
-
- InputMediaVideo
|
|
86
|
+
- InputMediaVideo
|
|
87
|
+
"""
|
|
82
88
|
|
|
83
89
|
|
|
84
90
|
class InlineQueryResult(Model):
|
|
@@ -118,7 +124,8 @@ class ChatMember(Model):
|
|
|
118
124
|
- ChatMemberMember
|
|
119
125
|
- ChatMemberRestricted
|
|
120
126
|
- ChatMemberLeft
|
|
121
|
-
- ChatMemberBanned
|
|
127
|
+
- ChatMemberBanned
|
|
128
|
+
"""
|
|
122
129
|
|
|
123
130
|
|
|
124
131
|
class ChatBoostSource(Model):
|
|
@@ -127,7 +134,8 @@ class ChatBoostSource(Model):
|
|
|
127
134
|
This object describes the source of a chat boost. It can be one of
|
|
128
135
|
- ChatBoostSourcePremium
|
|
129
136
|
- ChatBoostSourceGiftCode
|
|
130
|
-
- ChatBoostSourceGiveaway
|
|
137
|
+
- ChatBoostSourceGiveaway
|
|
138
|
+
"""
|
|
131
139
|
|
|
132
140
|
|
|
133
141
|
class BotCommandScope(Model):
|
|
@@ -140,14 +148,16 @@ class BotCommandScope(Model):
|
|
|
140
148
|
- BotCommandScopeAllChatAdministrators
|
|
141
149
|
- BotCommandScopeChat
|
|
142
150
|
- BotCommandScopeChatAdministrators
|
|
143
|
-
- BotCommandScopeChatMember
|
|
151
|
+
- BotCommandScopeChatMember
|
|
152
|
+
"""
|
|
144
153
|
|
|
145
154
|
|
|
146
155
|
class Update(Model):
|
|
147
156
|
"""Object `Update`, see the [documentation](https://core.telegram.org/bots/api#update)
|
|
148
157
|
|
|
149
158
|
This object represents an incoming update.
|
|
150
|
-
At most one of the optional parameters can be present in any given update.
|
|
159
|
+
At most one of the optional parameters can be present in any given update.
|
|
160
|
+
"""
|
|
151
161
|
|
|
152
162
|
update_id: int
|
|
153
163
|
"""The update's unique identifier. Update identifiers start from a certain
|
|
@@ -235,11 +245,26 @@ class Update(Model):
|
|
|
235
245
|
"""Optional. A boost was removed from a chat. The bot must be an administrator
|
|
236
246
|
in the chat to receive these updates."""
|
|
237
247
|
|
|
248
|
+
@property
|
|
249
|
+
def update_type(self) -> Option[UpdateType]:
|
|
250
|
+
"""Incoming update type."""
|
|
251
|
+
|
|
252
|
+
if update := next(
|
|
253
|
+
filter(
|
|
254
|
+
lambda x: bool(x[1]),
|
|
255
|
+
self.to_dict(exclude_fields={"update_id"}).items(),
|
|
256
|
+
),
|
|
257
|
+
None,
|
|
258
|
+
):
|
|
259
|
+
return Some(UpdateType(update[0]))
|
|
260
|
+
return Nothing
|
|
261
|
+
|
|
238
262
|
|
|
239
263
|
class WebhookInfo(Model):
|
|
240
264
|
"""Object `WebhookInfo`, see the [documentation](https://core.telegram.org/bots/api#webhookinfo)
|
|
241
265
|
|
|
242
|
-
Describes the current status of a webhook.
|
|
266
|
+
Describes the current status of a webhook.
|
|
267
|
+
"""
|
|
243
268
|
|
|
244
269
|
url: str
|
|
245
270
|
"""Webhook URL, may be empty if webhook is not set up."""
|
|
@@ -253,7 +278,7 @@ class WebhookInfo(Model):
|
|
|
253
278
|
ip_address: Option[str] = Nothing
|
|
254
279
|
"""Optional. Currently used webhook IP address."""
|
|
255
280
|
|
|
256
|
-
last_error_date: Option[
|
|
281
|
+
last_error_date: Option[datetime] = Nothing
|
|
257
282
|
"""Optional. Unix time for the most recent error that happened when trying
|
|
258
283
|
to deliver an update via webhook."""
|
|
259
284
|
|
|
@@ -261,7 +286,7 @@ class WebhookInfo(Model):
|
|
|
261
286
|
"""Optional. Error message in human-readable format for the most recent error
|
|
262
287
|
that happened when trying to deliver an update via webhook."""
|
|
263
288
|
|
|
264
|
-
last_synchronization_error_date: Option[
|
|
289
|
+
last_synchronization_error_date: Option[datetime] = Nothing
|
|
265
290
|
"""Optional. Unix time of the most recent error that happened when trying to
|
|
266
291
|
synchronize available updates with Telegram datacenters."""
|
|
267
292
|
|
|
@@ -275,9 +300,10 @@ class WebhookInfo(Model):
|
|
|
275
300
|
|
|
276
301
|
|
|
277
302
|
class User(Model):
|
|
278
|
-
"""
|
|
303
|
+
"""Object `User`, see the [documentation](https://core.telegram.org/bots/api#user)
|
|
279
304
|
|
|
280
|
-
This object represents a Telegram user or bot.
|
|
305
|
+
This object represents a Telegram user or bot.
|
|
306
|
+
"""
|
|
281
307
|
|
|
282
308
|
id: int
|
|
283
309
|
"""Unique identifier for this user or bot. This number may have more than 32
|
|
@@ -317,14 +343,14 @@ class User(Model):
|
|
|
317
343
|
"""Optional. True, if the bot supports inline queries. Returned only in getMe."""
|
|
318
344
|
|
|
319
345
|
@property
|
|
320
|
-
def
|
|
321
|
-
"""User's or bot's color."""
|
|
346
|
+
def default_accent_color(self) -> DefaultAccentColor:
|
|
347
|
+
"""User's or bot's accent color (non-premium)."""
|
|
322
348
|
|
|
323
|
-
return
|
|
349
|
+
return DefaultAccentColor(self.id % 7)
|
|
324
350
|
|
|
325
351
|
@property
|
|
326
352
|
def full_name(self) -> str:
|
|
327
|
-
"""User's or bot's `first_name` + `last_name
|
|
353
|
+
"""User's or bot's full name (`first_name` + `last_name`)."""
|
|
328
354
|
|
|
329
355
|
return self.first_name + self.last_name.map(lambda v: " " + v).unwrap_or("")
|
|
330
356
|
|
|
@@ -332,7 +358,8 @@ class User(Model):
|
|
|
332
358
|
class Chat(Model):
|
|
333
359
|
"""Object `Chat`, see the [documentation](https://core.telegram.org/bots/api#chat)
|
|
334
360
|
|
|
335
|
-
This object represents a chat.
|
|
361
|
+
This object represents a chat.
|
|
362
|
+
"""
|
|
336
363
|
|
|
337
364
|
id: int
|
|
338
365
|
"""Unique identifier for this chat. This number may have more than 32 significant
|
|
@@ -392,7 +419,7 @@ class Chat(Model):
|
|
|
392
419
|
"""Optional. Custom emoji identifier of the emoji status of the chat or the
|
|
393
420
|
other party in a private chat. Returned only in getChat."""
|
|
394
421
|
|
|
395
|
-
emoji_status_expiration_date: Option[
|
|
422
|
+
emoji_status_expiration_date: Option[datetime] = Nothing
|
|
396
423
|
"""Optional. Expiration date of the emoji status of the chat or the other party
|
|
397
424
|
in a private chat, in Unix time, if any. Returned only in getChat."""
|
|
398
425
|
|
|
@@ -486,16 +513,24 @@ class Chat(Model):
|
|
|
486
513
|
"""Optional. For supergroups, the location to which the supergroup is connected.
|
|
487
514
|
Returned only in getChat."""
|
|
488
515
|
|
|
516
|
+
@property
|
|
517
|
+
def full_name(self) -> Option[str]:
|
|
518
|
+
"""Optional. Full name (`first_name` + `last_name`) of the
|
|
519
|
+
other party in a `private` chat."""
|
|
520
|
+
|
|
521
|
+
return self.first_name.map(lambda x: x + " " + self.last_name.unwrap_or(""))
|
|
522
|
+
|
|
489
523
|
|
|
490
524
|
class Message(MaybeInaccessibleMessage):
|
|
491
|
-
"""
|
|
525
|
+
"""Object `Message`, see the [documentation](https://core.telegram.org/bots/api#message)
|
|
492
526
|
|
|
493
|
-
This object represents a message.
|
|
527
|
+
This object represents a message.
|
|
528
|
+
"""
|
|
494
529
|
|
|
495
530
|
message_id: int
|
|
496
531
|
"""Unique message identifier inside this chat."""
|
|
497
532
|
|
|
498
|
-
date:
|
|
533
|
+
date: datetime
|
|
499
534
|
"""Date the message was sent in Unix time. It is always a positive number, representing
|
|
500
535
|
a valid date."""
|
|
501
536
|
|
|
@@ -559,7 +594,7 @@ class Message(MaybeInaccessibleMessage):
|
|
|
559
594
|
via_bot: Option["User"] = Nothing
|
|
560
595
|
"""Optional. Bot through which the message was sent."""
|
|
561
596
|
|
|
562
|
-
edit_date: Option[
|
|
597
|
+
edit_date: Option[datetime] = Nothing
|
|
563
598
|
"""Optional. Date the message was last edited in Unix time."""
|
|
564
599
|
|
|
565
600
|
has_protected_content: Option[bool] = Nothing
|
|
@@ -795,25 +830,47 @@ class Message(MaybeInaccessibleMessage):
|
|
|
795
830
|
|
|
796
831
|
@property
|
|
797
832
|
def from_user(self) -> "User":
|
|
798
|
-
"""`from_user` instead of `from_.unwrap()
|
|
833
|
+
"""`from_user` instead of `from_.unwrap()`."""
|
|
799
834
|
|
|
800
835
|
return self.from_.unwrap()
|
|
801
836
|
|
|
802
|
-
|
|
803
|
-
|
|
837
|
+
@property
|
|
838
|
+
def chat_id(self) -> int:
|
|
839
|
+
"""`chat_id` instead of `chat.id`."""
|
|
840
|
+
|
|
841
|
+
return self.chat.id
|
|
842
|
+
|
|
843
|
+
@property
|
|
844
|
+
def chat_title(self) -> str:
|
|
845
|
+
"""Chat title, for `supergroups`, `channels` and `group` chats.
|
|
846
|
+
Full name, for `private` chat."""
|
|
847
|
+
|
|
848
|
+
return (
|
|
849
|
+
self.chat.full_name.unwrap()
|
|
850
|
+
if self.chat.type == ChatType.PRIVATE
|
|
851
|
+
else self.chat.title.unwrap()
|
|
852
|
+
)
|
|
853
|
+
|
|
854
|
+
def __eq__(self, other: typing.Any) -> bool:
|
|
855
|
+
return (
|
|
856
|
+
isinstance(other, self.__class__)
|
|
857
|
+
and self.message_id == other.message_id
|
|
858
|
+
and self.chat_id == other.chat_id
|
|
859
|
+
)
|
|
804
860
|
|
|
805
861
|
|
|
806
862
|
class MessageId(Model):
|
|
807
863
|
"""Object `MessageId`, see the [documentation](https://core.telegram.org/bots/api#messageid)
|
|
808
864
|
|
|
809
|
-
This object represents a unique message identifier.
|
|
865
|
+
This object represents a unique message identifier.
|
|
866
|
+
"""
|
|
810
867
|
|
|
811
868
|
message_id: int
|
|
812
869
|
"""Unique message identifier."""
|
|
813
870
|
|
|
814
871
|
|
|
815
|
-
class InaccessibleMessage(
|
|
816
|
-
"""
|
|
872
|
+
class InaccessibleMessage(MaybeInaccessibleMessage):
|
|
873
|
+
"""Object `InaccessibleMessage`, see the [documentation](https://core.telegram.org/bots/api#inaccessiblemessage)
|
|
817
874
|
|
|
818
875
|
This object describes a message that was deleted or is otherwise inaccessible to the bot.
|
|
819
876
|
"""
|
|
@@ -979,7 +1036,8 @@ class ExternalReplyInfo(Model):
|
|
|
979
1036
|
class ReplyParameters(Model):
|
|
980
1037
|
"""Object `ReplyParameters`, see the [documentation](https://core.telegram.org/bots/api#replyparameters)
|
|
981
1038
|
|
|
982
|
-
Describes reply parameters for the message that is being sent.
|
|
1039
|
+
Describes reply parameters for the message that is being sent.
|
|
1040
|
+
"""
|
|
983
1041
|
|
|
984
1042
|
message_id: int
|
|
985
1043
|
"""Identifier of the message that will be replied to in the current chat, or
|
|
@@ -1016,12 +1074,13 @@ class ReplyParameters(Model):
|
|
|
1016
1074
|
class MessageOriginUser(MessageOrigin):
|
|
1017
1075
|
"""Object `MessageOriginUser`, see the [documentation](https://core.telegram.org/bots/api#messageoriginuser)
|
|
1018
1076
|
|
|
1019
|
-
The message was originally sent by a known user.
|
|
1077
|
+
The message was originally sent by a known user.
|
|
1078
|
+
"""
|
|
1020
1079
|
|
|
1021
1080
|
type: typing.Literal["user"]
|
|
1022
1081
|
"""Type of the message origin, always `user`."""
|
|
1023
1082
|
|
|
1024
|
-
date:
|
|
1083
|
+
date: datetime
|
|
1025
1084
|
"""Date the message was sent originally in Unix time."""
|
|
1026
1085
|
|
|
1027
1086
|
sender_user: "User"
|
|
@@ -1031,12 +1090,13 @@ class MessageOriginUser(MessageOrigin):
|
|
|
1031
1090
|
class MessageOriginHiddenUser(MessageOrigin):
|
|
1032
1091
|
"""Object `MessageOriginHiddenUser`, see the [documentation](https://core.telegram.org/bots/api#messageoriginhiddenuser)
|
|
1033
1092
|
|
|
1034
|
-
The message was originally sent by an unknown user.
|
|
1093
|
+
The message was originally sent by an unknown user.
|
|
1094
|
+
"""
|
|
1035
1095
|
|
|
1036
1096
|
type: typing.Literal["hidden_user"]
|
|
1037
1097
|
"""Type of the message origin, always `hidden_user`."""
|
|
1038
1098
|
|
|
1039
|
-
date:
|
|
1099
|
+
date: datetime
|
|
1040
1100
|
"""Date the message was sent originally in Unix time."""
|
|
1041
1101
|
|
|
1042
1102
|
sender_user_name: str
|
|
@@ -1046,12 +1106,13 @@ class MessageOriginHiddenUser(MessageOrigin):
|
|
|
1046
1106
|
class MessageOriginChat(MessageOrigin):
|
|
1047
1107
|
"""Object `MessageOriginChat`, see the [documentation](https://core.telegram.org/bots/api#messageoriginchat)
|
|
1048
1108
|
|
|
1049
|
-
The message was originally sent on behalf of a chat to a group chat.
|
|
1109
|
+
The message was originally sent on behalf of a chat to a group chat.
|
|
1110
|
+
"""
|
|
1050
1111
|
|
|
1051
1112
|
type: typing.Literal["chat"]
|
|
1052
1113
|
"""Type of the message origin, always `chat`."""
|
|
1053
1114
|
|
|
1054
|
-
date:
|
|
1115
|
+
date: datetime
|
|
1055
1116
|
"""Date the message was sent originally in Unix time."""
|
|
1056
1117
|
|
|
1057
1118
|
sender_chat: "Chat"
|
|
@@ -1065,12 +1126,13 @@ class MessageOriginChat(MessageOrigin):
|
|
|
1065
1126
|
class MessageOriginChannel(MessageOrigin):
|
|
1066
1127
|
"""Object `MessageOriginChannel`, see the [documentation](https://core.telegram.org/bots/api#messageoriginchannel)
|
|
1067
1128
|
|
|
1068
|
-
The message was originally sent to a channel chat.
|
|
1129
|
+
The message was originally sent to a channel chat.
|
|
1130
|
+
"""
|
|
1069
1131
|
|
|
1070
1132
|
type: typing.Literal["channel"]
|
|
1071
1133
|
"""Type of the message origin, always `channel`."""
|
|
1072
1134
|
|
|
1073
|
-
date:
|
|
1135
|
+
date: datetime
|
|
1074
1136
|
"""Date the message was sent originally in Unix time."""
|
|
1075
1137
|
|
|
1076
1138
|
chat: "Chat"
|
|
@@ -1086,7 +1148,8 @@ class MessageOriginChannel(MessageOrigin):
|
|
|
1086
1148
|
class PhotoSize(Model):
|
|
1087
1149
|
"""Object `PhotoSize`, see the [documentation](https://core.telegram.org/bots/api#photosize)
|
|
1088
1150
|
|
|
1089
|
-
This object represents one size of a photo or a file / sticker thumbnail.
|
|
1151
|
+
This object represents one size of a photo or a file / sticker thumbnail.
|
|
1152
|
+
"""
|
|
1090
1153
|
|
|
1091
1154
|
file_id: str
|
|
1092
1155
|
"""Identifier for this file, which can be used to download or reuse the file."""
|
|
@@ -1213,7 +1276,8 @@ class Document(Model):
|
|
|
1213
1276
|
class Story(Model):
|
|
1214
1277
|
"""Object `Story`, see the [documentation](https://core.telegram.org/bots/api#story)
|
|
1215
1278
|
|
|
1216
|
-
This object represents a story.
|
|
1279
|
+
This object represents a story.
|
|
1280
|
+
"""
|
|
1217
1281
|
|
|
1218
1282
|
chat: "Chat"
|
|
1219
1283
|
"""Chat that posted the story."""
|
|
@@ -1225,7 +1289,8 @@ class Story(Model):
|
|
|
1225
1289
|
class Video(Model):
|
|
1226
1290
|
"""Object `Video`, see the [documentation](https://core.telegram.org/bots/api#video)
|
|
1227
1291
|
|
|
1228
|
-
This object represents a video file.
|
|
1292
|
+
This object represents a video file.
|
|
1293
|
+
"""
|
|
1229
1294
|
|
|
1230
1295
|
file_id: str
|
|
1231
1296
|
"""Identifier for this file, which can be used to download or reuse the file."""
|
|
@@ -1262,7 +1327,8 @@ class Video(Model):
|
|
|
1262
1327
|
class VideoNote(Model):
|
|
1263
1328
|
"""Object `VideoNote`, see the [documentation](https://core.telegram.org/bots/api#videonote)
|
|
1264
1329
|
|
|
1265
|
-
This object represents a video message (available in Telegram apps as of v.4.0).
|
|
1330
|
+
This object represents a video message (available in Telegram apps as of v.4.0).
|
|
1331
|
+
"""
|
|
1266
1332
|
|
|
1267
1333
|
file_id: str
|
|
1268
1334
|
"""Identifier for this file, which can be used to download or reuse the file."""
|
|
@@ -1287,7 +1353,8 @@ class VideoNote(Model):
|
|
|
1287
1353
|
class Voice(Model):
|
|
1288
1354
|
"""Object `Voice`, see the [documentation](https://core.telegram.org/bots/api#voice)
|
|
1289
1355
|
|
|
1290
|
-
This object represents a voice note.
|
|
1356
|
+
This object represents a voice note.
|
|
1357
|
+
"""
|
|
1291
1358
|
|
|
1292
1359
|
file_id: str
|
|
1293
1360
|
"""Identifier for this file, which can be used to download or reuse the file."""
|
|
@@ -1312,7 +1379,8 @@ class Voice(Model):
|
|
|
1312
1379
|
class Contact(Model):
|
|
1313
1380
|
"""Object `Contact`, see the [documentation](https://core.telegram.org/bots/api#contact)
|
|
1314
1381
|
|
|
1315
|
-
This object represents a phone contact.
|
|
1382
|
+
This object represents a phone contact.
|
|
1383
|
+
"""
|
|
1316
1384
|
|
|
1317
1385
|
phone_number: str
|
|
1318
1386
|
"""Contact's phone number."""
|
|
@@ -1336,7 +1404,8 @@ class Contact(Model):
|
|
|
1336
1404
|
class Dice(Model):
|
|
1337
1405
|
"""Object `Dice`, see the [documentation](https://core.telegram.org/bots/api#dice)
|
|
1338
1406
|
|
|
1339
|
-
This object represents an animated emoji that displays a random value.
|
|
1407
|
+
This object represents an animated emoji that displays a random value.
|
|
1408
|
+
"""
|
|
1340
1409
|
|
|
1341
1410
|
emoji: DiceEmoji
|
|
1342
1411
|
"""Emoji on which the dice throw animation is based."""
|
|
@@ -1349,7 +1418,8 @@ class Dice(Model):
|
|
|
1349
1418
|
class PollOption(Model):
|
|
1350
1419
|
"""Object `PollOption`, see the [documentation](https://core.telegram.org/bots/api#polloption)
|
|
1351
1420
|
|
|
1352
|
-
This object contains information about one answer option in a poll.
|
|
1421
|
+
This object contains information about one answer option in a poll.
|
|
1422
|
+
"""
|
|
1353
1423
|
|
|
1354
1424
|
text: str
|
|
1355
1425
|
"""Option text, 1-100 characters."""
|
|
@@ -1361,7 +1431,8 @@ class PollOption(Model):
|
|
|
1361
1431
|
class PollAnswer(Model):
|
|
1362
1432
|
"""Object `PollAnswer`, see the [documentation](https://core.telegram.org/bots/api#pollanswer)
|
|
1363
1433
|
|
|
1364
|
-
This object represents an answer of a user in a non-anonymous poll.
|
|
1434
|
+
This object represents an answer of a user in a non-anonymous poll.
|
|
1435
|
+
"""
|
|
1365
1436
|
|
|
1366
1437
|
poll_id: str
|
|
1367
1438
|
"""Unique poll identifier."""
|
|
@@ -1381,7 +1452,8 @@ class PollAnswer(Model):
|
|
|
1381
1452
|
class Poll(Model):
|
|
1382
1453
|
"""Object `Poll`, see the [documentation](https://core.telegram.org/bots/api#poll)
|
|
1383
1454
|
|
|
1384
|
-
This object contains information about a poll.
|
|
1455
|
+
This object contains information about a poll.
|
|
1456
|
+
"""
|
|
1385
1457
|
|
|
1386
1458
|
id: str
|
|
1387
1459
|
"""Unique poll identifier."""
|
|
@@ -1401,7 +1473,7 @@ class Poll(Model):
|
|
|
1401
1473
|
is_anonymous: bool
|
|
1402
1474
|
"""True, if the poll is anonymous."""
|
|
1403
1475
|
|
|
1404
|
-
type:
|
|
1476
|
+
type: typing.Literal["regular", "quiz"]
|
|
1405
1477
|
"""Poll type, currently can be `regular` or `quiz`."""
|
|
1406
1478
|
|
|
1407
1479
|
allows_multiple_answers: bool
|
|
@@ -1423,7 +1495,7 @@ class Poll(Model):
|
|
|
1423
1495
|
open_period: Option[int] = Nothing
|
|
1424
1496
|
"""Optional. Amount of time in seconds the poll will be active after creation."""
|
|
1425
1497
|
|
|
1426
|
-
close_date: Option[
|
|
1498
|
+
close_date: Option[datetime] = Nothing
|
|
1427
1499
|
"""Optional. Point in time (Unix timestamp) when the poll will be automatically
|
|
1428
1500
|
closed."""
|
|
1429
1501
|
|
|
@@ -1431,7 +1503,8 @@ class Poll(Model):
|
|
|
1431
1503
|
class Location(Model):
|
|
1432
1504
|
"""Object `Location`, see the [documentation](https://core.telegram.org/bots/api#location)
|
|
1433
1505
|
|
|
1434
|
-
This object represents a point on the map.
|
|
1506
|
+
This object represents a point on the map.
|
|
1507
|
+
"""
|
|
1435
1508
|
|
|
1436
1509
|
latitude: float
|
|
1437
1510
|
"""Latitude as defined by sender."""
|
|
@@ -1459,7 +1532,8 @@ class Location(Model):
|
|
|
1459
1532
|
class Venue(Model):
|
|
1460
1533
|
"""Object `Venue`, see the [documentation](https://core.telegram.org/bots/api#venue)
|
|
1461
1534
|
|
|
1462
|
-
This object represents a venue.
|
|
1535
|
+
This object represents a venue.
|
|
1536
|
+
"""
|
|
1463
1537
|
|
|
1464
1538
|
location: "Location"
|
|
1465
1539
|
"""Venue location. Can't be a live location."""
|
|
@@ -1487,7 +1561,8 @@ class Venue(Model):
|
|
|
1487
1561
|
class WebAppData(Model):
|
|
1488
1562
|
"""Object `WebAppData`, see the [documentation](https://core.telegram.org/bots/api#webappdata)
|
|
1489
1563
|
|
|
1490
|
-
Describes data sent from a Web App to the bot.
|
|
1564
|
+
Describes data sent from a Web App to the bot.
|
|
1565
|
+
"""
|
|
1491
1566
|
|
|
1492
1567
|
data: str
|
|
1493
1568
|
"""The data. Be aware that a bad client can send arbitrary data in this field."""
|
|
@@ -1526,7 +1601,8 @@ class MessageAutoDeleteTimerChanged(Model):
|
|
|
1526
1601
|
class ChatBoostAdded(Model):
|
|
1527
1602
|
"""Object `ChatBoostAdded`, see the [documentation](https://core.telegram.org/bots/api#chatboostadded)
|
|
1528
1603
|
|
|
1529
|
-
This object represents a service message about a user boosting a chat.
|
|
1604
|
+
This object represents a service message about a user boosting a chat.
|
|
1605
|
+
"""
|
|
1530
1606
|
|
|
1531
1607
|
boost_count: int
|
|
1532
1608
|
"""Number of boosts added by the user."""
|
|
@@ -1558,7 +1634,8 @@ class ForumTopicClosed(Model):
|
|
|
1558
1634
|
class ForumTopicEdited(Model):
|
|
1559
1635
|
"""Object `ForumTopicEdited`, see the [documentation](https://core.telegram.org/bots/api#forumtopicedited)
|
|
1560
1636
|
|
|
1561
|
-
This object represents a service message about an edited forum topic.
|
|
1637
|
+
This object represents a service message about an edited forum topic.
|
|
1638
|
+
"""
|
|
1562
1639
|
|
|
1563
1640
|
name: Option[str] = Nothing
|
|
1564
1641
|
"""Optional. New name of the topic, if it was edited."""
|
|
@@ -1650,7 +1727,7 @@ class VideoChatScheduled(Model):
|
|
|
1650
1727
|
This object represents a service message about a video chat scheduled in the chat.
|
|
1651
1728
|
"""
|
|
1652
1729
|
|
|
1653
|
-
start_date:
|
|
1730
|
+
start_date: datetime
|
|
1654
1731
|
"""Point in time (Unix timestamp) when the video chat is supposed to be started
|
|
1655
1732
|
by a chat administrator."""
|
|
1656
1733
|
|
|
@@ -1665,7 +1742,8 @@ class VideoChatStarted(Model):
|
|
|
1665
1742
|
class VideoChatEnded(Model):
|
|
1666
1743
|
"""Object `VideoChatEnded`, see the [documentation](https://core.telegram.org/bots/api#videochatended)
|
|
1667
1744
|
|
|
1668
|
-
This object represents a service message about a video chat ended in the chat.
|
|
1745
|
+
This object represents a service message about a video chat ended in the chat.
|
|
1746
|
+
"""
|
|
1669
1747
|
|
|
1670
1748
|
duration: int
|
|
1671
1749
|
"""Video chat duration in seconds."""
|
|
@@ -1691,12 +1769,13 @@ class GiveawayCreated(Model):
|
|
|
1691
1769
|
class Giveaway(Model):
|
|
1692
1770
|
"""Object `Giveaway`, see the [documentation](https://core.telegram.org/bots/api#giveaway)
|
|
1693
1771
|
|
|
1694
|
-
This object represents a message about a scheduled giveaway.
|
|
1772
|
+
This object represents a message about a scheduled giveaway.
|
|
1773
|
+
"""
|
|
1695
1774
|
|
|
1696
1775
|
chats: list["Chat"]
|
|
1697
1776
|
"""The list of chats which the user must join to participate in the giveaway."""
|
|
1698
1777
|
|
|
1699
|
-
winners_selection_date:
|
|
1778
|
+
winners_selection_date: datetime
|
|
1700
1779
|
"""Point in time (Unix timestamp) when winners of the giveaway will be selected."""
|
|
1701
1780
|
|
|
1702
1781
|
winner_count: int
|
|
@@ -1735,7 +1814,7 @@ class GiveawayWinners(Model):
|
|
|
1735
1814
|
giveaway_message_id: int
|
|
1736
1815
|
"""Identifier of the message with the giveaway in the chat."""
|
|
1737
1816
|
|
|
1738
|
-
winners_selection_date:
|
|
1817
|
+
winners_selection_date: datetime
|
|
1739
1818
|
"""Point in time (Unix timestamp) when winners of the giveaway were selected."""
|
|
1740
1819
|
|
|
1741
1820
|
winner_count: int
|
|
@@ -1786,7 +1865,8 @@ class GiveawayCompleted(Model):
|
|
|
1786
1865
|
class LinkPreviewOptions(Model):
|
|
1787
1866
|
"""Object `LinkPreviewOptions`, see the [documentation](https://core.telegram.org/bots/api#linkpreviewoptions)
|
|
1788
1867
|
|
|
1789
|
-
Describes the options used for link preview generation.
|
|
1868
|
+
Describes the options used for link preview generation.
|
|
1869
|
+
"""
|
|
1790
1870
|
|
|
1791
1871
|
is_disabled: Option[bool] = Nothing
|
|
1792
1872
|
"""Optional. True, if the link preview is disabled."""
|
|
@@ -1813,7 +1893,8 @@ class LinkPreviewOptions(Model):
|
|
|
1813
1893
|
class UserProfilePhotos(Model):
|
|
1814
1894
|
"""Object `UserProfilePhotos`, see the [documentation](https://core.telegram.org/bots/api#userprofilephotos)
|
|
1815
1895
|
|
|
1816
|
-
This object represent a user's profile pictures.
|
|
1896
|
+
This object represent a user's profile pictures.
|
|
1897
|
+
"""
|
|
1817
1898
|
|
|
1818
1899
|
total_count: int
|
|
1819
1900
|
"""Total number of profile pictures the target user has."""
|
|
@@ -1849,7 +1930,8 @@ class File(Model):
|
|
|
1849
1930
|
class WebAppInfo(Model):
|
|
1850
1931
|
"""Object `WebAppInfo`, see the [documentation](https://core.telegram.org/bots/api#webappinfo)
|
|
1851
1932
|
|
|
1852
|
-
Describes a Web App.
|
|
1933
|
+
Describes a Web App.
|
|
1934
|
+
"""
|
|
1853
1935
|
|
|
1854
1936
|
url: str
|
|
1855
1937
|
"""An HTTPS URL of a Web App to be opened with additional data as specified in
|
|
@@ -1894,6 +1976,12 @@ class ReplyKeyboardMarkup(Model):
|
|
|
1894
1976
|
change the bot's language, bot replies to the request with a keyboard to
|
|
1895
1977
|
select the new language. Other users in the group don't see the keyboard."""
|
|
1896
1978
|
|
|
1979
|
+
@property
|
|
1980
|
+
def empty_markup(self) -> "ReplyKeyboardRemove":
|
|
1981
|
+
"""Empty keyboard to remove the custom keyboard."""
|
|
1982
|
+
|
|
1983
|
+
return ReplyKeyboardRemove(remove_keyboard=True, selective=self.selective)
|
|
1984
|
+
|
|
1897
1985
|
|
|
1898
1986
|
class KeyboardButton(Model):
|
|
1899
1987
|
"""Object `KeyboardButton`, see the [documentation](https://core.telegram.org/bots/api#keyboardbutton)
|
|
@@ -2005,7 +2093,7 @@ class KeyboardButtonPollType(Model):
|
|
|
2005
2093
|
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
|
|
2006
2094
|
"""
|
|
2007
2095
|
|
|
2008
|
-
type: Option[
|
|
2096
|
+
type: Option[typing.Literal["quiz", "regular"]] = Nothing
|
|
2009
2097
|
"""Optional. If quiz is passed, the user will be allowed to create only polls
|
|
2010
2098
|
in the quiz mode. If regular is passed, only regular polls will be allowed.
|
|
2011
2099
|
Otherwise, the user will be allowed to create a poll of any type."""
|
|
@@ -2104,7 +2192,8 @@ class LoginUrl(Model):
|
|
|
2104
2192
|
"""Object `LoginUrl`, see the [documentation](https://core.telegram.org/bots/api#loginurl)
|
|
2105
2193
|
|
|
2106
2194
|
This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
|
|
2107
|
-
Telegram apps support these buttons as of version 5.7.
|
|
2195
|
+
Telegram apps support these buttons as of version 5.7.
|
|
2196
|
+
"""
|
|
2108
2197
|
|
|
2109
2198
|
url: str
|
|
2110
2199
|
"""An HTTPS URL to be opened with user authorization data added to the query
|
|
@@ -2208,7 +2297,8 @@ class ForceReply(Model):
|
|
|
2208
2297
|
class ChatPhoto(Model):
|
|
2209
2298
|
"""Object `ChatPhoto`, see the [documentation](https://core.telegram.org/bots/api#chatphoto)
|
|
2210
2299
|
|
|
2211
|
-
This object represents a chat photo.
|
|
2300
|
+
This object represents a chat photo.
|
|
2301
|
+
"""
|
|
2212
2302
|
|
|
2213
2303
|
small_file_id: str
|
|
2214
2304
|
"""File identifier of small (160x160) chat photo. This file_id can be used
|
|
@@ -2232,7 +2322,8 @@ class ChatPhoto(Model):
|
|
|
2232
2322
|
class ChatInviteLink(Model):
|
|
2233
2323
|
"""Object `ChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#chatinvitelink)
|
|
2234
2324
|
|
|
2235
|
-
Represents an invite link for a chat.
|
|
2325
|
+
Represents an invite link for a chat.
|
|
2326
|
+
"""
|
|
2236
2327
|
|
|
2237
2328
|
invite_link: str
|
|
2238
2329
|
"""The invite link. If the link was created by another chat administrator,
|
|
@@ -2253,7 +2344,7 @@ class ChatInviteLink(Model):
|
|
|
2253
2344
|
name: Option[str] = Nothing
|
|
2254
2345
|
"""Optional. Invite link name."""
|
|
2255
2346
|
|
|
2256
|
-
expire_date: Option[
|
|
2347
|
+
expire_date: Option[datetime] = Nothing
|
|
2257
2348
|
"""Optional. Point in time (Unix timestamp) when the link will expire or has
|
|
2258
2349
|
been expired."""
|
|
2259
2350
|
|
|
@@ -2268,7 +2359,8 @@ class ChatInviteLink(Model):
|
|
|
2268
2359
|
class ChatAdministratorRights(Model):
|
|
2269
2360
|
"""Object `ChatAdministratorRights`, see the [documentation](https://core.telegram.org/bots/api#chatadministratorrights)
|
|
2270
2361
|
|
|
2271
|
-
Represents the rights of an administrator in a chat.
|
|
2362
|
+
Represents the rights of an administrator in a chat.
|
|
2363
|
+
"""
|
|
2272
2364
|
|
|
2273
2365
|
is_anonymous: bool
|
|
2274
2366
|
"""True, if the user's presence in the chat is hidden."""
|
|
@@ -2310,25 +2402,26 @@ class ChatAdministratorRights(Model):
|
|
|
2310
2402
|
|
|
2311
2403
|
can_post_messages: Option[bool] = Nothing
|
|
2312
2404
|
"""Optional. True, if the administrator can post messages in the channel,
|
|
2313
|
-
or access channel statistics; channels only."""
|
|
2405
|
+
or access channel statistics; for channels only."""
|
|
2314
2406
|
|
|
2315
2407
|
can_edit_messages: Option[bool] = Nothing
|
|
2316
2408
|
"""Optional. True, if the administrator can edit messages of other users and
|
|
2317
|
-
can pin messages; channels only."""
|
|
2409
|
+
can pin messages; for channels only."""
|
|
2318
2410
|
|
|
2319
2411
|
can_pin_messages: Option[bool] = Nothing
|
|
2320
|
-
"""Optional. True, if the user is allowed to pin messages; groups and supergroups
|
|
2412
|
+
"""Optional. True, if the user is allowed to pin messages; for groups and supergroups
|
|
2321
2413
|
only."""
|
|
2322
2414
|
|
|
2323
2415
|
can_manage_topics: Option[bool] = Nothing
|
|
2324
2416
|
"""Optional. True, if the user is allowed to create, rename, close, and reopen
|
|
2325
|
-
forum topics; supergroups only."""
|
|
2417
|
+
forum topics; for supergroups only."""
|
|
2326
2418
|
|
|
2327
2419
|
|
|
2328
2420
|
class ChatMemberUpdated(Model):
|
|
2329
2421
|
"""Object `ChatMemberUpdated`, see the [documentation](https://core.telegram.org/bots/api#chatmemberupdated)
|
|
2330
2422
|
|
|
2331
|
-
This object represents changes in the status of a chat member.
|
|
2423
|
+
This object represents changes in the status of a chat member.
|
|
2424
|
+
"""
|
|
2332
2425
|
|
|
2333
2426
|
chat: "Chat"
|
|
2334
2427
|
"""Chat the user belongs to."""
|
|
@@ -2336,7 +2429,7 @@ class ChatMemberUpdated(Model):
|
|
|
2336
2429
|
from_: "User"
|
|
2337
2430
|
"""Performer of the action, which resulted in the change."""
|
|
2338
2431
|
|
|
2339
|
-
date:
|
|
2432
|
+
date: datetime
|
|
2340
2433
|
"""Date the change was done in Unix time."""
|
|
2341
2434
|
|
|
2342
2435
|
old_chat_member: Variative[
|
|
@@ -2370,7 +2463,8 @@ class ChatMemberUpdated(Model):
|
|
|
2370
2463
|
class ChatMemberOwner(ChatMember):
|
|
2371
2464
|
"""Object `ChatMemberOwner`, see the [documentation](https://core.telegram.org/bots/api#chatmemberowner)
|
|
2372
2465
|
|
|
2373
|
-
Represents a chat member that owns the chat and has all administrator privileges.
|
|
2466
|
+
Represents a chat member that owns the chat and has all administrator privileges.
|
|
2467
|
+
"""
|
|
2374
2468
|
|
|
2375
2469
|
status: typing.Literal["creator"]
|
|
2376
2470
|
"""The member's status in the chat, always `creator`."""
|
|
@@ -2388,7 +2482,8 @@ class ChatMemberOwner(ChatMember):
|
|
|
2388
2482
|
class ChatMemberAdministrator(ChatMember):
|
|
2389
2483
|
"""Object `ChatMemberAdministrator`, see the [documentation](https://core.telegram.org/bots/api#chatmemberadministrator)
|
|
2390
2484
|
|
|
2391
|
-
Represents a chat member that has some additional privileges.
|
|
2485
|
+
Represents a chat member that has some additional privileges.
|
|
2486
|
+
"""
|
|
2392
2487
|
|
|
2393
2488
|
status: typing.Literal["administrator"]
|
|
2394
2489
|
"""The member's status in the chat, always `administrator`."""
|
|
@@ -2439,19 +2534,19 @@ class ChatMemberAdministrator(ChatMember):
|
|
|
2439
2534
|
|
|
2440
2535
|
can_post_messages: Option[bool] = Nothing
|
|
2441
2536
|
"""Optional. True, if the administrator can post messages in the channel,
|
|
2442
|
-
or access channel statistics; channels only."""
|
|
2537
|
+
or access channel statistics; for channels only."""
|
|
2443
2538
|
|
|
2444
2539
|
can_edit_messages: Option[bool] = Nothing
|
|
2445
2540
|
"""Optional. True, if the administrator can edit messages of other users and
|
|
2446
|
-
can pin messages; channels only."""
|
|
2541
|
+
can pin messages; for channels only."""
|
|
2447
2542
|
|
|
2448
2543
|
can_pin_messages: Option[bool] = Nothing
|
|
2449
|
-
"""Optional. True, if the user is allowed to pin messages; groups and supergroups
|
|
2544
|
+
"""Optional. True, if the user is allowed to pin messages; for groups and supergroups
|
|
2450
2545
|
only."""
|
|
2451
2546
|
|
|
2452
2547
|
can_manage_topics: Option[bool] = Nothing
|
|
2453
2548
|
"""Optional. True, if the user is allowed to create, rename, close, and reopen
|
|
2454
|
-
forum topics; supergroups only."""
|
|
2549
|
+
forum topics; for supergroups only."""
|
|
2455
2550
|
|
|
2456
2551
|
custom_title: Option[str] = Nothing
|
|
2457
2552
|
"""Optional. Custom title for this user."""
|
|
@@ -2460,7 +2555,8 @@ class ChatMemberAdministrator(ChatMember):
|
|
|
2460
2555
|
class ChatMemberMember(ChatMember):
|
|
2461
2556
|
"""Object `ChatMemberMember`, see the [documentation](https://core.telegram.org/bots/api#chatmembermember)
|
|
2462
2557
|
|
|
2463
|
-
Represents a chat member that has no additional privileges or restrictions.
|
|
2558
|
+
Represents a chat member that has no additional privileges or restrictions.
|
|
2559
|
+
"""
|
|
2464
2560
|
|
|
2465
2561
|
status: typing.Literal["member"]
|
|
2466
2562
|
"""The member's status in the chat, always `member`."""
|
|
@@ -2528,7 +2624,7 @@ class ChatMemberRestricted(ChatMember):
|
|
|
2528
2624
|
can_manage_topics: bool
|
|
2529
2625
|
"""True, if the user is allowed to create forum topics."""
|
|
2530
2626
|
|
|
2531
|
-
until_date:
|
|
2627
|
+
until_date: datetime
|
|
2532
2628
|
"""Date when restrictions will be lifted for this user; Unix time. If 0, then
|
|
2533
2629
|
the user is restricted forever."""
|
|
2534
2630
|
|
|
@@ -2558,7 +2654,7 @@ class ChatMemberBanned(ChatMember):
|
|
|
2558
2654
|
user: "User"
|
|
2559
2655
|
"""Information about the user."""
|
|
2560
2656
|
|
|
2561
|
-
until_date:
|
|
2657
|
+
until_date: datetime
|
|
2562
2658
|
"""Date when restrictions will be lifted for this user; Unix time. If 0, then
|
|
2563
2659
|
the user is banned forever."""
|
|
2564
2660
|
|
|
@@ -2566,7 +2662,8 @@ class ChatMemberBanned(ChatMember):
|
|
|
2566
2662
|
class ChatJoinRequest(Model):
|
|
2567
2663
|
"""Object `ChatJoinRequest`, see the [documentation](https://core.telegram.org/bots/api#chatjoinrequest)
|
|
2568
2664
|
|
|
2569
|
-
Represents a join request sent to a chat.
|
|
2665
|
+
Represents a join request sent to a chat.
|
|
2666
|
+
"""
|
|
2570
2667
|
|
|
2571
2668
|
chat: "Chat"
|
|
2572
2669
|
"""Chat to which the request was sent."""
|
|
@@ -2583,7 +2680,7 @@ class ChatJoinRequest(Model):
|
|
|
2583
2680
|
5 minutes to send messages until the join request is processed, assuming
|
|
2584
2681
|
no other administrator contacted the user."""
|
|
2585
2682
|
|
|
2586
|
-
date:
|
|
2683
|
+
date: datetime
|
|
2587
2684
|
"""Date the request was sent in Unix time."""
|
|
2588
2685
|
|
|
2589
2686
|
bio: Option[str] = Nothing
|
|
@@ -2596,7 +2693,8 @@ class ChatJoinRequest(Model):
|
|
|
2596
2693
|
class ChatPermissions(Model):
|
|
2597
2694
|
"""Object `ChatPermissions`, see the [documentation](https://core.telegram.org/bots/api#chatpermissions)
|
|
2598
2695
|
|
|
2599
|
-
Describes actions that a non-administrator user is allowed to take in a chat.
|
|
2696
|
+
Describes actions that a non-administrator user is allowed to take in a chat.
|
|
2697
|
+
"""
|
|
2600
2698
|
|
|
2601
2699
|
can_send_messages: Option[bool] = Nothing
|
|
2602
2700
|
"""Optional. True, if the user is allowed to send text messages, contacts,
|
|
@@ -2649,7 +2747,8 @@ class ChatPermissions(Model):
|
|
|
2649
2747
|
class ChatLocation(Model):
|
|
2650
2748
|
"""Object `ChatLocation`, see the [documentation](https://core.telegram.org/bots/api#chatlocation)
|
|
2651
2749
|
|
|
2652
|
-
Represents a location to which a chat is connected.
|
|
2750
|
+
Represents a location to which a chat is connected.
|
|
2751
|
+
"""
|
|
2653
2752
|
|
|
2654
2753
|
location: "Location"
|
|
2655
2754
|
"""The location to which the supergroup is connected. Can't be a live location."""
|
|
@@ -2661,7 +2760,8 @@ class ChatLocation(Model):
|
|
|
2661
2760
|
class ReactionTypeEmoji(ReactionType):
|
|
2662
2761
|
"""Object `ReactionTypeEmoji`, see the [documentation](https://core.telegram.org/bots/api#reactiontypeemoji)
|
|
2663
2762
|
|
|
2664
|
-
The reaction is based on an emoji.
|
|
2763
|
+
The reaction is based on an emoji.
|
|
2764
|
+
"""
|
|
2665
2765
|
|
|
2666
2766
|
type: typing.Literal["emoji"]
|
|
2667
2767
|
"""Type of the reaction, always `emoji`."""
|
|
@@ -2678,7 +2778,8 @@ class ReactionTypeEmoji(ReactionType):
|
|
|
2678
2778
|
class ReactionTypeCustomEmoji(ReactionType):
|
|
2679
2779
|
"""Object `ReactionTypeCustomEmoji`, see the [documentation](https://core.telegram.org/bots/api#reactiontypecustomemoji)
|
|
2680
2780
|
|
|
2681
|
-
The reaction is based on a custom emoji.
|
|
2781
|
+
The reaction is based on a custom emoji.
|
|
2782
|
+
"""
|
|
2682
2783
|
|
|
2683
2784
|
type: typing.Literal["custom_emoji"]
|
|
2684
2785
|
"""Type of the reaction, always `custom_emoji`."""
|
|
@@ -2703,7 +2804,8 @@ class ReactionCount(Model):
|
|
|
2703
2804
|
class MessageReactionUpdated(Model):
|
|
2704
2805
|
"""Object `MessageReactionUpdated`, see the [documentation](https://core.telegram.org/bots/api#messagereactionupdated)
|
|
2705
2806
|
|
|
2706
|
-
This object represents a change of a reaction on a message performed by a user.
|
|
2807
|
+
This object represents a change of a reaction on a message performed by a user.
|
|
2808
|
+
"""
|
|
2707
2809
|
|
|
2708
2810
|
chat: "Chat"
|
|
2709
2811
|
"""The chat containing the message the user reacted to."""
|
|
@@ -2711,7 +2813,7 @@ class MessageReactionUpdated(Model):
|
|
|
2711
2813
|
message_id: int
|
|
2712
2814
|
"""Unique identifier of the message inside the chat."""
|
|
2713
2815
|
|
|
2714
|
-
date:
|
|
2816
|
+
date: datetime
|
|
2715
2817
|
"""Date of the change in Unix time."""
|
|
2716
2818
|
|
|
2717
2819
|
old_reaction: list[Variative["ReactionTypeEmoji", "ReactionTypeCustomEmoji"]]
|
|
@@ -2731,7 +2833,8 @@ class MessageReactionUpdated(Model):
|
|
|
2731
2833
|
class MessageReactionCountUpdated(Model):
|
|
2732
2834
|
"""Object `MessageReactionCountUpdated`, see the [documentation](https://core.telegram.org/bots/api#messagereactioncountupdated)
|
|
2733
2835
|
|
|
2734
|
-
This object represents reaction changes on a message with anonymous reactions.
|
|
2836
|
+
This object represents reaction changes on a message with anonymous reactions.
|
|
2837
|
+
"""
|
|
2735
2838
|
|
|
2736
2839
|
chat: "Chat"
|
|
2737
2840
|
"""The chat containing the message."""
|
|
@@ -2739,7 +2842,7 @@ class MessageReactionCountUpdated(Model):
|
|
|
2739
2842
|
message_id: int
|
|
2740
2843
|
"""Unique message identifier inside the chat."""
|
|
2741
2844
|
|
|
2742
|
-
date:
|
|
2845
|
+
date: datetime
|
|
2743
2846
|
"""Date of the change in Unix time."""
|
|
2744
2847
|
|
|
2745
2848
|
reactions: list["ReactionCount"]
|
|
@@ -2749,7 +2852,8 @@ class MessageReactionCountUpdated(Model):
|
|
|
2749
2852
|
class ForumTopic(Model):
|
|
2750
2853
|
"""Object `ForumTopic`, see the [documentation](https://core.telegram.org/bots/api#forumtopic)
|
|
2751
2854
|
|
|
2752
|
-
This object represents a forum topic.
|
|
2855
|
+
This object represents a forum topic.
|
|
2856
|
+
"""
|
|
2753
2857
|
|
|
2754
2858
|
message_thread_id: int
|
|
2755
2859
|
"""Unique identifier of the forum topic."""
|
|
@@ -2767,7 +2871,8 @@ class ForumTopic(Model):
|
|
|
2767
2871
|
class BotCommand(Model):
|
|
2768
2872
|
"""Object `BotCommand`, see the [documentation](https://core.telegram.org/bots/api#botcommand)
|
|
2769
2873
|
|
|
2770
|
-
This object represents a bot command.
|
|
2874
|
+
This object represents a bot command.
|
|
2875
|
+
"""
|
|
2771
2876
|
|
|
2772
2877
|
command: str
|
|
2773
2878
|
"""Text of the command; 1-32 characters. Can contain only lowercase English
|
|
@@ -2790,7 +2895,8 @@ class BotCommandScopeDefault(BotCommandScope):
|
|
|
2790
2895
|
class BotCommandScopeAllPrivateChats(BotCommandScope):
|
|
2791
2896
|
"""Object `BotCommandScopeAllPrivateChats`, see the [documentation](https://core.telegram.org/bots/api#botcommandscopeallprivatechats)
|
|
2792
2897
|
|
|
2793
|
-
Represents the scope of bot commands, covering all private chats.
|
|
2898
|
+
Represents the scope of bot commands, covering all private chats.
|
|
2899
|
+
"""
|
|
2794
2900
|
|
|
2795
2901
|
type: typing.Literal["all_private_chats"]
|
|
2796
2902
|
"""Scope type, must be all_private_chats."""
|
|
@@ -2799,7 +2905,8 @@ class BotCommandScopeAllPrivateChats(BotCommandScope):
|
|
|
2799
2905
|
class BotCommandScopeAllGroupChats(BotCommandScope):
|
|
2800
2906
|
"""Object `BotCommandScopeAllGroupChats`, see the [documentation](https://core.telegram.org/bots/api#botcommandscopeallgroupchats)
|
|
2801
2907
|
|
|
2802
|
-
Represents the scope of bot commands, covering all group and supergroup chats.
|
|
2908
|
+
Represents the scope of bot commands, covering all group and supergroup chats.
|
|
2909
|
+
"""
|
|
2803
2910
|
|
|
2804
2911
|
type: typing.Literal["all_group_chats"]
|
|
2805
2912
|
"""Scope type, must be all_group_chats."""
|
|
@@ -2818,7 +2925,8 @@ class BotCommandScopeAllChatAdministrators(BotCommandScope):
|
|
|
2818
2925
|
class BotCommandScopeChat(BotCommandScope):
|
|
2819
2926
|
"""Object `BotCommandScopeChat`, see the [documentation](https://core.telegram.org/bots/api#botcommandscopechat)
|
|
2820
2927
|
|
|
2821
|
-
Represents the scope of bot commands, covering a specific chat.
|
|
2928
|
+
Represents the scope of bot commands, covering a specific chat.
|
|
2929
|
+
"""
|
|
2822
2930
|
|
|
2823
2931
|
type: typing.Literal["chat"]
|
|
2824
2932
|
"""Scope type, must be chat."""
|
|
@@ -2862,7 +2970,8 @@ class BotCommandScopeChatMember(BotCommandScope):
|
|
|
2862
2970
|
class BotName(Model):
|
|
2863
2971
|
"""Object `BotName`, see the [documentation](https://core.telegram.org/bots/api#botname)
|
|
2864
2972
|
|
|
2865
|
-
This object represents the bot's name.
|
|
2973
|
+
This object represents the bot's name.
|
|
2974
|
+
"""
|
|
2866
2975
|
|
|
2867
2976
|
name: str
|
|
2868
2977
|
"""The bot's name."""
|
|
@@ -2871,7 +2980,8 @@ class BotName(Model):
|
|
|
2871
2980
|
class BotDescription(Model):
|
|
2872
2981
|
"""Object `BotDescription`, see the [documentation](https://core.telegram.org/bots/api#botdescription)
|
|
2873
2982
|
|
|
2874
|
-
This object represents the bot's description.
|
|
2983
|
+
This object represents the bot's description.
|
|
2984
|
+
"""
|
|
2875
2985
|
|
|
2876
2986
|
description: str
|
|
2877
2987
|
"""The bot's description."""
|
|
@@ -2880,7 +2990,8 @@ class BotDescription(Model):
|
|
|
2880
2990
|
class BotShortDescription(Model):
|
|
2881
2991
|
"""Object `BotShortDescription`, see the [documentation](https://core.telegram.org/bots/api#botshortdescription)
|
|
2882
2992
|
|
|
2883
|
-
This object represents the bot's short description.
|
|
2993
|
+
This object represents the bot's short description.
|
|
2994
|
+
"""
|
|
2884
2995
|
|
|
2885
2996
|
short_description: str
|
|
2886
2997
|
"""The bot's short description."""
|
|
@@ -2889,7 +3000,8 @@ class BotShortDescription(Model):
|
|
|
2889
3000
|
class MenuButtonCommands(MenuButton):
|
|
2890
3001
|
"""Object `MenuButtonCommands`, see the [documentation](https://core.telegram.org/bots/api#menubuttoncommands)
|
|
2891
3002
|
|
|
2892
|
-
Represents a menu button, which opens the bot's list of commands.
|
|
3003
|
+
Represents a menu button, which opens the bot's list of commands.
|
|
3004
|
+
"""
|
|
2893
3005
|
|
|
2894
3006
|
type: typing.Literal["commands"]
|
|
2895
3007
|
"""Type of the button, must be commands."""
|
|
@@ -2898,7 +3010,8 @@ class MenuButtonCommands(MenuButton):
|
|
|
2898
3010
|
class MenuButtonWebApp(MenuButton):
|
|
2899
3011
|
"""Object `MenuButtonWebApp`, see the [documentation](https://core.telegram.org/bots/api#menubuttonwebapp)
|
|
2900
3012
|
|
|
2901
|
-
Represents a menu button, which launches a Web App.
|
|
3013
|
+
Represents a menu button, which launches a Web App.
|
|
3014
|
+
"""
|
|
2902
3015
|
|
|
2903
3016
|
type: typing.Literal["web_app"]
|
|
2904
3017
|
"""Type of the button, must be web_app."""
|
|
@@ -2915,7 +3028,8 @@ class MenuButtonWebApp(MenuButton):
|
|
|
2915
3028
|
class MenuButtonDefault(MenuButton):
|
|
2916
3029
|
"""Object `MenuButtonDefault`, see the [documentation](https://core.telegram.org/bots/api#menubuttondefault)
|
|
2917
3030
|
|
|
2918
|
-
Describes that no specific value for the menu button was set.
|
|
3031
|
+
Describes that no specific value for the menu button was set.
|
|
3032
|
+
"""
|
|
2919
3033
|
|
|
2920
3034
|
type: typing.Literal["default"]
|
|
2921
3035
|
"""Type of the button, must be default."""
|
|
@@ -2971,15 +3085,16 @@ class ChatBoostSourceGiveaway(ChatBoostSource):
|
|
|
2971
3085
|
class ChatBoost(Model):
|
|
2972
3086
|
"""Object `ChatBoost`, see the [documentation](https://core.telegram.org/bots/api#chatboost)
|
|
2973
3087
|
|
|
2974
|
-
This object contains information about a chat boost.
|
|
3088
|
+
This object contains information about a chat boost.
|
|
3089
|
+
"""
|
|
2975
3090
|
|
|
2976
3091
|
boost_id: str
|
|
2977
3092
|
"""Unique identifier of the boost."""
|
|
2978
3093
|
|
|
2979
|
-
add_date:
|
|
3094
|
+
add_date: datetime
|
|
2980
3095
|
"""Point in time (Unix timestamp) when the chat was boosted."""
|
|
2981
3096
|
|
|
2982
|
-
expiration_date:
|
|
3097
|
+
expiration_date: datetime
|
|
2983
3098
|
"""Point in time (Unix timestamp) when the boost will automatically expire,
|
|
2984
3099
|
unless the booster's Telegram Premium subscription is prolonged."""
|
|
2985
3100
|
|
|
@@ -2992,7 +3107,8 @@ class ChatBoost(Model):
|
|
|
2992
3107
|
class ChatBoostUpdated(Model):
|
|
2993
3108
|
"""Object `ChatBoostUpdated`, see the [documentation](https://core.telegram.org/bots/api#chatboostupdated)
|
|
2994
3109
|
|
|
2995
|
-
This object represents a boost added to a chat or changed.
|
|
3110
|
+
This object represents a boost added to a chat or changed.
|
|
3111
|
+
"""
|
|
2996
3112
|
|
|
2997
3113
|
chat: "Chat"
|
|
2998
3114
|
"""Chat which was boosted."""
|
|
@@ -3004,7 +3120,8 @@ class ChatBoostUpdated(Model):
|
|
|
3004
3120
|
class ChatBoostRemoved(Model):
|
|
3005
3121
|
"""Object `ChatBoostRemoved`, see the [documentation](https://core.telegram.org/bots/api#chatboostremoved)
|
|
3006
3122
|
|
|
3007
|
-
This object represents a boost removed from a chat.
|
|
3123
|
+
This object represents a boost removed from a chat.
|
|
3124
|
+
"""
|
|
3008
3125
|
|
|
3009
3126
|
chat: "Chat"
|
|
3010
3127
|
"""Chat which was boosted."""
|
|
@@ -3012,7 +3129,7 @@ class ChatBoostRemoved(Model):
|
|
|
3012
3129
|
boost_id: str
|
|
3013
3130
|
"""Unique identifier of the boost."""
|
|
3014
3131
|
|
|
3015
|
-
remove_date:
|
|
3132
|
+
remove_date: datetime
|
|
3016
3133
|
"""Point in time (Unix timestamp) when the boost was removed."""
|
|
3017
3134
|
|
|
3018
3135
|
source: Variative[
|
|
@@ -3024,7 +3141,8 @@ class ChatBoostRemoved(Model):
|
|
|
3024
3141
|
class UserChatBoosts(Model):
|
|
3025
3142
|
"""Object `UserChatBoosts`, see the [documentation](https://core.telegram.org/bots/api#userchatboosts)
|
|
3026
3143
|
|
|
3027
|
-
This object represents a list of boosts added to a chat by a user.
|
|
3144
|
+
This object represents a list of boosts added to a chat by a user.
|
|
3145
|
+
"""
|
|
3028
3146
|
|
|
3029
3147
|
boosts: list["ChatBoost"]
|
|
3030
3148
|
"""The list of boosts added to the chat by the user."""
|
|
@@ -3033,7 +3151,8 @@ class UserChatBoosts(Model):
|
|
|
3033
3151
|
class ResponseParameters(Model):
|
|
3034
3152
|
"""Object `ResponseParameters`, see the [documentation](https://core.telegram.org/bots/api#responseparameters)
|
|
3035
3153
|
|
|
3036
|
-
Describes why a request was unsuccessful.
|
|
3154
|
+
Describes why a request was unsuccessful.
|
|
3155
|
+
"""
|
|
3037
3156
|
|
|
3038
3157
|
migrate_to_chat_id: Option[int] = Nothing
|
|
3039
3158
|
"""Optional. The group has been migrated to a supergroup with the specified
|
|
@@ -3050,12 +3169,13 @@ class ResponseParameters(Model):
|
|
|
3050
3169
|
class InputMediaPhoto(InputMedia):
|
|
3051
3170
|
"""Object `InputMediaPhoto`, see the [documentation](https://core.telegram.org/bots/api#inputmediaphoto)
|
|
3052
3171
|
|
|
3053
|
-
Represents a photo to be sent.
|
|
3172
|
+
Represents a photo to be sent.
|
|
3173
|
+
"""
|
|
3054
3174
|
|
|
3055
3175
|
type: typing.Literal["photo"]
|
|
3056
3176
|
"""Type of the result, must be photo."""
|
|
3057
3177
|
|
|
3058
|
-
media: str
|
|
3178
|
+
media: Variative["InputFile", str]
|
|
3059
3179
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers
|
|
3060
3180
|
(recommended), pass an HTTP URL for Telegram to get a file from the Internet,
|
|
3061
3181
|
or pass `attach://<file_attach_name>` to upload a new one using multipart/form-data
|
|
@@ -3080,12 +3200,13 @@ class InputMediaPhoto(InputMedia):
|
|
|
3080
3200
|
class InputMediaVideo(InputMedia):
|
|
3081
3201
|
"""Object `InputMediaVideo`, see the [documentation](https://core.telegram.org/bots/api#inputmediavideo)
|
|
3082
3202
|
|
|
3083
|
-
Represents a video to be sent.
|
|
3203
|
+
Represents a video to be sent.
|
|
3204
|
+
"""
|
|
3084
3205
|
|
|
3085
3206
|
type: typing.Literal["video"]
|
|
3086
3207
|
"""Type of the result, must be video."""
|
|
3087
3208
|
|
|
3088
|
-
media: str
|
|
3209
|
+
media: Variative["InputFile", str]
|
|
3089
3210
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers
|
|
3090
3211
|
(recommended), pass an HTTP URL for Telegram to get a file from the Internet,
|
|
3091
3212
|
or pass `attach://<file_attach_name>` to upload a new one using multipart/form-data
|
|
@@ -3137,7 +3258,7 @@ class InputMediaAnimation(InputMedia):
|
|
|
3137
3258
|
type: typing.Literal["animation"]
|
|
3138
3259
|
"""Type of the result, must be animation."""
|
|
3139
3260
|
|
|
3140
|
-
media: str
|
|
3261
|
+
media: Variative["InputFile", str]
|
|
3141
3262
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers
|
|
3142
3263
|
(recommended), pass an HTTP URL for Telegram to get a file from the Internet,
|
|
3143
3264
|
or pass `attach://<file_attach_name>` to upload a new one using multipart/form-data
|
|
@@ -3180,12 +3301,13 @@ class InputMediaAnimation(InputMedia):
|
|
|
3180
3301
|
class InputMediaAudio(InputMedia):
|
|
3181
3302
|
"""Object `InputMediaAudio`, see the [documentation](https://core.telegram.org/bots/api#inputmediaaudio)
|
|
3182
3303
|
|
|
3183
|
-
Represents an audio file to be treated as music to be sent.
|
|
3304
|
+
Represents an audio file to be treated as music to be sent.
|
|
3305
|
+
"""
|
|
3184
3306
|
|
|
3185
3307
|
type: typing.Literal["audio"]
|
|
3186
3308
|
"""Type of the result, must be audio."""
|
|
3187
3309
|
|
|
3188
|
-
media: str
|
|
3310
|
+
media: Variative["InputFile", str]
|
|
3189
3311
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers
|
|
3190
3312
|
(recommended), pass an HTTP URL for Telegram to get a file from the Internet,
|
|
3191
3313
|
or pass `attach://<file_attach_name>` to upload a new one using multipart/form-data
|
|
@@ -3225,12 +3347,13 @@ class InputMediaAudio(InputMedia):
|
|
|
3225
3347
|
class InputMediaDocument(InputMedia):
|
|
3226
3348
|
"""Object `InputMediaDocument`, see the [documentation](https://core.telegram.org/bots/api#inputmediadocument)
|
|
3227
3349
|
|
|
3228
|
-
Represents a general file to be sent.
|
|
3350
|
+
Represents a general file to be sent.
|
|
3351
|
+
"""
|
|
3229
3352
|
|
|
3230
3353
|
type: typing.Literal["document"]
|
|
3231
3354
|
"""Type of the result, must be document."""
|
|
3232
3355
|
|
|
3233
|
-
media: str
|
|
3356
|
+
media: Variative["InputFile", str]
|
|
3234
3357
|
"""File to send. Pass a file_id to send a file that exists on the Telegram servers
|
|
3235
3358
|
(recommended), pass an HTTP URL for Telegram to get a file from the Internet,
|
|
3236
3359
|
or pass `attach://<file_attach_name>` to upload a new one using multipart/form-data
|
|
@@ -3270,7 +3393,7 @@ class InputFile(typing.NamedTuple):
|
|
|
3270
3393
|
"""
|
|
3271
3394
|
|
|
3272
3395
|
filename: str
|
|
3273
|
-
"""
|
|
3396
|
+
"""File name."""
|
|
3274
3397
|
|
|
3275
3398
|
data: bytes
|
|
3276
3399
|
"""Bytes of file."""
|
|
@@ -3279,7 +3402,8 @@ class InputFile(typing.NamedTuple):
|
|
|
3279
3402
|
class Sticker(Model):
|
|
3280
3403
|
"""Object `Sticker`, see the [documentation](https://core.telegram.org/bots/api#sticker)
|
|
3281
3404
|
|
|
3282
|
-
This object represents a sticker.
|
|
3405
|
+
This object represents a sticker.
|
|
3406
|
+
"""
|
|
3283
3407
|
|
|
3284
3408
|
file_id: str
|
|
3285
3409
|
"""Identifier for this file, which can be used to download or reuse the file."""
|
|
@@ -3335,7 +3459,8 @@ class Sticker(Model):
|
|
|
3335
3459
|
class StickerSet(Model):
|
|
3336
3460
|
"""Object `StickerSet`, see the [documentation](https://core.telegram.org/bots/api#stickerset)
|
|
3337
3461
|
|
|
3338
|
-
This object represents a sticker set.
|
|
3462
|
+
This object represents a sticker set.
|
|
3463
|
+
"""
|
|
3339
3464
|
|
|
3340
3465
|
name: str
|
|
3341
3466
|
"""Sticker set name."""
|
|
@@ -3386,7 +3511,8 @@ class MaskPosition(Model):
|
|
|
3386
3511
|
class InputSticker(Model):
|
|
3387
3512
|
"""Object `InputSticker`, see the [documentation](https://core.telegram.org/bots/api#inputsticker)
|
|
3388
3513
|
|
|
3389
|
-
This object describes a sticker to be added to a sticker set.
|
|
3514
|
+
This object describes a sticker to be added to a sticker set.
|
|
3515
|
+
"""
|
|
3390
3516
|
|
|
3391
3517
|
sticker: Variative["InputFile", str]
|
|
3392
3518
|
"""The added sticker. Pass a file_id as a String to send a file that already exists
|
|
@@ -3467,7 +3593,8 @@ class InlineQueryResultsButton(Model):
|
|
|
3467
3593
|
class InlineQueryResultArticle(InlineQueryResult):
|
|
3468
3594
|
"""Object `InlineQueryResultArticle`, see the [documentation](https://core.telegram.org/bots/api#inlinequeryresultarticle)
|
|
3469
3595
|
|
|
3470
|
-
Represents a link to an article or web page.
|
|
3596
|
+
Represents a link to an article or web page.
|
|
3597
|
+
"""
|
|
3471
3598
|
|
|
3472
3599
|
type: typing.Literal["article"]
|
|
3473
3600
|
"""Type of the result, must be article."""
|
|
@@ -3594,7 +3721,9 @@ class InlineQueryResultGif(InlineQueryResult):
|
|
|
3594
3721
|
gif_duration: Option[int] = Nothing
|
|
3595
3722
|
"""Optional. Duration of the GIF in seconds."""
|
|
3596
3723
|
|
|
3597
|
-
thumbnail_mime_type: Option[
|
|
3724
|
+
thumbnail_mime_type: Option[
|
|
3725
|
+
typing.Literal["image/jpeg", "image/gif", "video/mp4"]
|
|
3726
|
+
] = Nothing
|
|
3598
3727
|
"""Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
3599
3728
|
or `video/mp4`. Defaults to `image/jpeg`."""
|
|
3600
3729
|
|
|
@@ -3655,7 +3784,9 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|
|
3655
3784
|
mpeg4_duration: Option[int] = Nothing
|
|
3656
3785
|
"""Optional. Video duration in seconds."""
|
|
3657
3786
|
|
|
3658
|
-
thumbnail_mime_type: Option[
|
|
3787
|
+
thumbnail_mime_type: Option[
|
|
3788
|
+
typing.Literal["image/jpeg", "image/gif", "video/mp4"]
|
|
3789
|
+
] = Nothing
|
|
3659
3790
|
"""Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
3660
3791
|
or `video/mp4`. Defaults to `image/jpeg`."""
|
|
3661
3792
|
|
|
@@ -3869,7 +4000,7 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|
|
3869
4000
|
document_url: str
|
|
3870
4001
|
"""A valid URL for the file."""
|
|
3871
4002
|
|
|
3872
|
-
mime_type:
|
|
4003
|
+
mime_type: typing.Literal["application/pdf", "application/zip"]
|
|
3873
4004
|
"""MIME type of the content of the file, either `application/pdf` or `application/zip`."""
|
|
3874
4005
|
|
|
3875
4006
|
caption: Option[str] = Nothing
|
|
@@ -4086,7 +4217,8 @@ class InlineQueryResultContact(InlineQueryResult):
|
|
|
4086
4217
|
class InlineQueryResultGame(InlineQueryResult):
|
|
4087
4218
|
"""Object `InlineQueryResultGame`, see the [documentation](https://core.telegram.org/bots/api#inlinequeryresultgame)
|
|
4088
4219
|
|
|
4089
|
-
Represents a Game.
|
|
4220
|
+
Represents a Game.
|
|
4221
|
+
"""
|
|
4090
4222
|
|
|
4091
4223
|
type: typing.Literal["game"]
|
|
4092
4224
|
"""Type of the result, must be game."""
|
|
@@ -4663,7 +4795,8 @@ class ChosenInlineResult(Model):
|
|
|
4663
4795
|
class SentWebAppMessage(Model):
|
|
4664
4796
|
"""Object `SentWebAppMessage`, see the [documentation](https://core.telegram.org/bots/api#sentwebappmessage)
|
|
4665
4797
|
|
|
4666
|
-
Describes an inline message sent by a Web App on behalf of a user.
|
|
4798
|
+
Describes an inline message sent by a Web App on behalf of a user.
|
|
4799
|
+
"""
|
|
4667
4800
|
|
|
4668
4801
|
inline_message_id: Option[str] = Nothing
|
|
4669
4802
|
"""Optional. Identifier of the sent inline message. Available only if there
|
|
@@ -4673,7 +4806,8 @@ class SentWebAppMessage(Model):
|
|
|
4673
4806
|
class LabeledPrice(Model):
|
|
4674
4807
|
"""Object `LabeledPrice`, see the [documentation](https://core.telegram.org/bots/api#labeledprice)
|
|
4675
4808
|
|
|
4676
|
-
This object represents a portion of the price for goods or services.
|
|
4809
|
+
This object represents a portion of the price for goods or services.
|
|
4810
|
+
"""
|
|
4677
4811
|
|
|
4678
4812
|
label: str
|
|
4679
4813
|
"""Portion label."""
|
|
@@ -4688,7 +4822,8 @@ class LabeledPrice(Model):
|
|
|
4688
4822
|
class Invoice(Model):
|
|
4689
4823
|
"""Object `Invoice`, see the [documentation](https://core.telegram.org/bots/api#invoice)
|
|
4690
4824
|
|
|
4691
|
-
This object contains basic information about an invoice.
|
|
4825
|
+
This object contains basic information about an invoice.
|
|
4826
|
+
"""
|
|
4692
4827
|
|
|
4693
4828
|
title: str
|
|
4694
4829
|
"""Product name."""
|
|
@@ -4712,7 +4847,8 @@ class Invoice(Model):
|
|
|
4712
4847
|
class ShippingAddress(Model):
|
|
4713
4848
|
"""Object `ShippingAddress`, see the [documentation](https://core.telegram.org/bots/api#shippingaddress)
|
|
4714
4849
|
|
|
4715
|
-
This object represents a shipping address.
|
|
4850
|
+
This object represents a shipping address.
|
|
4851
|
+
"""
|
|
4716
4852
|
|
|
4717
4853
|
country_code: str
|
|
4718
4854
|
"""Two-letter ISO 3166-1 alpha-2 country code."""
|
|
@@ -4736,7 +4872,8 @@ class ShippingAddress(Model):
|
|
|
4736
4872
|
class OrderInfo(Model):
|
|
4737
4873
|
"""Object `OrderInfo`, see the [documentation](https://core.telegram.org/bots/api#orderinfo)
|
|
4738
4874
|
|
|
4739
|
-
This object represents information about an order.
|
|
4875
|
+
This object represents information about an order.
|
|
4876
|
+
"""
|
|
4740
4877
|
|
|
4741
4878
|
name: Option[str] = Nothing
|
|
4742
4879
|
"""Optional. User name."""
|
|
@@ -4754,7 +4891,8 @@ class OrderInfo(Model):
|
|
|
4754
4891
|
class ShippingOption(Model):
|
|
4755
4892
|
"""Object `ShippingOption`, see the [documentation](https://core.telegram.org/bots/api#shippingoption)
|
|
4756
4893
|
|
|
4757
|
-
This object represents one shipping option.
|
|
4894
|
+
This object represents one shipping option.
|
|
4895
|
+
"""
|
|
4758
4896
|
|
|
4759
4897
|
id: str
|
|
4760
4898
|
"""Shipping option identifier."""
|
|
@@ -4769,7 +4907,8 @@ class ShippingOption(Model):
|
|
|
4769
4907
|
class SuccessfulPayment(Model):
|
|
4770
4908
|
"""Object `SuccessfulPayment`, see the [documentation](https://core.telegram.org/bots/api#successfulpayment)
|
|
4771
4909
|
|
|
4772
|
-
This object contains basic information about a successful payment.
|
|
4910
|
+
This object contains basic information about a successful payment.
|
|
4911
|
+
"""
|
|
4773
4912
|
|
|
4774
4913
|
currency: str
|
|
4775
4914
|
"""Three-letter ISO 4217 currency code."""
|
|
@@ -4799,7 +4938,8 @@ class SuccessfulPayment(Model):
|
|
|
4799
4938
|
class ShippingQuery(Model):
|
|
4800
4939
|
"""Object `ShippingQuery`, see the [documentation](https://core.telegram.org/bots/api#shippingquery)
|
|
4801
4940
|
|
|
4802
|
-
This object contains information about an incoming shipping query.
|
|
4941
|
+
This object contains information about an incoming shipping query.
|
|
4942
|
+
"""
|
|
4803
4943
|
|
|
4804
4944
|
id: str
|
|
4805
4945
|
"""Unique query identifier."""
|
|
@@ -4817,7 +4957,8 @@ class ShippingQuery(Model):
|
|
|
4817
4957
|
class PreCheckoutQuery(Model):
|
|
4818
4958
|
"""Object `PreCheckoutQuery`, see the [documentation](https://core.telegram.org/bots/api#precheckoutquery)
|
|
4819
4959
|
|
|
4820
|
-
This object contains information about an incoming pre-checkout query.
|
|
4960
|
+
This object contains information about an incoming pre-checkout query.
|
|
4961
|
+
"""
|
|
4821
4962
|
|
|
4822
4963
|
id: str
|
|
4823
4964
|
"""Unique query identifier."""
|
|
@@ -4847,7 +4988,8 @@ class PreCheckoutQuery(Model):
|
|
|
4847
4988
|
class PassportData(Model):
|
|
4848
4989
|
"""Object `PassportData`, see the [documentation](https://core.telegram.org/bots/api#passportdata)
|
|
4849
4990
|
|
|
4850
|
-
Describes Telegram Passport data shared with the bot by the user.
|
|
4991
|
+
Describes Telegram Passport data shared with the bot by the user.
|
|
4992
|
+
"""
|
|
4851
4993
|
|
|
4852
4994
|
data: list["EncryptedPassportElement"]
|
|
4853
4995
|
"""Array with information about documents and other Telegram Passport elements
|
|
@@ -4873,7 +5015,7 @@ class PassportFile(Model):
|
|
|
4873
5015
|
file_size: int
|
|
4874
5016
|
"""File size in bytes."""
|
|
4875
5017
|
|
|
4876
|
-
file_date:
|
|
5018
|
+
file_date: datetime
|
|
4877
5019
|
"""Unix time when the file was uploaded."""
|
|
4878
5020
|
|
|
4879
5021
|
|
|
@@ -4894,43 +5036,43 @@ class EncryptedPassportElement(Model):
|
|
|
4894
5036
|
|
|
4895
5037
|
data: Option[str] = Nothing
|
|
4896
5038
|
"""Optional. Base64-encoded encrypted Telegram Passport element data provided
|
|
4897
|
-
by the user
|
|
5039
|
+
by the user; available only for `personal_details`, `passport`, `driver_license`,
|
|
4898
5040
|
`identity_card`, `internal_passport` and `address` types. Can be decrypted
|
|
4899
5041
|
and verified using the accompanying EncryptedCredentials."""
|
|
4900
5042
|
|
|
4901
5043
|
phone_number: Option[str] = Nothing
|
|
4902
|
-
"""Optional. User's verified phone number
|
|
5044
|
+
"""Optional. User's verified phone number; available only for `phone_number`
|
|
4903
5045
|
type."""
|
|
4904
5046
|
|
|
4905
5047
|
email: Option[str] = Nothing
|
|
4906
|
-
"""Optional. User's verified email address
|
|
5048
|
+
"""Optional. User's verified email address; available only for `email` type."""
|
|
4907
5049
|
|
|
4908
5050
|
files: Option[list["PassportFile"]] = Nothing
|
|
4909
|
-
"""Optional. Array of encrypted files with documents provided by the user
|
|
4910
|
-
available for `utility_bill`, `bank_statement`, `rental_agreement`,
|
|
5051
|
+
"""Optional. Array of encrypted files with documents provided by the user;
|
|
5052
|
+
available only for `utility_bill`, `bank_statement`, `rental_agreement`,
|
|
4911
5053
|
`passport_registration` and `temporary_registration` types. Files
|
|
4912
5054
|
can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
4913
5055
|
|
|
4914
5056
|
front_side: Option["PassportFile"] = Nothing
|
|
4915
5057
|
"""Optional. Encrypted file with the front side of the document, provided
|
|
4916
|
-
by the user
|
|
5058
|
+
by the user; available only for `passport`, `driver_license`, `identity_card`
|
|
4917
5059
|
and `internal_passport`. The file can be decrypted and verified using
|
|
4918
5060
|
the accompanying EncryptedCredentials."""
|
|
4919
5061
|
|
|
4920
5062
|
reverse_side: Option["PassportFile"] = Nothing
|
|
4921
5063
|
"""Optional. Encrypted file with the reverse side of the document, provided
|
|
4922
|
-
by the user
|
|
4923
|
-
file can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
5064
|
+
by the user; available only for `driver_license` and `identity_card`.
|
|
5065
|
+
The file can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
4924
5066
|
|
|
4925
5067
|
selfie: Option["PassportFile"] = Nothing
|
|
4926
5068
|
"""Optional. Encrypted file with the selfie of the user holding a document,
|
|
4927
|
-
provided by the user; available for `passport`, `driver_license`,
|
|
4928
|
-
and `internal_passport`. The file can be decrypted and
|
|
4929
|
-
the accompanying EncryptedCredentials."""
|
|
5069
|
+
provided by the user; available if requested for `passport`, `driver_license`,
|
|
5070
|
+
`identity_card` and `internal_passport`. The file can be decrypted and
|
|
5071
|
+
verified using the accompanying EncryptedCredentials."""
|
|
4930
5072
|
|
|
4931
5073
|
translation: Option[list["PassportFile"]] = Nothing
|
|
4932
5074
|
"""Optional. Array of encrypted files with translated versions of documents
|
|
4933
|
-
provided by the user
|
|
5075
|
+
provided by the user; available if requested for `passport`, `driver_license`,
|
|
4934
5076
|
`identity_card`, `internal_passport`, `utility_bill`, `bank_statement`,
|
|
4935
5077
|
`rental_agreement`, `passport_registration` and `temporary_registration`
|
|
4936
5078
|
types. Files can be decrypted and verified using the accompanying EncryptedCredentials."""
|
|
@@ -4965,7 +5107,11 @@ class PassportElementErrorDataField(PassportElementError):
|
|
|
4965
5107
|
"""Error source, must be data."""
|
|
4966
5108
|
|
|
4967
5109
|
type: typing.Literal[
|
|
4968
|
-
"passport",
|
|
5110
|
+
"passport",
|
|
5111
|
+
"driver_license",
|
|
5112
|
+
"identity_card",
|
|
5113
|
+
"internal_passport",
|
|
5114
|
+
"address",
|
|
4969
5115
|
]
|
|
4970
5116
|
"""The section of the user's Telegram Passport which has the error, one of `personal_details`,
|
|
4971
5117
|
`passport`, `driver_license`, `identity_card`, `internal_passport`,
|
|
@@ -4991,7 +5137,10 @@ class PassportElementErrorFrontSide(PassportElementError):
|
|
|
4991
5137
|
"""Error source, must be front_side."""
|
|
4992
5138
|
|
|
4993
5139
|
type: typing.Literal[
|
|
4994
|
-
"passport",
|
|
5140
|
+
"passport",
|
|
5141
|
+
"driver_license",
|
|
5142
|
+
"identity_card",
|
|
5143
|
+
"internal_passport",
|
|
4995
5144
|
]
|
|
4996
5145
|
"""The section of the user's Telegram Passport which has the issue, one of `passport`,
|
|
4997
5146
|
`driver_license`, `identity_card`, `internal_passport`."""
|
|
@@ -5033,7 +5182,10 @@ class PassportElementErrorSelfie(PassportElementError):
|
|
|
5033
5182
|
"""Error source, must be selfie."""
|
|
5034
5183
|
|
|
5035
5184
|
type: typing.Literal[
|
|
5036
|
-
"passport",
|
|
5185
|
+
"passport",
|
|
5186
|
+
"driver_license",
|
|
5187
|
+
"identity_card",
|
|
5188
|
+
"internal_passport",
|
|
5037
5189
|
]
|
|
5038
5190
|
"""The section of the user's Telegram Passport which has the issue, one of `passport`,
|
|
5039
5191
|
`driver_license`, `identity_card`, `internal_passport`."""
|
|
@@ -5215,13 +5367,15 @@ class Game(Model):
|
|
|
5215
5367
|
class CallbackGame(Model):
|
|
5216
5368
|
"""Object `CallbackGame`, see the [documentation](https://core.telegram.org/bots/api#callbackgame)
|
|
5217
5369
|
|
|
5218
|
-
A placeholder, currently holds no information. Use BotFather to set up your game.
|
|
5370
|
+
A placeholder, currently holds no information. Use BotFather to set up your game.
|
|
5371
|
+
"""
|
|
5219
5372
|
|
|
5220
5373
|
|
|
5221
5374
|
class GameHighScore(Model):
|
|
5222
5375
|
"""Object `GameHighScore`, see the [documentation](https://core.telegram.org/bots/api#gamehighscore)
|
|
5223
5376
|
|
|
5224
|
-
This object represents one row of the high scores table for a game.
|
|
5377
|
+
This object represents one row of the high scores table for a game.
|
|
5378
|
+
"""
|
|
5225
5379
|
|
|
5226
5380
|
position: int
|
|
5227
5381
|
"""Position in high score table for the game."""
|