telegrinder 0.2.1__tar.gz → 0.3.0__tar.gz

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 (168) hide show
  1. {telegrinder-0.2.1 → telegrinder-0.3.0}/PKG-INFO +4 -5
  2. {telegrinder-0.2.1 → telegrinder-0.3.0}/pyproject.toml +5 -3
  3. {telegrinder-0.2.1 → telegrinder-0.3.0}/readme.md +3 -4
  4. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/__init__.py +45 -12
  5. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/__init__.py +32 -4
  6. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/callback_query.py +60 -146
  7. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/chat_join_request.py +12 -16
  8. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/chat_member_updated.py +15 -105
  9. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/inline_query.py +5 -14
  10. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/message.py +623 -1238
  11. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/__init__.py +40 -3
  12. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/abc.py +8 -1
  13. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/context.py +2 -2
  14. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/dispatch.py +8 -1
  15. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/__init__.py +21 -0
  16. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/audio_reply.py +44 -0
  17. telegrinder-0.2.1/telegrinder/bot/dispatch/handler/message_reply.py → telegrinder-0.3.0/telegrinder/bot/dispatch/handler/base.py +15 -17
  18. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/document_reply.py +44 -0
  19. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/handler/func.py +3 -3
  20. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/media_group_reply.py +43 -0
  21. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/message_reply.py +36 -0
  22. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/photo_reply.py +44 -0
  23. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/sticker_reply.py +37 -0
  24. telegrinder-0.3.0/telegrinder/bot/dispatch/handler/video_reply.py +44 -0
  25. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/process.py +2 -2
  26. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/return_manager/abc.py +11 -8
  27. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/return_manager/callback_query.py +2 -2
  28. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/return_manager/inline_query.py +2 -2
  29. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/return_manager/message.py +3 -3
  30. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/__init__.py +2 -1
  31. telegrinder-0.3.0/telegrinder/bot/dispatch/view/abc.py +43 -0
  32. telegrinder-0.2.1/telegrinder/bot/dispatch/view/abc.py → telegrinder-0.3.0/telegrinder/bot/dispatch/view/base.py +21 -43
  33. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/callback_query.py +3 -3
  34. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/chat_join_request.py +2 -2
  35. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/chat_member.py +2 -3
  36. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/inline_query.py +2 -2
  37. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/message.py +5 -4
  38. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/raw.py +4 -3
  39. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/__init__.py +28 -0
  40. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/actions.py +10 -0
  41. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/hasher/__init__.py +15 -0
  42. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/hasher/callback.py +60 -0
  43. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/hasher/hasher.py +49 -0
  44. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/hasher/message.py +54 -0
  45. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/hasher/state.py +19 -0
  46. telegrinder-0.3.0/telegrinder/bot/dispatch/waiter_machine/machine.py +176 -0
  47. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/waiter_machine/middleware.py +23 -41
  48. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/waiter_machine/short_state.py +9 -9
  49. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/polling/polling.py +5 -2
  50. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/abc.py +6 -5
  51. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/integer.py +1 -1
  52. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/is_from.py +19 -0
  53. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/state.py +9 -6
  54. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/scenario/checkbox.py +5 -5
  55. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/scenario/choice.py +2 -2
  56. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/client/aiohttp.py +5 -7
  57. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/model.py +6 -11
  58. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/modules.py +16 -25
  59. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/msgspec_json.py +1 -1
  60. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/msgspec_utils.py +56 -5
  61. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/base.py +2 -2
  62. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/composer.py +5 -9
  63. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/container.py +6 -1
  64. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/event.py +2 -0
  65. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/polymorphic.py +7 -7
  66. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/rule.py +6 -4
  67. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/source.py +4 -2
  68. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/tools/generator.py +7 -6
  69. telegrinder-0.3.0/telegrinder/tools/functional.py +9 -0
  70. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/keyboard.py +6 -1
  71. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/loop_wrapper/loop_wrapper.py +4 -5
  72. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/magic.py +17 -19
  73. telegrinder-0.3.0/telegrinder/tools/state_storage/__init__.py +4 -0
  74. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/state_storage/abc.py +12 -10
  75. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/state_storage/memory.py +9 -6
  76. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/types/__init__.py +1 -0
  77. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/types/methods.py +10 -2
  78. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/types/objects.py +47 -5
  79. telegrinder-0.2.1/telegrinder/bot/dispatch/handler/__init__.py +0 -5
  80. telegrinder-0.2.1/telegrinder/bot/dispatch/waiter_machine/__init__.py +0 -10
  81. telegrinder-0.2.1/telegrinder/bot/dispatch/waiter_machine/machine.py +0 -189
  82. telegrinder-0.2.1/telegrinder/tools/state_storage/__init__.py +0 -4
  83. {telegrinder-0.2.1 → telegrinder-0.3.0}/LICENSE +0 -0
  84. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/api/__init__.py +0 -0
  85. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/api/api.py +0 -0
  86. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/api/error.py +0 -0
  87. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/api/response.py +0 -0
  88. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/api/token.py +0 -0
  89. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/bot.py +0 -0
  90. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/__init__.py +0 -0
  91. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/base.py +0 -0
  92. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/update.py +0 -0
  93. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/cute_types/utils.py +0 -0
  94. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/handler/abc.py +0 -0
  95. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/middleware/__init__.py +0 -0
  96. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/middleware/abc.py +0 -0
  97. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/return_manager/__init__.py +0 -0
  98. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/dispatch/view/box.py +0 -0
  99. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/polling/__init__.py +0 -0
  100. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/polling/abc.py +0 -0
  101. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/__init__.py +3 -3
  102. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/__init__.py +1 -1
  103. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/abc.py +0 -0
  104. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/errors.py +0 -0
  105. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/event.py +0 -0
  106. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/node.py +0 -0
  107. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/adapter/raw_update.py +0 -0
  108. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/callback_data.py +0 -0
  109. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/chat_join.py +0 -0
  110. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/command.py +0 -0
  111. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/enum_text.py +0 -0
  112. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/func.py +0 -0
  113. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/fuzzy.py +0 -0
  114. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/inline.py +0 -0
  115. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/markup.py +0 -0
  116. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/mention.py +0 -0
  117. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/message.py +0 -0
  118. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/message_entities.py +0 -0
  119. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/node.py +0 -0
  120. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/regex.py +0 -0
  121. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/rule_enum.py +0 -0
  122. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/start.py +0 -0
  123. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/text.py +0 -0
  124. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/rules/update.py +0 -0
  125. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/scenario/__init__.py +0 -0
  126. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/bot/scenario/abc.py +0 -0
  127. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/client/__init__.py +0 -0
  128. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/client/abc.py +0 -0
  129. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/__init__.py +0 -0
  130. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/attachment.py +0 -0
  131. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/callback_query.py +0 -0
  132. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/command.py +0 -0
  133. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/me.py +0 -0
  134. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/message.py +0 -0
  135. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/scope.py +3 -3
  136. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/text.py +0 -0
  137. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/tools/__init__.py +0 -0
  138. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/node/update.py +0 -0
  139. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/py.typed +0 -0
  140. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/rules.py +2 -2
  141. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/__init__.py +10 -10
  142. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/buttons.py +0 -0
  143. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/error_handler/__init__.py +0 -0
  144. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/error_handler/abc.py +0 -0
  145. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/error_handler/error.py +0 -0
  146. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/error_handler/error_handler.py +0 -0
  147. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/formatting/__init__.py +0 -0
  148. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/formatting/html.py +0 -0
  149. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/formatting/links.py +0 -0
  150. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/formatting/spec_html_formats.py +0 -0
  151. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/global_context/__init__.py +0 -0
  152. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/global_context/abc.py +0 -0
  153. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/global_context/global_context.py +0 -0
  154. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/global_context/telegrinder_ctx.py +0 -0
  155. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/i18n/__init__.py +0 -0
  156. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/i18n/base.py +0 -0
  157. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/i18n/middleware/__init__.py +0 -0
  158. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/i18n/middleware/base.py +0 -0
  159. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/i18n/simple.py +0 -0
  160. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/kb_set/__init__.py +0 -0
  161. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/kb_set/base.py +0 -0
  162. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/kb_set/yaml.py +0 -0
  163. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/limited_dict.py +0 -0
  164. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/loop_wrapper/__init__.py +0 -0
  165. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/loop_wrapper/abc.py +0 -0
  166. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/tools/parse_mode.py +0 -0
  167. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/types/enums.py +0 -0
  168. {telegrinder-0.2.1 → telegrinder-0.3.0}/telegrinder/verification_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: telegrinder
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Modern visionary telegram bot framework.
5
5
  Home-page: https://github.com/timoniq/telegrinder
6
6
  License: MIT
@@ -43,8 +43,9 @@ Still in development.
43
43
  * Type hinted
44
44
  * Customizable and extensible
45
45
  * Ready to use scenarios and rules
46
- * Fast models built on msgspec
46
+ * Fast models built on [msgspec](https://github.com/jcrist/msgspec)
47
47
  * Both low-level and high-level API
48
+ * Support [optional dependecies](https://github.com/timoniq/telegrinder/blob/dev/docs/guide/optional_dependencies.md)
48
49
 
49
50
  # Getting started
50
51
 
@@ -85,9 +86,7 @@ logger.set_level("INFO")
85
86
  @bot.on.message(Text("/start"))
86
87
  async def start(message: Message):
87
88
  me = (await api.get_me()).unwrap()
88
- await message.answer(
89
- f"Hello, {message.from_user.full_name}! I'm {me.full_name}."
90
- )
89
+ await message.answer(f"Hello, {message.from_user.full_name}! I'm {me.full_name}.")
91
90
 
92
91
 
93
92
  bot.run_forever()
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "telegrinder"
3
- version = "0.2.1"
3
+ version = "0.3.0"
4
4
  description = "Modern visionary telegram bot framework."
5
5
  authors = ["timoniq <tesseradecades@mail.ru>"]
6
6
  maintainers = ["luwqz1 <howluwqz1@gmail.com>"]
@@ -56,9 +56,10 @@ fntypes = "^0.1.3"
56
56
  pre-commit = "^3.8.0"
57
57
  ruff = ">=0.5,<0.7"
58
58
  basedpyright = "^1.12.1"
59
- sort-all = "1.2.0"
59
+ sort-all = "^1.2.0"
60
+ libcst = "^1.4.0"
60
61
  pytest = "^8.0.0"
61
- pytest-asyncio = "^0.23.5"
62
+ pytest-asyncio = ">=0.23.5,<0.25.0"
62
63
  pytest-cov = "^5.0.0"
63
64
  pytest-mock = "^3.10.0"
64
65
 
@@ -81,6 +82,7 @@ asyncio_mode = "auto"
81
82
 
82
83
  [tool.ruff.lint.per-file-ignores]
83
84
  "__init__.py" = ["F401", "F403"]
85
+ "typegen/**.py" = ["N802"]
84
86
 
85
87
  [tool.ruff.lint.flake8-quotes]
86
88
  docstring-quotes = "double"
@@ -7,8 +7,9 @@ Still in development.
7
7
  * Type hinted
8
8
  * Customizable and extensible
9
9
  * Ready to use scenarios and rules
10
- * Fast models built on msgspec
10
+ * Fast models built on [msgspec](https://github.com/jcrist/msgspec)
11
11
  * Both low-level and high-level API
12
+ * Support [optional dependecies](https://github.com/timoniq/telegrinder/blob/dev/docs/guide/optional_dependencies.md)
12
13
 
13
14
  # Getting started
14
15
 
@@ -49,9 +50,7 @@ logger.set_level("INFO")
49
50
  @bot.on.message(Text("/start"))
50
51
  async def start(message: Message):
51
52
  me = (await api.get_me()).unwrap()
52
- await message.answer(
53
- f"Hello, {message.from_user.full_name}! I'm {me.full_name}."
54
- )
53
+ await message.answer(f"Hello, {message.from_user.full_name}! I'm {me.full_name}.")
55
54
 
56
55
 
57
56
  bot.run_forever()
@@ -5,8 +5,9 @@ Modern visionary telegram bot framework.
5
5
  * Type hinted
6
6
  * Customizable and extensible
7
7
  * Ready to use scenarios and rules
8
- * Fast models built on msgspec
8
+ * Fast models built on [msgspec](https://github.com/jcrist/msgspec)
9
9
  * Both low-level and high-level API
10
+ * Support [optional dependecies](https://github.com/timoniq/telegrinder/blob/dev/docs/guide/optional_dependencies.md)
10
11
 
11
12
  Basic example:
12
13
 
@@ -23,9 +24,7 @@ logger.set_level("INFO")
23
24
  @bot.on.message(Text("/start"))
24
25
  async def start(message: Message):
25
26
  me = (await api.get_me()).unwrap()
26
- await message.answer(
27
- f"Hello, {message.from_user.full_name}! I'm {me.full_name}."
28
- )
27
+ await message.answer(f"Hello, {message.from_user.full_name}! I'm {me.full_name}.")
29
28
 
30
29
 
31
30
  bot.run_forever()
@@ -36,6 +35,12 @@ import typing
36
35
 
37
36
  from .api import API, APIError, APIResponse, Token
38
37
  from .bot import (
38
+ CALLBACK_QUERY_FOR_MESSAGE,
39
+ CALLBACK_QUERY_FROM_CHAT,
40
+ CALLBACK_QUERY_IN_CHAT_FOR_MESSAGE,
41
+ MESSAGE_FROM_USER,
42
+ MESSAGE_FROM_USER_IN_CHAT,
43
+ MESSAGE_IN_CHAT,
39
44
  ABCDispatch,
40
45
  ABCHandler,
41
46
  ABCMiddleware,
@@ -45,6 +50,7 @@ from .bot import (
45
50
  ABCScenario,
46
51
  ABCStateView,
47
52
  ABCView,
53
+ AudioReplyHandler,
48
54
  BaseCute,
49
55
  BaseReturnManager,
50
56
  BaseStateView,
@@ -60,21 +66,29 @@ from .bot import (
60
66
  ChatMemberView,
61
67
  Checkbox,
62
68
  Choice,
69
+ Context,
63
70
  Dispatch,
71
+ DocumentReplyHandler,
64
72
  FuncHandler,
73
+ Hasher,
65
74
  InlineQueryCute,
66
75
  InlineQueryReturnManager,
67
76
  InlineQueryRule,
77
+ MediaGroupReplyHandler,
68
78
  MessageCute,
69
79
  MessageReplyHandler,
70
80
  MessageReturnManager,
71
81
  MessageRule,
72
82
  MessageView,
83
+ PhotoReplyHandler,
73
84
  Polling,
74
85
  RawEventView,
75
86
  ShortState,
87
+ StateViewHasher,
88
+ StickerReplyHandler,
76
89
  Telegrinder,
77
90
  UpdateCute,
91
+ VideoReplyHandler,
78
92
  ViewBox,
79
93
  WaiterMachine,
80
94
  register_manager,
@@ -126,7 +140,6 @@ Bot: typing.TypeAlias = Telegrinder
126
140
 
127
141
 
128
142
  __all__ = (
129
- "API",
130
143
  "ABCClient",
131
144
  "ABCDispatch",
132
145
  "ABCErrorHandler",
@@ -138,6 +151,8 @@ __all__ = (
138
151
  "ABCReturnManager",
139
152
  "ABCRule",
140
153
  "ABCScenario",
154
+ "ABCStateStorage",
155
+ "ABCStateStorage",
141
156
  "ABCStateView",
142
157
  "ABCTranslator",
143
158
  "ABCTranslatorMiddleware",
@@ -147,26 +162,32 @@ __all__ = (
147
162
  "APIResponse",
148
163
  "AiohttpClient",
149
164
  "AnyMarkup",
165
+ "AudioReplyHandler",
150
166
  "BaseCute",
151
167
  "BaseReturnManager",
152
168
  "BaseStateView",
153
169
  "BaseView",
154
170
  "Bot",
155
171
  "Button",
172
+ "CALLBACK_QUERY_FOR_MESSAGE",
173
+ "CALLBACK_QUERY_FROM_CHAT",
174
+ "CALLBACK_QUERY_IN_CHAT_FOR_MESSAGE",
156
175
  "CallbackQuery",
157
176
  "CallbackQueryCute",
158
177
  "CallbackQueryReturnManager",
178
+ "CallbackQueryRule",
159
179
  "CallbackQueryView",
160
180
  "ChatJoinRequest",
161
181
  "ChatJoinRequestCute",
162
- "CallbackQueryRule",
163
182
  "ChatJoinRequestRule",
164
- "InlineQueryRule",
165
183
  "ChatJoinRequestView",
166
184
  "ChatMemberUpdated",
167
185
  "ChatMemberUpdatedCute",
168
186
  "ChatMemberView",
187
+ "DocumentReplyHandler",
169
188
  "Checkbox",
189
+ "Choice",
190
+ "Context",
170
191
  "CtxVar",
171
192
  "DelayedTask",
172
193
  "Dispatch",
@@ -175,44 +196,56 @@ __all__ = (
175
196
  "FuncHandler",
176
197
  "GlobalContext",
177
198
  "HTMLFormatter",
199
+ "Hasher",
178
200
  "I18nEnum",
179
201
  "InlineButton",
180
202
  "InlineKeyboard",
181
203
  "InlineQuery",
182
204
  "InlineQueryCute",
183
205
  "InlineQueryReturnManager",
206
+ "InlineQueryRule",
184
207
  "Keyboard",
185
208
  "KeyboardSetBase",
186
209
  "KeyboardSetYAML",
187
210
  "Lifespan",
188
211
  "LoopWrapper",
212
+ "MESSAGE_FROM_USER",
213
+ "MESSAGE_FROM_USER_IN_CHAT",
214
+ "MESSAGE_IN_CHAT",
215
+ "MediaGroupReplyHandler",
216
+ "MemoryStateStorage",
217
+ "MemoryStateStorage",
189
218
  "Message",
190
219
  "MessageCute",
191
220
  "MessageReplyHandler",
221
+ "MessageReplyHandler",
192
222
  "MessageReturnManager",
193
223
  "MessageRule",
194
224
  "MessageView",
195
225
  "Model",
196
226
  "ParseMode",
227
+ "PhotoReplyHandler",
197
228
  "Polling",
198
229
  "RawEventView",
199
230
  "RowButtons",
200
231
  "ShortState",
201
232
  "SimpleI18n",
202
233
  "SimpleTranslator",
203
- "Choice",
234
+ "StateData",
235
+ "StateData",
236
+ "StateMeta",
237
+ "StateMeta",
238
+ "StateViewHasher",
239
+ "StickerReplyHandler",
204
240
  "Telegrinder",
205
241
  "Token",
206
242
  "Update",
207
243
  "UpdateCute",
244
+ "VideoReplyHandler",
208
245
  "ViewBox",
209
246
  "WaiterMachine",
210
247
  "ctx_var",
211
248
  "logger",
212
249
  "magic_bundle",
213
250
  "register_manager",
214
- "ABCStateStorage",
215
- "MemoryStateStorage",
216
- "StateData",
217
- "StateMeta",
218
251
  )
@@ -9,12 +9,19 @@ from telegrinder.bot.cute_types import (
9
9
  UpdateCute,
10
10
  )
11
11
  from telegrinder.bot.dispatch import (
12
+ CALLBACK_QUERY_FOR_MESSAGE,
13
+ CALLBACK_QUERY_FROM_CHAT,
14
+ CALLBACK_QUERY_IN_CHAT_FOR_MESSAGE,
15
+ MESSAGE_FROM_USER,
16
+ MESSAGE_FROM_USER_IN_CHAT,
17
+ MESSAGE_IN_CHAT,
12
18
  ABCDispatch,
13
19
  ABCHandler,
14
20
  ABCMiddleware,
15
21
  ABCReturnManager,
16
22
  ABCStateView,
17
23
  ABCView,
24
+ AudioReplyHandler,
18
25
  BaseReturnManager,
19
26
  BaseStateView,
20
27
  BaseView,
@@ -24,14 +31,21 @@ from telegrinder.bot.dispatch import (
24
31
  ChatMemberView,
25
32
  Context,
26
33
  Dispatch,
34
+ DocumentReplyHandler,
27
35
  FuncHandler,
36
+ Hasher,
28
37
  InlineQueryReturnManager,
29
38
  Manager,
39
+ MediaGroupReplyHandler,
30
40
  MessageReplyHandler,
31
41
  MessageReturnManager,
32
42
  MessageView,
43
+ PhotoReplyHandler,
33
44
  RawEventView,
34
45
  ShortState,
46
+ StateViewHasher,
47
+ StickerReplyHandler,
48
+ VideoReplyHandler,
35
49
  ViewBox,
36
50
  WaiterMachine,
37
51
  clear_wm_storage_worker,
@@ -57,40 +71,54 @@ __all__ = (
57
71
  "ABCScenario",
58
72
  "ABCStateView",
59
73
  "ABCView",
74
+ "AudioReplyHandler",
60
75
  "BaseCute",
61
76
  "BaseReturnManager",
62
77
  "BaseStateView",
63
78
  "BaseView",
79
+ "CALLBACK_QUERY_FOR_MESSAGE",
80
+ "CALLBACK_QUERY_FROM_CHAT",
81
+ "CALLBACK_QUERY_IN_CHAT_FOR_MESSAGE",
64
82
  "CallbackQueryCute",
65
83
  "CallbackQueryReturnManager",
66
84
  "CallbackQueryRule",
67
85
  "CallbackQueryView",
68
- "ChatJoinRequestRule",
69
- "InlineQueryRule",
70
86
  "ChatJoinRequestCute",
87
+ "ChatJoinRequestRule",
71
88
  "ChatJoinRequestView",
72
89
  "ChatMemberUpdatedCute",
73
90
  "ChatMemberView",
74
91
  "Checkbox",
92
+ "Choice",
75
93
  "Context",
76
94
  "Dispatch",
95
+ "DocumentReplyHandler",
77
96
  "FuncHandler",
97
+ "Hasher",
78
98
  "InlineQueryCute",
79
99
  "InlineQueryReturnManager",
100
+ "InlineQueryRule",
101
+ "MESSAGE_FROM_USER",
102
+ "MESSAGE_FROM_USER_IN_CHAT",
103
+ "MESSAGE_IN_CHAT",
80
104
  "Manager",
105
+ "MediaGroupReplyHandler",
81
106
  "MessageCute",
82
107
  "MessageReplyHandler",
83
108
  "MessageReturnManager",
84
109
  "MessageRule",
85
110
  "MessageView",
111
+ "PhotoReplyHandler",
86
112
  "Polling",
87
113
  "RawEventView",
88
114
  "ShortState",
89
- "Choice",
115
+ "StateViewHasher",
116
+ "StickerReplyHandler",
90
117
  "Telegrinder",
91
118
  "UpdateCute",
119
+ "VideoReplyHandler",
92
120
  "ViewBox",
93
121
  "WaiterMachine",
94
- "register_manager",
95
122
  "clear_wm_storage_worker",
123
+ "register_manager",
96
124
  )