telegrinder 0.1.dev166__py3-none-any.whl → 0.1.dev168__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 +0 -2
- telegrinder/bot/__init__.py +0 -2
- telegrinder/bot/bot.py +1 -3
- telegrinder/bot/cute_types/base.py +3 -12
- telegrinder/bot/cute_types/callback_query.py +2 -4
- telegrinder/bot/cute_types/chat_join_request.py +3 -1
- telegrinder/bot/cute_types/chat_member_updated.py +3 -1
- telegrinder/bot/cute_types/message.py +10 -31
- telegrinder/bot/cute_types/utils.py +1 -3
- telegrinder/bot/dispatch/__init__.py +1 -2
- telegrinder/bot/dispatch/composition.py +1 -3
- telegrinder/bot/dispatch/dispatch.py +5 -6
- telegrinder/bot/dispatch/handler/func.py +4 -11
- telegrinder/bot/dispatch/return_manager/abc.py +9 -13
- telegrinder/bot/dispatch/return_manager/message.py +5 -7
- telegrinder/bot/dispatch/view/abc.py +54 -5
- telegrinder/bot/dispatch/view/box.py +3 -11
- telegrinder/bot/dispatch/view/raw.py +2 -6
- telegrinder/bot/dispatch/waiter_machine/__init__.py +1 -2
- telegrinder/bot/dispatch/waiter_machine/machine.py +43 -88
- telegrinder/bot/dispatch/waiter_machine/middleware.py +12 -5
- telegrinder/bot/dispatch/waiter_machine/short_state.py +15 -5
- telegrinder/bot/polling/polling.py +2 -6
- telegrinder/bot/rules/adapter/event.py +1 -3
- telegrinder/bot/rules/callback_data.py +8 -8
- telegrinder/bot/rules/fuzzy.py +1 -2
- telegrinder/bot/rules/is_from.py +6 -4
- telegrinder/bot/rules/markup.py +1 -2
- telegrinder/bot/rules/mention.py +1 -4
- telegrinder/bot/rules/regex.py +1 -2
- telegrinder/bot/rules/rule_enum.py +1 -3
- telegrinder/bot/rules/start.py +1 -3
- telegrinder/bot/scenario/checkbox.py +6 -10
- telegrinder/bot/scenario/choice.py +4 -3
- telegrinder/client/aiohttp.py +1 -3
- telegrinder/model.py +4 -3
- telegrinder/modules.py +1 -3
- telegrinder/msgspec_utils.py +1 -3
- telegrinder/node/attachment.py +18 -14
- telegrinder/node/base.py +4 -11
- telegrinder/node/composer.py +1 -3
- telegrinder/node/message.py +3 -1
- telegrinder/node/source.py +3 -1
- telegrinder/node/text.py +3 -1
- telegrinder/tools/__init__.py +2 -0
- telegrinder/tools/buttons.py +4 -6
- telegrinder/tools/error_handler/abc.py +1 -3
- telegrinder/tools/error_handler/error.py +3 -6
- telegrinder/tools/error_handler/error_handler.py +17 -13
- telegrinder/tools/formatting/html.py +2 -6
- telegrinder/tools/formatting/links.py +1 -3
- telegrinder/tools/global_context/abc.py +1 -3
- telegrinder/tools/global_context/global_context.py +13 -31
- telegrinder/tools/i18n/middleware/base.py +1 -3
- telegrinder/tools/limited_dict.py +37 -0
- telegrinder/tools/loop_wrapper/loop_wrapper.py +3 -7
- telegrinder/types/__init__.py +30 -0
- telegrinder/types/methods.py +20 -89
- telegrinder/types/objects.py +16 -45
- telegrinder/verification_utils.py +2 -1
- {telegrinder-0.1.dev166.dist-info → telegrinder-0.1.dev168.dist-info}/METADATA +5 -5
- {telegrinder-0.1.dev166.dist-info → telegrinder-0.1.dev168.dist-info}/RECORD +64 -63
- {telegrinder-0.1.dev166.dist-info → telegrinder-0.1.dev168.dist-info}/LICENSE +0 -0
- {telegrinder-0.1.dev166.dist-info → telegrinder-0.1.dev168.dist-info}/WHEEL +0 -0
telegrinder/types/__init__.py
CHANGED
|
@@ -23,6 +23,7 @@ __all__ = (
|
|
|
23
23
|
"BotCommandScopeChatAdministrators",
|
|
24
24
|
"BotCommandScopeChatMember",
|
|
25
25
|
"BotCommandScopeDefault",
|
|
26
|
+
"BotCommandScopeType",
|
|
26
27
|
"BotDescription",
|
|
27
28
|
"BotName",
|
|
28
29
|
"BotShortDescription",
|
|
@@ -35,6 +36,7 @@ __all__ = (
|
|
|
35
36
|
"CallbackGame",
|
|
36
37
|
"CallbackQuery",
|
|
37
38
|
"Chat",
|
|
39
|
+
"ChatAction",
|
|
38
40
|
"ChatAdministratorRights",
|
|
39
41
|
"ChatBackground",
|
|
40
42
|
"ChatBoost",
|
|
@@ -44,6 +46,7 @@ __all__ = (
|
|
|
44
46
|
"ChatBoostSourceGiftCode",
|
|
45
47
|
"ChatBoostSourceGiveaway",
|
|
46
48
|
"ChatBoostSourcePremium",
|
|
49
|
+
"ChatBoostSourceType",
|
|
47
50
|
"ChatBoostUpdated",
|
|
48
51
|
"ChatFullInfo",
|
|
49
52
|
"ChatInviteLink",
|
|
@@ -56,16 +59,23 @@ __all__ = (
|
|
|
56
59
|
"ChatMemberMember",
|
|
57
60
|
"ChatMemberOwner",
|
|
58
61
|
"ChatMemberRestricted",
|
|
62
|
+
"ChatMemberStatus",
|
|
59
63
|
"ChatMemberUpdated",
|
|
60
64
|
"ChatPermissions",
|
|
61
65
|
"ChatPhoto",
|
|
62
66
|
"ChatShared",
|
|
67
|
+
"ChatType",
|
|
63
68
|
"ChosenInlineResult",
|
|
64
69
|
"Contact",
|
|
70
|
+
"ContentType",
|
|
71
|
+
"Currency",
|
|
72
|
+
"DefaultAccentColor",
|
|
65
73
|
"Dice",
|
|
74
|
+
"DiceEmoji",
|
|
66
75
|
"Document",
|
|
67
76
|
"EncryptedCredentials",
|
|
68
77
|
"EncryptedPassportElement",
|
|
78
|
+
"EncryptedPassportElementType",
|
|
69
79
|
"ExternalReplyInfo",
|
|
70
80
|
"File",
|
|
71
81
|
"ForceReply",
|
|
@@ -86,6 +96,7 @@ __all__ = (
|
|
|
86
96
|
"InlineKeyboardButton",
|
|
87
97
|
"InlineKeyboardMarkup",
|
|
88
98
|
"InlineQuery",
|
|
99
|
+
"InlineQueryChatType",
|
|
89
100
|
"InlineQueryResult",
|
|
90
101
|
"InlineQueryResultArticle",
|
|
91
102
|
"InlineQueryResultAudio",
|
|
@@ -99,13 +110,19 @@ __all__ = (
|
|
|
99
110
|
"InlineQueryResultCachedVoice",
|
|
100
111
|
"InlineQueryResultContact",
|
|
101
112
|
"InlineQueryResultDocument",
|
|
113
|
+
"InlineQueryResultDocumentMimeType",
|
|
102
114
|
"InlineQueryResultGame",
|
|
103
115
|
"InlineQueryResultGif",
|
|
116
|
+
"InlineQueryResultGifThumbnailMimeType",
|
|
104
117
|
"InlineQueryResultLocation",
|
|
118
|
+
"InlineQueryResultMimeType",
|
|
105
119
|
"InlineQueryResultMpeg4Gif",
|
|
120
|
+
"InlineQueryResultMpeg4GifThumbnailMimeType",
|
|
106
121
|
"InlineQueryResultPhoto",
|
|
122
|
+
"InlineQueryResultThumbnailMimeType",
|
|
107
123
|
"InlineQueryResultVenue",
|
|
108
124
|
"InlineQueryResultVideo",
|
|
125
|
+
"InlineQueryResultVideoMimeType",
|
|
109
126
|
"InlineQueryResultVoice",
|
|
110
127
|
"InlineQueryResultsButton",
|
|
111
128
|
"InputContactMessageContent",
|
|
@@ -133,6 +150,7 @@ __all__ = (
|
|
|
133
150
|
"Location",
|
|
134
151
|
"LoginUrl",
|
|
135
152
|
"MaskPosition",
|
|
153
|
+
"MaskPositionPoint",
|
|
136
154
|
"MaybeInaccessibleMessage",
|
|
137
155
|
"MenuButton",
|
|
138
156
|
"MenuButtonCommands",
|
|
@@ -141,11 +159,13 @@ __all__ = (
|
|
|
141
159
|
"Message",
|
|
142
160
|
"MessageAutoDeleteTimerChanged",
|
|
143
161
|
"MessageEntity",
|
|
162
|
+
"MessageEntityType",
|
|
144
163
|
"MessageId",
|
|
145
164
|
"MessageOrigin",
|
|
146
165
|
"MessageOriginChannel",
|
|
147
166
|
"MessageOriginChat",
|
|
148
167
|
"MessageOriginHiddenUser",
|
|
168
|
+
"MessageOriginType",
|
|
149
169
|
"MessageOriginUser",
|
|
150
170
|
"MessageReactionCountUpdated",
|
|
151
171
|
"MessageReactionUpdated",
|
|
@@ -161,18 +181,23 @@ __all__ = (
|
|
|
161
181
|
"PassportElementErrorSelfie",
|
|
162
182
|
"PassportElementErrorTranslationFile",
|
|
163
183
|
"PassportElementErrorTranslationFiles",
|
|
184
|
+
"PassportElementErrorType",
|
|
164
185
|
"PassportElementErrorUnspecified",
|
|
165
186
|
"PassportFile",
|
|
166
187
|
"PhotoSize",
|
|
167
188
|
"Poll",
|
|
168
189
|
"PollAnswer",
|
|
169
190
|
"PollOption",
|
|
191
|
+
"PollType",
|
|
170
192
|
"PreCheckoutQuery",
|
|
193
|
+
"ProgrammingLanguage",
|
|
171
194
|
"ProximityAlertTriggered",
|
|
172
195
|
"ReactionCount",
|
|
196
|
+
"ReactionEmoji",
|
|
173
197
|
"ReactionType",
|
|
174
198
|
"ReactionTypeCustomEmoji",
|
|
175
199
|
"ReactionTypeEmoji",
|
|
200
|
+
"ReactionTypeType",
|
|
176
201
|
"ReplyKeyboardMarkup",
|
|
177
202
|
"ReplyKeyboardRemove",
|
|
178
203
|
"ReplyParameters",
|
|
@@ -183,12 +208,17 @@ __all__ = (
|
|
|
183
208
|
"ShippingOption",
|
|
184
209
|
"ShippingQuery",
|
|
185
210
|
"Sticker",
|
|
211
|
+
"StickerFormat",
|
|
186
212
|
"StickerSet",
|
|
213
|
+
"StickerSetStickerType",
|
|
214
|
+
"StickerType",
|
|
187
215
|
"Story",
|
|
188
216
|
"SuccessfulPayment",
|
|
189
217
|
"SwitchInlineQueryChosenChat",
|
|
190
218
|
"TextQuote",
|
|
219
|
+
"TopicIconColor",
|
|
191
220
|
"Update",
|
|
221
|
+
"UpdateType",
|
|
192
222
|
"User",
|
|
193
223
|
"UserChatBoosts",
|
|
194
224
|
"UserProfilePhotos",
|
telegrinder/types/methods.py
CHANGED
|
@@ -139,9 +139,7 @@ class APIMethods:
|
|
|
139
139
|
)
|
|
140
140
|
return full_result(method_response, bool)
|
|
141
141
|
|
|
142
|
-
async def get_webhook_info(
|
|
143
|
-
self, **other: typing.Any
|
|
144
|
-
) -> Result[WebhookInfo, APIError]:
|
|
142
|
+
async def get_webhook_info(self, **other: typing.Any) -> Result[WebhookInfo, APIError]:
|
|
145
143
|
"""Method `getWebhookInfo`, see the [documentation](https://core.telegram.org/bots/api#getwebhookinfo)
|
|
146
144
|
|
|
147
145
|
Use this method to get current webhook status. Requires no parameters.
|
|
@@ -215,11 +213,7 @@ class APIMethods:
|
|
|
215
213
|
protect_content: bool | None = None,
|
|
216
214
|
reply_parameters: ReplyParameters | None = None,
|
|
217
215
|
reply_markup: (
|
|
218
|
-
InlineKeyboardMarkup
|
|
219
|
-
| ReplyKeyboardMarkup
|
|
220
|
-
| ReplyKeyboardRemove
|
|
221
|
-
| ForceReply
|
|
222
|
-
| None
|
|
216
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
223
217
|
) = None,
|
|
224
218
|
**other: typing.Any,
|
|
225
219
|
) -> Result[Message, APIError]:
|
|
@@ -357,11 +351,7 @@ class APIMethods:
|
|
|
357
351
|
protect_content: bool | None = None,
|
|
358
352
|
reply_parameters: ReplyParameters | None = None,
|
|
359
353
|
reply_markup: (
|
|
360
|
-
InlineKeyboardMarkup
|
|
361
|
-
| ReplyKeyboardMarkup
|
|
362
|
-
| ReplyKeyboardRemove
|
|
363
|
-
| ForceReply
|
|
364
|
-
| None
|
|
354
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
365
355
|
) = None,
|
|
366
356
|
**other: typing.Any,
|
|
367
357
|
) -> Result[MessageId, APIError]:
|
|
@@ -473,11 +463,7 @@ class APIMethods:
|
|
|
473
463
|
protect_content: bool | None = None,
|
|
474
464
|
reply_parameters: ReplyParameters | None = None,
|
|
475
465
|
reply_markup: (
|
|
476
|
-
InlineKeyboardMarkup
|
|
477
|
-
| ReplyKeyboardMarkup
|
|
478
|
-
| ReplyKeyboardRemove
|
|
479
|
-
| ForceReply
|
|
480
|
-
| None
|
|
466
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
481
467
|
) = None,
|
|
482
468
|
**other: typing.Any,
|
|
483
469
|
) -> Result[Message, APIError]:
|
|
@@ -546,11 +532,7 @@ class APIMethods:
|
|
|
546
532
|
protect_content: bool | None = None,
|
|
547
533
|
reply_parameters: ReplyParameters | None = None,
|
|
548
534
|
reply_markup: (
|
|
549
|
-
InlineKeyboardMarkup
|
|
550
|
-
| ReplyKeyboardMarkup
|
|
551
|
-
| ReplyKeyboardRemove
|
|
552
|
-
| ForceReply
|
|
553
|
-
| None
|
|
535
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
554
536
|
) = None,
|
|
555
537
|
**other: typing.Any,
|
|
556
538
|
) -> Result[Message, APIError]:
|
|
@@ -630,11 +612,7 @@ class APIMethods:
|
|
|
630
612
|
protect_content: bool | None = None,
|
|
631
613
|
reply_parameters: ReplyParameters | None = None,
|
|
632
614
|
reply_markup: (
|
|
633
|
-
InlineKeyboardMarkup
|
|
634
|
-
| ReplyKeyboardMarkup
|
|
635
|
-
| ReplyKeyboardRemove
|
|
636
|
-
| ForceReply
|
|
637
|
-
| None
|
|
615
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
638
616
|
) = None,
|
|
639
617
|
**other: typing.Any,
|
|
640
618
|
) -> Result[Message, APIError]:
|
|
@@ -714,11 +692,7 @@ class APIMethods:
|
|
|
714
692
|
protect_content: bool | None = None,
|
|
715
693
|
reply_parameters: ReplyParameters | None = None,
|
|
716
694
|
reply_markup: (
|
|
717
|
-
InlineKeyboardMarkup
|
|
718
|
-
| ReplyKeyboardMarkup
|
|
719
|
-
| ReplyKeyboardRemove
|
|
720
|
-
| ForceReply
|
|
721
|
-
| None
|
|
695
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
722
696
|
) = None,
|
|
723
697
|
**other: typing.Any,
|
|
724
698
|
) -> Result[Message, APIError]:
|
|
@@ -805,11 +779,7 @@ class APIMethods:
|
|
|
805
779
|
protect_content: bool | None = None,
|
|
806
780
|
reply_parameters: ReplyParameters | None = None,
|
|
807
781
|
reply_markup: (
|
|
808
|
-
InlineKeyboardMarkup
|
|
809
|
-
| ReplyKeyboardMarkup
|
|
810
|
-
| ReplyKeyboardRemove
|
|
811
|
-
| ForceReply
|
|
812
|
-
| None
|
|
782
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
813
783
|
) = None,
|
|
814
784
|
**other: typing.Any,
|
|
815
785
|
) -> Result[Message, APIError]:
|
|
@@ -889,11 +859,7 @@ class APIMethods:
|
|
|
889
859
|
protect_content: bool | None = None,
|
|
890
860
|
reply_parameters: ReplyParameters | None = None,
|
|
891
861
|
reply_markup: (
|
|
892
|
-
InlineKeyboardMarkup
|
|
893
|
-
| ReplyKeyboardMarkup
|
|
894
|
-
| ReplyKeyboardRemove
|
|
895
|
-
| ForceReply
|
|
896
|
-
| None
|
|
862
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
897
863
|
) = None,
|
|
898
864
|
**other: typing.Any,
|
|
899
865
|
) -> Result[Message, APIError]:
|
|
@@ -960,11 +926,7 @@ class APIMethods:
|
|
|
960
926
|
protect_content: bool | None = None,
|
|
961
927
|
reply_parameters: ReplyParameters | None = None,
|
|
962
928
|
reply_markup: (
|
|
963
|
-
InlineKeyboardMarkup
|
|
964
|
-
| ReplyKeyboardMarkup
|
|
965
|
-
| ReplyKeyboardRemove
|
|
966
|
-
| ForceReply
|
|
967
|
-
| None
|
|
929
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
968
930
|
) = None,
|
|
969
931
|
**other: typing.Any,
|
|
970
932
|
) -> Result[Message, APIError]:
|
|
@@ -1020,9 +982,7 @@ class APIMethods:
|
|
|
1020
982
|
async def send_media_group(
|
|
1021
983
|
self,
|
|
1022
984
|
chat_id: int | str,
|
|
1023
|
-
media: list[
|
|
1024
|
-
InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo
|
|
1025
|
-
],
|
|
985
|
+
media: list[InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo],
|
|
1026
986
|
business_connection_id: str | None = None,
|
|
1027
987
|
message_thread_id: int | None = None,
|
|
1028
988
|
disable_notification: bool | None = None,
|
|
@@ -1076,11 +1036,7 @@ class APIMethods:
|
|
|
1076
1036
|
protect_content: bool | None = None,
|
|
1077
1037
|
reply_parameters: ReplyParameters | None = None,
|
|
1078
1038
|
reply_markup: (
|
|
1079
|
-
InlineKeyboardMarkup
|
|
1080
|
-
| ReplyKeyboardMarkup
|
|
1081
|
-
| ReplyKeyboardRemove
|
|
1082
|
-
| ForceReply
|
|
1083
|
-
| None
|
|
1039
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
1084
1040
|
) = None,
|
|
1085
1041
|
**other: typing.Any,
|
|
1086
1042
|
) -> Result[Message, APIError]:
|
|
@@ -1147,11 +1103,7 @@ class APIMethods:
|
|
|
1147
1103
|
protect_content: bool | None = None,
|
|
1148
1104
|
reply_parameters: ReplyParameters | None = None,
|
|
1149
1105
|
reply_markup: (
|
|
1150
|
-
InlineKeyboardMarkup
|
|
1151
|
-
| ReplyKeyboardMarkup
|
|
1152
|
-
| ReplyKeyboardRemove
|
|
1153
|
-
| ForceReply
|
|
1154
|
-
| None
|
|
1106
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
1155
1107
|
) = None,
|
|
1156
1108
|
**other: typing.Any,
|
|
1157
1109
|
) -> Result[Message, APIError]:
|
|
@@ -1216,11 +1168,7 @@ class APIMethods:
|
|
|
1216
1168
|
protect_content: bool | None = None,
|
|
1217
1169
|
reply_parameters: ReplyParameters | None = None,
|
|
1218
1170
|
reply_markup: (
|
|
1219
|
-
InlineKeyboardMarkup
|
|
1220
|
-
| ReplyKeyboardMarkup
|
|
1221
|
-
| ReplyKeyboardRemove
|
|
1222
|
-
| ForceReply
|
|
1223
|
-
| None
|
|
1171
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
1224
1172
|
) = None,
|
|
1225
1173
|
**other: typing.Any,
|
|
1226
1174
|
) -> Result[Message, APIError]:
|
|
@@ -1285,11 +1233,7 @@ class APIMethods:
|
|
|
1285
1233
|
protect_content: bool | None = None,
|
|
1286
1234
|
reply_parameters: ReplyParameters | None = None,
|
|
1287
1235
|
reply_markup: (
|
|
1288
|
-
InlineKeyboardMarkup
|
|
1289
|
-
| ReplyKeyboardMarkup
|
|
1290
|
-
| ReplyKeyboardRemove
|
|
1291
|
-
| ForceReply
|
|
1292
|
-
| None
|
|
1236
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
1293
1237
|
) = None,
|
|
1294
1238
|
**other: typing.Any,
|
|
1295
1239
|
) -> Result[Message, APIError]:
|
|
@@ -1373,11 +1317,7 @@ class APIMethods:
|
|
|
1373
1317
|
protect_content: bool | None = None,
|
|
1374
1318
|
reply_parameters: ReplyParameters | None = None,
|
|
1375
1319
|
reply_markup: (
|
|
1376
|
-
InlineKeyboardMarkup
|
|
1377
|
-
| ReplyKeyboardMarkup
|
|
1378
|
-
| ReplyKeyboardRemove
|
|
1379
|
-
| ForceReply
|
|
1380
|
-
| None
|
|
1320
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
1381
1321
|
) = None,
|
|
1382
1322
|
**other: typing.Any,
|
|
1383
1323
|
) -> Result[Message, APIError]:
|
|
@@ -2379,9 +2319,7 @@ class APIMethods:
|
|
|
2379
2319
|
)
|
|
2380
2320
|
return full_result(method_response, bool)
|
|
2381
2321
|
|
|
2382
|
-
async def get_forum_topic_icon_stickers(
|
|
2383
|
-
self, **other: typing.Any
|
|
2384
|
-
) -> Result[list[Sticker], APIError]:
|
|
2322
|
+
async def get_forum_topic_icon_stickers(self, **other: typing.Any) -> Result[list[Sticker], APIError]:
|
|
2385
2323
|
"""Method `getForumTopicIconStickers`, see the [documentation](https://core.telegram.org/bots/api#getforumtopiciconstickers)
|
|
2386
2324
|
|
|
2387
2325
|
Use this method to get custom emoji stickers, which can be used as a forum
|
|
@@ -3011,9 +2949,7 @@ class APIMethods:
|
|
|
3011
2949
|
self,
|
|
3012
2950
|
chat_id: int | None = None,
|
|
3013
2951
|
**other: typing.Any,
|
|
3014
|
-
) -> Result[
|
|
3015
|
-
Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault], APIError
|
|
3016
|
-
]:
|
|
2952
|
+
) -> Result[Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault], APIError]:
|
|
3017
2953
|
"""Method `getChatMenuButton`, see the [documentation](https://core.telegram.org/bots/api#getchatmenubutton)
|
|
3018
2954
|
|
|
3019
2955
|
Use this method to get the current value of the bot's menu button in a private
|
|
@@ -3028,8 +2964,7 @@ class APIMethods:
|
|
|
3028
2964
|
get_params(locals()),
|
|
3029
2965
|
)
|
|
3030
2966
|
return full_result(
|
|
3031
|
-
method_response,
|
|
3032
|
-
Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault],
|
|
2967
|
+
method_response, Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault]
|
|
3033
2968
|
)
|
|
3034
2969
|
|
|
3035
2970
|
async def set_my_default_administrator_rights(
|
|
@@ -3424,11 +3359,7 @@ class APIMethods:
|
|
|
3424
3359
|
protect_content: bool | None = None,
|
|
3425
3360
|
reply_parameters: ReplyParameters | None = None,
|
|
3426
3361
|
reply_markup: (
|
|
3427
|
-
InlineKeyboardMarkup
|
|
3428
|
-
| ReplyKeyboardMarkup
|
|
3429
|
-
| ReplyKeyboardRemove
|
|
3430
|
-
| ForceReply
|
|
3431
|
-
| None
|
|
3362
|
+
InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
|
|
3432
3363
|
) = None,
|
|
3433
3364
|
**other: typing.Any,
|
|
3434
3365
|
) -> Result[Message, APIError]:
|
telegrinder/types/objects.py
CHANGED
|
@@ -210,7 +210,7 @@ class Update(Model):
|
|
|
210
210
|
or a user edited an existing connection with the bot."""
|
|
211
211
|
|
|
212
212
|
business_message: Option["Message"] = Nothing
|
|
213
|
-
"""Optional. New
|
|
213
|
+
"""Optional. New message from a connected business account."""
|
|
214
214
|
|
|
215
215
|
edited_business_message: Option["Message"] = Nothing
|
|
216
216
|
"""Optional. New version of a message from a connected business account."""
|
|
@@ -492,9 +492,7 @@ class ChatFullInfo(Model):
|
|
|
492
492
|
personal_chat: Option["Chat"] = Nothing
|
|
493
493
|
"""Optional. For private chats, the personal channel of the user."""
|
|
494
494
|
|
|
495
|
-
available_reactions: Option[
|
|
496
|
-
list[Variative["ReactionTypeEmoji", "ReactionTypeCustomEmoji"]]
|
|
497
|
-
] = Nothing
|
|
495
|
+
available_reactions: Option[list[Variative["ReactionTypeEmoji", "ReactionTypeCustomEmoji"]]] = Nothing
|
|
498
496
|
"""Optional. List of available reactions allowed in the chat. If omitted,
|
|
499
497
|
then all emoji reactions are allowed."""
|
|
500
498
|
|
|
@@ -534,8 +532,8 @@ class ChatFullInfo(Model):
|
|
|
534
532
|
messages."""
|
|
535
533
|
|
|
536
534
|
join_by_request: Option[bool] = Nothing
|
|
537
|
-
"""Optional. True, if all users directly joining the supergroup
|
|
538
|
-
approved by supergroup administrators."""
|
|
535
|
+
"""Optional. True, if all users directly joining the supergroup without using
|
|
536
|
+
an invite link need to be approved by supergroup administrators."""
|
|
539
537
|
|
|
540
538
|
description: Option[str] = Nothing
|
|
541
539
|
"""Optional. Description, for groups, supergroups and channel chats."""
|
|
@@ -647,12 +645,7 @@ class Message(MaybeInaccessibleMessage):
|
|
|
647
645
|
bot chat which might share the same identifier."""
|
|
648
646
|
|
|
649
647
|
forward_origin: Option[
|
|
650
|
-
Variative[
|
|
651
|
-
"MessageOriginUser",
|
|
652
|
-
"MessageOriginHiddenUser",
|
|
653
|
-
"MessageOriginChat",
|
|
654
|
-
"MessageOriginChannel",
|
|
655
|
-
]
|
|
648
|
+
Variative["MessageOriginUser", "MessageOriginHiddenUser", "MessageOriginChat", "MessageOriginChannel"]
|
|
656
649
|
] = Nothing
|
|
657
650
|
"""Optional. Information about the original message for forwarded messages."""
|
|
658
651
|
|
|
@@ -941,9 +934,7 @@ class Message(MaybeInaccessibleMessage):
|
|
|
941
934
|
Full name, for `private` chat."""
|
|
942
935
|
|
|
943
936
|
return (
|
|
944
|
-
self.chat.full_name.unwrap()
|
|
945
|
-
if self.chat.type == ChatType.PRIVATE
|
|
946
|
-
else self.chat.title.unwrap()
|
|
937
|
+
self.chat.full_name.unwrap() if self.chat.type == ChatType.PRIVATE else self.chat.title.unwrap()
|
|
947
938
|
)
|
|
948
939
|
|
|
949
940
|
def __eq__(self, other: typing.Any) -> bool:
|
|
@@ -1049,10 +1040,7 @@ class ExternalReplyInfo(Model):
|
|
|
1049
1040
|
"""
|
|
1050
1041
|
|
|
1051
1042
|
origin: Variative[
|
|
1052
|
-
"MessageOriginUser",
|
|
1053
|
-
"MessageOriginHiddenUser",
|
|
1054
|
-
"MessageOriginChat",
|
|
1055
|
-
"MessageOriginChannel",
|
|
1043
|
+
"MessageOriginUser", "MessageOriginHiddenUser", "MessageOriginChat", "MessageOriginChannel"
|
|
1056
1044
|
]
|
|
1057
1045
|
"""Origin of the message replied to by the given message."""
|
|
1058
1046
|
|
|
@@ -1785,9 +1773,7 @@ class BackgroundTypeFill(BackgroundType):
|
|
|
1785
1773
|
type: typing.Literal["fill"]
|
|
1786
1774
|
"""Type of the background, always `fill`."""
|
|
1787
1775
|
|
|
1788
|
-
fill: Variative[
|
|
1789
|
-
"BackgroundFillSolid", "BackgroundFillGradient", "BackgroundFillFreeformGradient"
|
|
1790
|
-
]
|
|
1776
|
+
fill: Variative["BackgroundFillSolid", "BackgroundFillGradient", "BackgroundFillFreeformGradient"]
|
|
1791
1777
|
"""The background fill."""
|
|
1792
1778
|
|
|
1793
1779
|
dark_theme_dimming: int
|
|
@@ -1829,9 +1815,7 @@ class BackgroundTypePattern(BackgroundType):
|
|
|
1829
1815
|
document: "Document"
|
|
1830
1816
|
"""Document with the pattern."""
|
|
1831
1817
|
|
|
1832
|
-
fill: Variative[
|
|
1833
|
-
"BackgroundFillSolid", "BackgroundFillGradient", "BackgroundFillFreeformGradient"
|
|
1834
|
-
]
|
|
1818
|
+
fill: Variative["BackgroundFillSolid", "BackgroundFillGradient", "BackgroundFillFreeformGradient"]
|
|
1835
1819
|
"""The background fill that is combined with the pattern."""
|
|
1836
1820
|
|
|
1837
1821
|
intensity: int
|
|
@@ -1865,10 +1849,7 @@ class ChatBackground(Model):
|
|
|
1865
1849
|
"""
|
|
1866
1850
|
|
|
1867
1851
|
type: Variative[
|
|
1868
|
-
"BackgroundTypeFill",
|
|
1869
|
-
"BackgroundTypeWallpaper",
|
|
1870
|
-
"BackgroundTypePattern",
|
|
1871
|
-
"BackgroundTypeChatTheme",
|
|
1852
|
+
"BackgroundTypeFill", "BackgroundTypeWallpaper", "BackgroundTypePattern", "BackgroundTypeChatTheme"
|
|
1872
1853
|
]
|
|
1873
1854
|
"""Type of the background."""
|
|
1874
1855
|
|
|
@@ -2781,7 +2762,7 @@ class ChatMemberUpdated(Model):
|
|
|
2781
2762
|
|
|
2782
2763
|
via_join_request: Option[bool] = Nothing
|
|
2783
2764
|
"""Optional. True, if the user joined the chat after sending a direct join request
|
|
2784
|
-
and being approved by an administrator."""
|
|
2765
|
+
without using an invite link and being approved by an administrator."""
|
|
2785
2766
|
|
|
2786
2767
|
via_chat_folder_invite_link: Option[bool] = Nothing
|
|
2787
2768
|
"""Optional. True, if the user joined the chat via a chat folder invite link."""
|
|
@@ -3111,9 +3092,7 @@ class Birthdate(Model):
|
|
|
3111
3092
|
"""Optional. Contains the user's age, if the user has a birth year specified."""
|
|
3112
3093
|
|
|
3113
3094
|
return self.year.map(
|
|
3114
|
-
lambda year: (
|
|
3115
|
-
(datetime.now() - datetime(year, self.month, self.day)) // 365
|
|
3116
|
-
).days
|
|
3095
|
+
lambda year: ((datetime.now() - datetime(year, self.month, self.day)) // 365).days
|
|
3117
3096
|
)
|
|
3118
3097
|
|
|
3119
3098
|
|
|
@@ -3528,9 +3507,7 @@ class ChatBoost(Model):
|
|
|
3528
3507
|
"""Point in time (Unix timestamp) when the boost will automatically expire,
|
|
3529
3508
|
unless the booster's Telegram Premium subscription is prolonged."""
|
|
3530
3509
|
|
|
3531
|
-
source: Variative[
|
|
3532
|
-
"ChatBoostSourcePremium", "ChatBoostSourceGiftCode", "ChatBoostSourceGiveaway"
|
|
3533
|
-
]
|
|
3510
|
+
source: Variative["ChatBoostSourcePremium", "ChatBoostSourceGiftCode", "ChatBoostSourceGiveaway"]
|
|
3534
3511
|
"""Source of the added boost."""
|
|
3535
3512
|
|
|
3536
3513
|
|
|
@@ -3562,9 +3539,7 @@ class ChatBoostRemoved(Model):
|
|
|
3562
3539
|
remove_date: datetime
|
|
3563
3540
|
"""Point in time (Unix timestamp) when the boost was removed."""
|
|
3564
3541
|
|
|
3565
|
-
source: Variative[
|
|
3566
|
-
"ChatBoostSourcePremium", "ChatBoostSourceGiftCode", "ChatBoostSourceGiveaway"
|
|
3567
|
-
]
|
|
3542
|
+
source: Variative["ChatBoostSourcePremium", "ChatBoostSourceGiftCode", "ChatBoostSourceGiveaway"]
|
|
3568
3543
|
"""Source of the removed boost."""
|
|
3569
3544
|
|
|
3570
3545
|
|
|
@@ -4196,9 +4171,7 @@ class InlineQueryResultGif(InlineQueryResult):
|
|
|
4196
4171
|
gif_duration: Option[int] = Nothing
|
|
4197
4172
|
"""Optional. Duration of the GIF in seconds."""
|
|
4198
4173
|
|
|
4199
|
-
thumbnail_mime_type: Option[
|
|
4200
|
-
typing.Literal["image/jpeg", "image/gif", "video/mp4"]
|
|
4201
|
-
] = Nothing
|
|
4174
|
+
thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = Nothing
|
|
4202
4175
|
"""Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
4203
4176
|
or `video/mp4`. Defaults to `image/jpeg`."""
|
|
4204
4177
|
|
|
@@ -4259,9 +4232,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|
|
4259
4232
|
mpeg4_duration: Option[int] = Nothing
|
|
4260
4233
|
"""Optional. Video duration in seconds."""
|
|
4261
4234
|
|
|
4262
|
-
thumbnail_mime_type: Option[
|
|
4263
|
-
typing.Literal["image/jpeg", "image/gif", "video/mp4"]
|
|
4264
|
-
] = Nothing
|
|
4235
|
+
thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = Nothing
|
|
4265
4236
|
"""Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
4266
4237
|
or `video/mp4`. Defaults to `image/jpeg`."""
|
|
4267
4238
|
|
|
@@ -6,7 +6,8 @@ from telegrinder.api.abc import Token
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
def verify_webapp_request(
|
|
9
|
-
secret_token: str,
|
|
9
|
+
secret_token: str,
|
|
10
|
+
request_headers: typing.Mapping[str, typing.Any],
|
|
10
11
|
) -> bool:
|
|
11
12
|
"""Verifies update request is from telegram."""
|
|
12
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: telegrinder
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.dev168
|
|
4
4
|
Summary: Framework for effective and reliable async telegram bot building.
|
|
5
5
|
Home-page: https://github.com/timoniq/telegrinder
|
|
6
6
|
License: MIT
|
|
@@ -49,23 +49,23 @@ Still in development.
|
|
|
49
49
|
|
|
50
50
|
Install using pip:
|
|
51
51
|
|
|
52
|
-
```
|
|
52
|
+
```console
|
|
53
53
|
pip install telegrinder
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Using poetry:
|
|
57
57
|
|
|
58
|
-
```
|
|
58
|
+
```console
|
|
59
59
|
poetry add telegrinder
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
Install from github:
|
|
63
63
|
|
|
64
|
-
```
|
|
64
|
+
```console
|
|
65
65
|
pip install -U https://github.com/timoniq/telegrinder/archive/dev.zip
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
```
|
|
68
|
+
```console
|
|
69
69
|
poetry add git+https://github.com/timoniq/telegrinder.git#dev
|
|
70
70
|
```
|
|
71
71
|
|