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.

Files changed (101) hide show
  1. telegrinder/__init__.py +9 -3
  2. telegrinder/bot/__init__.py +7 -5
  3. telegrinder/bot/cute_types/base.py +12 -14
  4. telegrinder/bot/cute_types/callback_query.py +55 -44
  5. telegrinder/bot/cute_types/chat_join_request.py +8 -7
  6. telegrinder/bot/cute_types/chat_member_updated.py +23 -17
  7. telegrinder/bot/cute_types/inline_query.py +1 -1
  8. telegrinder/bot/cute_types/message.py +331 -183
  9. telegrinder/bot/cute_types/update.py +4 -8
  10. telegrinder/bot/cute_types/utils.py +1 -5
  11. telegrinder/bot/dispatch/__init__.py +2 -3
  12. telegrinder/bot/dispatch/abc.py +4 -0
  13. telegrinder/bot/dispatch/context.py +9 -4
  14. telegrinder/bot/dispatch/dispatch.py +33 -30
  15. telegrinder/bot/dispatch/handler/func.py +33 -12
  16. telegrinder/bot/dispatch/handler/message_reply.py +6 -3
  17. telegrinder/bot/dispatch/middleware/abc.py +4 -4
  18. telegrinder/bot/dispatch/process.py +40 -13
  19. telegrinder/bot/dispatch/return_manager/abc.py +12 -12
  20. telegrinder/bot/dispatch/return_manager/callback_query.py +1 -3
  21. telegrinder/bot/dispatch/return_manager/inline_query.py +1 -3
  22. telegrinder/bot/dispatch/view/abc.py +74 -31
  23. telegrinder/bot/dispatch/view/box.py +66 -50
  24. telegrinder/bot/dispatch/view/message.py +1 -5
  25. telegrinder/bot/dispatch/view/raw.py +6 -6
  26. telegrinder/bot/dispatch/waiter_machine/__init__.py +2 -1
  27. telegrinder/bot/dispatch/waiter_machine/machine.py +86 -50
  28. telegrinder/bot/dispatch/waiter_machine/middleware.py +31 -7
  29. telegrinder/bot/dispatch/waiter_machine/short_state.py +26 -7
  30. telegrinder/bot/polling/polling.py +4 -4
  31. telegrinder/bot/rules/__init__.py +9 -6
  32. telegrinder/bot/rules/abc.py +99 -22
  33. telegrinder/bot/rules/adapter/__init__.py +4 -1
  34. telegrinder/bot/rules/adapter/abc.py +11 -6
  35. telegrinder/bot/rules/adapter/errors.py +1 -2
  36. telegrinder/bot/rules/adapter/event.py +14 -9
  37. telegrinder/bot/rules/adapter/node.py +42 -0
  38. telegrinder/bot/rules/callback_data.py +13 -15
  39. telegrinder/bot/rules/chat_join.py +3 -2
  40. telegrinder/bot/rules/command.py +26 -14
  41. telegrinder/bot/rules/enum_text.py +5 -5
  42. telegrinder/bot/rules/func.py +6 -6
  43. telegrinder/bot/rules/fuzzy.py +5 -7
  44. telegrinder/bot/rules/inline.py +4 -5
  45. telegrinder/bot/rules/integer.py +10 -8
  46. telegrinder/bot/rules/is_from.py +63 -91
  47. telegrinder/bot/rules/markup.py +5 -5
  48. telegrinder/bot/rules/mention.py +4 -4
  49. telegrinder/bot/rules/message.py +1 -1
  50. telegrinder/bot/rules/node.py +27 -0
  51. telegrinder/bot/rules/regex.py +5 -5
  52. telegrinder/bot/rules/rule_enum.py +4 -4
  53. telegrinder/bot/rules/start.py +5 -5
  54. telegrinder/bot/rules/text.py +9 -13
  55. telegrinder/bot/rules/update.py +4 -4
  56. telegrinder/bot/scenario/__init__.py +3 -3
  57. telegrinder/bot/scenario/checkbox.py +5 -5
  58. telegrinder/bot/scenario/choice.py +5 -5
  59. telegrinder/model.py +49 -15
  60. telegrinder/modules.py +14 -6
  61. telegrinder/msgspec_utils.py +8 -17
  62. telegrinder/node/__init__.py +26 -8
  63. telegrinder/node/attachment.py +13 -9
  64. telegrinder/node/base.py +27 -14
  65. telegrinder/node/callback_query.py +18 -0
  66. telegrinder/node/command.py +29 -0
  67. telegrinder/node/composer.py +119 -30
  68. telegrinder/node/me.py +14 -0
  69. telegrinder/node/message.py +2 -4
  70. telegrinder/node/polymorphic.py +44 -0
  71. telegrinder/node/rule.py +26 -22
  72. telegrinder/node/scope.py +36 -0
  73. telegrinder/node/source.py +37 -10
  74. telegrinder/node/text.py +11 -5
  75. telegrinder/node/tools/__init__.py +2 -2
  76. telegrinder/node/tools/generator.py +6 -6
  77. telegrinder/tools/__init__.py +9 -14
  78. telegrinder/tools/buttons.py +23 -17
  79. telegrinder/tools/error_handler/error_handler.py +11 -14
  80. telegrinder/tools/formatting/__init__.py +0 -6
  81. telegrinder/tools/formatting/html.py +10 -12
  82. telegrinder/tools/formatting/links.py +0 -5
  83. telegrinder/tools/formatting/spec_html_formats.py +0 -11
  84. telegrinder/tools/global_context/abc.py +1 -3
  85. telegrinder/tools/global_context/global_context.py +6 -16
  86. telegrinder/tools/i18n/simple.py +1 -3
  87. telegrinder/tools/kb_set/yaml.py +1 -2
  88. telegrinder/tools/keyboard.py +7 -8
  89. telegrinder/tools/limited_dict.py +13 -3
  90. telegrinder/tools/loop_wrapper/loop_wrapper.py +6 -5
  91. telegrinder/tools/magic.py +27 -5
  92. telegrinder/types/__init__.py +20 -0
  93. telegrinder/types/enums.py +37 -31
  94. telegrinder/types/methods.py +613 -401
  95. telegrinder/types/objects.py +1151 -757
  96. {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/LICENSE +1 -1
  97. {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/METADATA +9 -8
  98. telegrinder-0.1.dev169.dist-info/RECORD +143 -0
  99. telegrinder/bot/dispatch/composition.py +0 -88
  100. telegrinder-0.1.dev167.dist-info/RECORD +0 -137
  101. {telegrinder-0.1.dev167.dist-info → telegrinder-0.1.dev169.dist-info}/WHEEL +0 -0
@@ -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 private”, group”, supergroup or channel"""
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 mention (`@username`), hashtag
471
- (`#hashtag`), cashtag (`$USD`), bot_command (`/start@jobs_bot`),
472
- url (`https://telegram.org`), email (`do-not-reply@telegram.org`),
473
- phone_number (`+1-212-555-0123`), bold (**bold text**), italic
474
- (*italic text*), underline (underlined text), strikethrough (strikethrough
475
- text), spoiler (spoiler message), code (monowidth string), pre
476
- (monowidth block), text_link (for clickable text URLs), text_mention
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
- custom_emoji (for inline custom emoji stickers), blockquote (blockquote)
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 regular or quiz"""
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 regular”, mask”, custom_emoji”.
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 *is_animated* and *is_video*."""
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 regular”, mask”, custom_emoji"""
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 forehead”,
538
- eyes”, mouth”, or chin”."""
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 sender for a private chat with the inline query sender, private”,
549
- group”, supergroup”, or channel”. The chat type should be always known
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, text/html or video/mp4"""
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 image/jpeg”, image/gif”,
569
- or video/mp4”. Defaults to image/jpeg”"""
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 image/jpeg”, image/gif”,
603
- or video/mp4”. Defaults to image/jpeg”"""
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 image/jpeg”, image/gif”,
612
- or video/mp4”. Defaults to image/jpeg”"""
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, text/html or video/mp4"""
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 application/pdf or application/zip"""
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 personal_details”, passport”, driver_license”,
635
- identity_card”, internal_passport”, address”, utility_bill”,
636
- bank_statement”, rental_agreement”, passport_registration”,
637
- temporary_registration”, phone_number”, email”."""
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"