telegrinder 0.1.dev167__py3-none-any.whl → 0.1.dev169__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 +9 -3
- telegrinder/bot/__init__.py +7 -5
- telegrinder/bot/cute_types/base.py +12 -14
- telegrinder/bot/cute_types/callback_query.py +55 -44
- telegrinder/bot/cute_types/chat_join_request.py +8 -7
- telegrinder/bot/cute_types/chat_member_updated.py +23 -17
- telegrinder/bot/cute_types/inline_query.py +1 -1
- telegrinder/bot/cute_types/message.py +331 -183
- telegrinder/bot/cute_types/update.py +4 -8
- telegrinder/bot/cute_types/utils.py +1 -5
- telegrinder/bot/dispatch/__init__.py +2 -3
- telegrinder/bot/dispatch/abc.py +4 -0
- telegrinder/bot/dispatch/context.py +9 -4
- telegrinder/bot/dispatch/dispatch.py +33 -30
- telegrinder/bot/dispatch/handler/func.py +33 -12
- telegrinder/bot/dispatch/handler/message_reply.py +6 -3
- telegrinder/bot/dispatch/middleware/abc.py +4 -4
- telegrinder/bot/dispatch/process.py +40 -13
- telegrinder/bot/dispatch/return_manager/abc.py +12 -12
- telegrinder/bot/dispatch/return_manager/callback_query.py +1 -3
- telegrinder/bot/dispatch/return_manager/inline_query.py +1 -3
- telegrinder/bot/dispatch/view/abc.py +74 -31
- telegrinder/bot/dispatch/view/box.py +66 -50
- telegrinder/bot/dispatch/view/message.py +1 -5
- telegrinder/bot/dispatch/view/raw.py +6 -6
- telegrinder/bot/dispatch/waiter_machine/__init__.py +2 -1
- telegrinder/bot/dispatch/waiter_machine/machine.py +86 -50
- telegrinder/bot/dispatch/waiter_machine/middleware.py +31 -7
- telegrinder/bot/dispatch/waiter_machine/short_state.py +26 -7
- telegrinder/bot/polling/polling.py +4 -4
- telegrinder/bot/rules/__init__.py +9 -6
- telegrinder/bot/rules/abc.py +99 -22
- telegrinder/bot/rules/adapter/__init__.py +4 -1
- telegrinder/bot/rules/adapter/abc.py +11 -6
- telegrinder/bot/rules/adapter/errors.py +1 -2
- telegrinder/bot/rules/adapter/event.py +14 -9
- telegrinder/bot/rules/adapter/node.py +42 -0
- telegrinder/bot/rules/callback_data.py +13 -15
- telegrinder/bot/rules/chat_join.py +3 -2
- telegrinder/bot/rules/command.py +26 -14
- telegrinder/bot/rules/enum_text.py +5 -5
- telegrinder/bot/rules/func.py +6 -6
- telegrinder/bot/rules/fuzzy.py +5 -7
- telegrinder/bot/rules/inline.py +4 -5
- telegrinder/bot/rules/integer.py +10 -8
- telegrinder/bot/rules/is_from.py +63 -91
- telegrinder/bot/rules/markup.py +5 -5
- telegrinder/bot/rules/mention.py +4 -4
- telegrinder/bot/rules/message.py +1 -1
- telegrinder/bot/rules/node.py +27 -0
- telegrinder/bot/rules/regex.py +5 -5
- telegrinder/bot/rules/rule_enum.py +4 -4
- telegrinder/bot/rules/start.py +5 -5
- telegrinder/bot/rules/text.py +9 -13
- telegrinder/bot/rules/update.py +4 -4
- telegrinder/bot/scenario/__init__.py +3 -3
- telegrinder/bot/scenario/checkbox.py +5 -5
- telegrinder/bot/scenario/choice.py +5 -5
- telegrinder/model.py +49 -15
- telegrinder/modules.py +14 -6
- telegrinder/msgspec_utils.py +8 -17
- telegrinder/node/__init__.py +26 -8
- telegrinder/node/attachment.py +13 -9
- telegrinder/node/base.py +27 -14
- telegrinder/node/callback_query.py +18 -0
- telegrinder/node/command.py +29 -0
- telegrinder/node/composer.py +119 -30
- telegrinder/node/me.py +14 -0
- telegrinder/node/message.py +2 -4
- telegrinder/node/polymorphic.py +44 -0
- telegrinder/node/rule.py +26 -22
- telegrinder/node/scope.py +36 -0
- telegrinder/node/source.py +37 -10
- telegrinder/node/text.py +11 -5
- telegrinder/node/tools/__init__.py +2 -2
- telegrinder/node/tools/generator.py +6 -6
- telegrinder/tools/__init__.py +9 -14
- telegrinder/tools/buttons.py +23 -17
- telegrinder/tools/error_handler/error_handler.py +11 -14
- telegrinder/tools/formatting/__init__.py +0 -6
- telegrinder/tools/formatting/html.py +10 -12
- telegrinder/tools/formatting/links.py +0 -5
- telegrinder/tools/formatting/spec_html_formats.py +0 -11
- telegrinder/tools/global_context/abc.py +1 -3
- telegrinder/tools/global_context/global_context.py +6 -16
- telegrinder/tools/i18n/simple.py +1 -3
- telegrinder/tools/kb_set/yaml.py +1 -2
- telegrinder/tools/keyboard.py +7 -8
- telegrinder/tools/limited_dict.py +13 -3
- telegrinder/tools/loop_wrapper/loop_wrapper.py +6 -5
- telegrinder/tools/magic.py +27 -5
- telegrinder/types/__init__.py +20 -0
- telegrinder/types/enums.py +37 -31
- telegrinder/types/methods.py +613 -401
- telegrinder/types/objects.py +1151 -757
- {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/LICENSE +1 -1
- {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/METADATA +9 -8
- telegrinder-0.1.dev169.dist-info/RECORD +143 -0
- telegrinder/bot/dispatch/composition.py +0 -88
- telegrinder-0.1.dev167.dist-info/RECORD +0 -137
- {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/WHEEL +0 -0
telegrinder/types/enums.py
CHANGED
|
@@ -351,6 +351,7 @@ class Currency(str, enum.Enum):
|
|
|
351
351
|
VND = "VND"
|
|
352
352
|
YER = "YER"
|
|
353
353
|
ZAR = "ZAR"
|
|
354
|
+
XTR = "XTR"
|
|
354
355
|
|
|
355
356
|
|
|
356
357
|
class InlineQueryResultType(str, enum.Enum):
|
|
@@ -435,7 +436,7 @@ class BotCommandScopeType(str, enum.Enum):
|
|
|
435
436
|
|
|
436
437
|
|
|
437
438
|
class ChatType(str, enum.Enum):
|
|
438
|
-
"""Type of chat, can be either
|
|
439
|
+
"""Type of chat, can be either `private`, `group`, `supergroup` or `channel`."""
|
|
439
440
|
|
|
440
441
|
PRIVATE = "private"
|
|
441
442
|
GROUP = "group"
|
|
@@ -467,15 +468,15 @@ class DiceEmoji(str, enum.Enum):
|
|
|
467
468
|
|
|
468
469
|
class MessageEntityType(str, enum.Enum):
|
|
469
470
|
"""Type of the entity.
|
|
470
|
-
Currently, can be
|
|
471
|
-
(`#hashtag`),
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
(*italic text*),
|
|
475
|
-
text),
|
|
476
|
-
(monowidth block),
|
|
471
|
+
Currently, can be `mention` (`@username`), `hashtag`
|
|
472
|
+
(`#hashtag`), `cashtag` (`$USD`), `bot_command` (`/start@jobs_bot`),
|
|
473
|
+
`url` (`https://telegram.org`), `email` (`do-not-reply@telegram.org`),
|
|
474
|
+
`phone_number` (`+1-212-555-0123`), `bold` (**bold text**), `italic`
|
|
475
|
+
(*italic text*), `underline` (underlined text), `strikethrough` (strikethrough
|
|
476
|
+
text), `spoiler` (spoiler message), `code` (monowidth string), `pre`
|
|
477
|
+
(monowidth block), `text_link` (for clickable text URLs), `text_mention`
|
|
477
478
|
(for users [without usernames](https://telegram.org/blog/edit#new-mentions)),
|
|
478
|
-
|
|
479
|
+
`custom_emoji` (for inline custom emoji stickers), `blockquote` (blockquote)
|
|
479
480
|
[docs](https://core.telegram.org/bots/api#messageentity)"""
|
|
480
481
|
|
|
481
482
|
MENTION = "mention"
|
|
@@ -496,19 +497,20 @@ class MessageEntityType(str, enum.Enum):
|
|
|
496
497
|
TEXT_LINK = "text_link"
|
|
497
498
|
TEXT_MENTION = "text_mention"
|
|
498
499
|
CUSTOM_EMOJI = "custom_emoji"
|
|
500
|
+
EXPANDABLE_BLOCKQUOTE = "expandable_blockquote"
|
|
499
501
|
|
|
500
502
|
|
|
501
503
|
class PollType(str, enum.Enum):
|
|
502
|
-
"""Poll type, currently can be
|
|
504
|
+
"""Poll type, currently can be `regular` or `quiz`."""
|
|
503
505
|
|
|
504
506
|
REGULAR = "regular"
|
|
505
507
|
QUIZ = "quiz"
|
|
506
508
|
|
|
507
509
|
|
|
508
510
|
class StickerType(str, enum.Enum):
|
|
509
|
-
"""Type of the sticker, currently one of
|
|
511
|
+
"""Type of the sticker, currently one of `regular`, `mask`, `custom_emoji`.
|
|
510
512
|
The type of the sticker is independent from its format, which is determined
|
|
511
|
-
by the fields
|
|
513
|
+
by the fields `is_animated` and `is_video`."""
|
|
512
514
|
|
|
513
515
|
REGULAR = "regular"
|
|
514
516
|
MASK = "mask"
|
|
@@ -526,7 +528,7 @@ class MessageOriginType(str, enum.Enum):
|
|
|
526
528
|
|
|
527
529
|
|
|
528
530
|
class StickerSetStickerType(str, enum.Enum):
|
|
529
|
-
"""Type of stickers in the set, currently one of
|
|
531
|
+
"""Type of stickers in the set, currently one of `regular`, `mask`, `custom_emoji`."""
|
|
530
532
|
|
|
531
533
|
REGULAR = "regular"
|
|
532
534
|
MASK = "mask"
|
|
@@ -534,8 +536,8 @@ class StickerSetStickerType(str, enum.Enum):
|
|
|
534
536
|
|
|
535
537
|
|
|
536
538
|
class MaskPositionPoint(str, enum.Enum):
|
|
537
|
-
"""The part of the face relative to which the mask should be placed. One of
|
|
538
|
-
|
|
539
|
+
"""The part of the face relative to which the mask should be placed. One of `forehead`,
|
|
540
|
+
`eyes`, `mouth`, or `chin`."""
|
|
539
541
|
|
|
540
542
|
FOREHEAD = "forehead"
|
|
541
543
|
EYES = "eyes"
|
|
@@ -545,10 +547,10 @@ class MaskPositionPoint(str, enum.Enum):
|
|
|
545
547
|
|
|
546
548
|
class InlineQueryChatType(str, enum.Enum):
|
|
547
549
|
"""Type of the chat from which the inline query was sent. Can be
|
|
548
|
-
either
|
|
549
|
-
|
|
550
|
+
either `sender` for a private chat with the inline query sender, `private`,
|
|
551
|
+
`group`, `supergroup`, or `channel`. The chat type should be always known
|
|
550
552
|
for requests sent from official clients and most third-party clients,
|
|
551
|
-
unless the request was sent from a secret chat"""
|
|
553
|
+
unless the request was sent from a secret chat."""
|
|
552
554
|
|
|
553
555
|
SENDER = "sender"
|
|
554
556
|
PRIVATE = "private"
|
|
@@ -558,15 +560,16 @@ class InlineQueryChatType(str, enum.Enum):
|
|
|
558
560
|
|
|
559
561
|
|
|
560
562
|
class InlineQueryResultMimeType(str, enum.Enum):
|
|
561
|
-
"""MIME type of the content of the video URL,
|
|
563
|
+
"""MIME type of the content of the video URL, `text/html` or `video/mp4`."""
|
|
562
564
|
|
|
563
565
|
TEXT_HTML = "text/html"
|
|
564
566
|
VIDEO_MP4 = "video/mp4"
|
|
565
567
|
|
|
566
568
|
|
|
567
569
|
class InlineQueryResultThumbnailMimeType(str, enum.Enum):
|
|
568
|
-
"""MIME type of the thumbnail, must be one of
|
|
569
|
-
or
|
|
570
|
+
"""MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
571
|
+
or `video/mp4`. Defaults to `image/jpeg`
|
|
572
|
+
"""
|
|
570
573
|
|
|
571
574
|
IMAGE_JPEG = "image/jpeg"
|
|
572
575
|
IMAGE_GIF = "image/gif"
|
|
@@ -599,8 +602,9 @@ class ReactionTypeType(str, enum.Enum):
|
|
|
599
602
|
|
|
600
603
|
|
|
601
604
|
class InlineQueryResultGifThumbnailMimeType(str, enum.Enum):
|
|
602
|
-
"""MIME type of the thumbnail, must be one of
|
|
603
|
-
or
|
|
605
|
+
"""MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
606
|
+
or `video/mp4`. Defaults to `image/jpeg`.
|
|
607
|
+
"""
|
|
604
608
|
|
|
605
609
|
IMAGE_JPEG = "image/jpeg"
|
|
606
610
|
IMAGE_GIF = "image/gif"
|
|
@@ -608,8 +612,9 @@ class InlineQueryResultGifThumbnailMimeType(str, enum.Enum):
|
|
|
608
612
|
|
|
609
613
|
|
|
610
614
|
class InlineQueryResultMpeg4GifThumbnailMimeType(str, enum.Enum):
|
|
611
|
-
"""MIME type of the thumbnail, must be one of
|
|
612
|
-
or
|
|
615
|
+
"""MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
|
|
616
|
+
or `video/mp4`. Defaults to `image/jpeg`.
|
|
617
|
+
"""
|
|
613
618
|
|
|
614
619
|
IMAGE_JPEG = "image/jpeg"
|
|
615
620
|
IMAGE_GIF = "image/gif"
|
|
@@ -617,24 +622,25 @@ class InlineQueryResultMpeg4GifThumbnailMimeType(str, enum.Enum):
|
|
|
617
622
|
|
|
618
623
|
|
|
619
624
|
class InlineQueryResultVideoMimeType(str, enum.Enum):
|
|
620
|
-
"""MIME type of the content of the video URL,
|
|
625
|
+
"""MIME type of the content of the video URL, `text/html` or `video/mp4`."""
|
|
621
626
|
|
|
622
627
|
TEXT_HTML = "text/html"
|
|
623
628
|
VIDEO_MP4 = "video/mp4"
|
|
624
629
|
|
|
625
630
|
|
|
626
631
|
class InlineQueryResultDocumentMimeType(str, enum.Enum):
|
|
627
|
-
"""MIME type of the content of the file, either
|
|
632
|
+
"""MIME type of the content of the file, either `application/pdf` or `application/zip`."""
|
|
628
633
|
|
|
629
634
|
APPLICATION_PDF = "application/pdf"
|
|
630
635
|
APPLICATION_ZIP = "application/zip"
|
|
631
636
|
|
|
632
637
|
|
|
633
638
|
class EncryptedPassportElementType(str, enum.Enum):
|
|
634
|
-
"""Element type. One of
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
639
|
+
"""Element type. One of `personal_details`, `passport`, `driver_license`,
|
|
640
|
+
`identity_card`, `internal_passport`, `address`, `utility_bill`,
|
|
641
|
+
`bank_statement`, `rental_agreement`, `passport_registration`,
|
|
642
|
+
`temporary_registration`, `phone_number`, `email`.
|
|
643
|
+
"""
|
|
638
644
|
|
|
639
645
|
PERSONAL_DETAILS = "personal_details"
|
|
640
646
|
PASSPORT = "passport"
|