maxapi 0.5__tar.gz → 0.7__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.
Files changed (213) hide show
  1. maxapi-0.7/MANIFEST.in +2 -0
  2. {maxapi-0.5 → maxapi-0.7}/PKG-INFO +5 -6
  3. maxapi-0.7/maxapi/bot.py +676 -0
  4. {maxapi-0.5 → maxapi-0.7}/maxapi/connection/base.py +34 -1
  5. maxapi-0.7/maxapi/context/__init__.py +93 -0
  6. maxapi-0.7/maxapi/context/state_machine.py +34 -0
  7. {maxapi-0.5 → maxapi-0.7}/maxapi/dispatcher.py +61 -5
  8. maxapi-0.7/maxapi/enums/api_path.py +22 -0
  9. maxapi-0.7/maxapi/enums/attachment.py +19 -0
  10. maxapi-0.7/maxapi/enums/button_type.py +16 -0
  11. maxapi-0.7/maxapi/enums/chat_permission.py +17 -0
  12. maxapi-0.7/maxapi/enums/chat_status.py +16 -0
  13. maxapi-0.7/maxapi/enums/chat_type.py +13 -0
  14. maxapi-0.7/maxapi/enums/http_method.py +16 -0
  15. maxapi-0.7/maxapi/enums/intent.py +14 -0
  16. maxapi-0.7/maxapi/enums/message_link_type.py +13 -0
  17. maxapi-0.7/maxapi/enums/parse_mode.py +13 -0
  18. maxapi-0.7/maxapi/enums/sender_action.py +17 -0
  19. maxapi-0.7/maxapi/enums/text_style.py +20 -0
  20. {maxapi-0.5 → maxapi-0.7}/maxapi/enums/update.py +9 -0
  21. maxapi-0.7/maxapi/enums/upload_type.py +15 -0
  22. maxapi-0.7/maxapi/filters/handler.py +53 -0
  23. maxapi-0.7/maxapi/methods/add_admin_chat.py +62 -0
  24. maxapi-0.7/maxapi/methods/add_members_chat.py +58 -0
  25. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/change_info.py +19 -0
  26. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/delete_bot_from_chat.py +18 -1
  27. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/delete_chat.py +17 -0
  28. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/delete_message.py +19 -0
  29. maxapi-0.7/maxapi/methods/delete_pin_message.py +47 -0
  30. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/edit_chat.py +26 -2
  31. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/edit_message.py +26 -0
  32. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/get_chat_by_id.py +16 -0
  33. maxapi-0.7/maxapi/methods/get_chat_by_link.py +57 -0
  34. maxapi-0.7/maxapi/methods/get_chats.py +62 -0
  35. maxapi-0.7/maxapi/methods/get_list_admin_chat.py +51 -0
  36. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/get_me.py +16 -4
  37. maxapi-0.7/maxapi/methods/get_me_from_chat.py +51 -0
  38. maxapi-0.7/maxapi/methods/get_members_chat.py +72 -0
  39. maxapi-0.7/maxapi/methods/get_messages.py +89 -0
  40. maxapi-0.7/maxapi/methods/get_pinned_message.py +46 -0
  41. maxapi-0.7/maxapi/methods/get_updates.py +60 -0
  42. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/get_upload_url.py +21 -0
  43. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/get_video.py +18 -5
  44. maxapi-0.7/maxapi/methods/pin_message.py +67 -0
  45. maxapi-0.7/maxapi/methods/remove_admin.py +56 -0
  46. maxapi-0.7/maxapi/methods/remove_member_chat.py +68 -0
  47. maxapi-0.7/maxapi/methods/send_action.py +63 -0
  48. maxapi-0.7/maxapi/methods/send_callback.py +74 -0
  49. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/send_message.py +41 -3
  50. maxapi-0.7/maxapi/methods/types/added_admin_chat.py +16 -0
  51. maxapi-0.7/maxapi/methods/types/added_members_chat.py +16 -0
  52. maxapi-0.7/maxapi/methods/types/deleted_bot_from_chat.py +16 -0
  53. maxapi-0.7/maxapi/methods/types/deleted_chat.py +16 -0
  54. maxapi-0.7/maxapi/methods/types/deleted_message.py +16 -0
  55. maxapi-0.7/maxapi/methods/types/deleted_pin_message.py +16 -0
  56. maxapi-0.7/maxapi/methods/types/edited_message.py +16 -0
  57. maxapi-0.7/maxapi/methods/types/getted_list_admin_chat.py +18 -0
  58. maxapi-0.7/maxapi/methods/types/getted_members_chat.py +18 -0
  59. maxapi-0.7/maxapi/methods/types/getted_pineed_message.py +16 -0
  60. maxapi-0.7/maxapi/methods/types/getted_upload_url.py +7 -0
  61. maxapi-0.7/maxapi/methods/types/pinned_message.py +16 -0
  62. maxapi-0.7/maxapi/methods/types/removed_admin.py +16 -0
  63. maxapi-0.7/maxapi/methods/types/removed_member_chat.py +16 -0
  64. maxapi-0.7/maxapi/methods/types/sended_action.py +16 -0
  65. maxapi-0.7/maxapi/methods/types/sended_callback.py +24 -0
  66. maxapi-0.7/maxapi/methods/types/sended_message.py +15 -0
  67. maxapi-0.7/maxapi/types/attachments/attachment.py +103 -0
  68. maxapi-0.7/maxapi/types/attachments/audio.py +17 -0
  69. maxapi-0.7/maxapi/types/attachments/buttons/attachment_button.py +18 -0
  70. maxapi-0.7/maxapi/types/attachments/buttons/button.py +20 -0
  71. maxapi-0.7/maxapi/types/attachments/buttons/callback_button.py +23 -0
  72. maxapi-0.7/maxapi/types/attachments/buttons/chat_button.py +22 -0
  73. maxapi-0.7/maxapi/types/attachments/buttons/link_button.py +15 -0
  74. maxapi-0.7/maxapi/types/attachments/buttons/request_contact.py +8 -0
  75. maxapi-0.7/maxapi/types/attachments/buttons/request_geo_location_button.py +13 -0
  76. maxapi-0.7/maxapi/types/attachments/contact.py +15 -0
  77. maxapi-0.7/maxapi/types/attachments/file.py +19 -0
  78. maxapi-0.7/maxapi/types/attachments/image.py +32 -0
  79. maxapi-0.7/maxapi/types/attachments/location.py +19 -0
  80. maxapi-0.7/maxapi/types/attachments/share.py +21 -0
  81. maxapi-0.7/maxapi/types/attachments/sticker.py +19 -0
  82. maxapi-0.7/maxapi/types/attachments/upload.py +29 -0
  83. maxapi-0.7/maxapi/types/attachments/video.py +72 -0
  84. maxapi-0.7/maxapi/types/callback.py +22 -0
  85. maxapi-0.7/maxapi/types/chats.py +120 -0
  86. maxapi-0.7/maxapi/types/command.py +43 -0
  87. maxapi-0.7/maxapi/types/errors.py +15 -0
  88. maxapi-0.7/maxapi/types/input_media.py +52 -0
  89. maxapi-0.7/maxapi/types/message.py +299 -0
  90. maxapi-0.7/maxapi/types/updates/bot_added.py +32 -0
  91. maxapi-0.7/maxapi/types/updates/bot_removed.py +32 -0
  92. maxapi-0.7/maxapi/types/updates/bot_started.py +35 -0
  93. maxapi-0.7/maxapi/types/updates/chat_title_changed.py +34 -0
  94. maxapi-0.7/maxapi/types/updates/message_callback.py +125 -0
  95. maxapi-0.7/maxapi/types/updates/message_created.py +41 -0
  96. maxapi-0.7/maxapi/types/updates/message_edited.py +38 -0
  97. maxapi-0.7/maxapi/types/updates/message_removed.py +40 -0
  98. maxapi-0.7/maxapi/types/updates/update.py +20 -0
  99. maxapi-0.7/maxapi/types/updates/user_added.py +43 -0
  100. maxapi-0.7/maxapi/types/updates/user_removed.py +42 -0
  101. maxapi-0.7/maxapi/types/users.py +56 -0
  102. maxapi-0.7/maxapi/utils/inline_keyboard.py +50 -0
  103. {maxapi-0.5 → maxapi-0.7}/maxapi.egg-info/PKG-INFO +5 -6
  104. {maxapi-0.5 → maxapi-0.7}/maxapi.egg-info/SOURCES.txt +2 -2
  105. maxapi-0.7/pyproject.toml +31 -0
  106. maxapi-0.7/setup.cfg +4 -0
  107. maxapi-0.5/maxapi/bot.py +0 -358
  108. maxapi-0.5/maxapi/context/__init__.py +0 -39
  109. maxapi-0.5/maxapi/context/state_machine.py +0 -16
  110. maxapi-0.5/maxapi/enums/api_path.py +0 -14
  111. maxapi-0.5/maxapi/enums/attachment.py +0 -11
  112. maxapi-0.5/maxapi/enums/button_type.py +0 -9
  113. maxapi-0.5/maxapi/enums/chat_permission.py +0 -10
  114. maxapi-0.5/maxapi/enums/chat_status.py +0 -9
  115. maxapi-0.5/maxapi/enums/chat_type.py +0 -6
  116. maxapi-0.5/maxapi/enums/http_method.py +0 -9
  117. maxapi-0.5/maxapi/enums/intent.py +0 -6
  118. maxapi-0.5/maxapi/enums/message_link_type.py +0 -6
  119. maxapi-0.5/maxapi/enums/parse_mode.py +0 -5
  120. maxapi-0.5/maxapi/enums/sender_action.py +0 -9
  121. maxapi-0.5/maxapi/enums/text_style.py +0 -13
  122. maxapi-0.5/maxapi/enums/upload_type.py +0 -8
  123. maxapi-0.5/maxapi/filters/handler.py +0 -35
  124. maxapi-0.5/maxapi/methods/add_admin_chat.py +0 -43
  125. maxapi-0.5/maxapi/methods/add_members_chat.py +0 -39
  126. maxapi-0.5/maxapi/methods/delete_pin_message.py +0 -29
  127. maxapi-0.5/maxapi/methods/get_chat_by_link.py +0 -37
  128. maxapi-0.5/maxapi/methods/get_chats.py +0 -41
  129. maxapi-0.5/maxapi/methods/get_list_admin_chat.py +0 -31
  130. maxapi-0.5/maxapi/methods/get_me_from_chat.py +0 -32
  131. maxapi-0.5/maxapi/methods/get_members_chat.py +0 -44
  132. maxapi-0.5/maxapi/methods/get_messages.py +0 -60
  133. maxapi-0.5/maxapi/methods/get_pinned_message.py +0 -32
  134. maxapi-0.5/maxapi/methods/get_updates.py +0 -43
  135. maxapi-0.5/maxapi/methods/pin_message.py +0 -42
  136. maxapi-0.5/maxapi/methods/remove_admin.py +0 -36
  137. maxapi-0.5/maxapi/methods/remove_member_chat.py +0 -42
  138. maxapi-0.5/maxapi/methods/send_action.py +0 -43
  139. maxapi-0.5/maxapi/methods/send_callback.py +0 -53
  140. maxapi-0.5/maxapi/methods/types/added_admin_chat.py +0 -9
  141. maxapi-0.5/maxapi/methods/types/added_members_chat.py +0 -9
  142. maxapi-0.5/maxapi/methods/types/deleted_bot_from_chat.py +0 -7
  143. maxapi-0.5/maxapi/methods/types/deleted_chat.py +0 -7
  144. maxapi-0.5/maxapi/methods/types/deleted_message.py +0 -7
  145. maxapi-0.5/maxapi/methods/types/deleted_pin_message.py +0 -7
  146. maxapi-0.5/maxapi/methods/types/edited_message.py +0 -7
  147. maxapi-0.5/maxapi/methods/types/getted_list_admin_chat.py +0 -9
  148. maxapi-0.5/maxapi/methods/types/getted_members_chat.py +0 -9
  149. maxapi-0.5/maxapi/methods/types/getted_pineed_message.py +0 -8
  150. maxapi-0.5/maxapi/methods/types/getted_upload_url.py +0 -9
  151. maxapi-0.5/maxapi/methods/types/pinned_message.py +0 -7
  152. maxapi-0.5/maxapi/methods/types/removed_admin.py +0 -7
  153. maxapi-0.5/maxapi/methods/types/removed_member_chat.py +0 -9
  154. maxapi-0.5/maxapi/methods/types/sended_action.py +0 -7
  155. maxapi-0.5/maxapi/methods/types/sended_callback.py +0 -14
  156. maxapi-0.5/maxapi/methods/types/sended_message.py +0 -8
  157. maxapi-0.5/maxapi/methods/types/upload_file_response.py +0 -5
  158. maxapi-0.5/maxapi/types/attachments/attachment.py +0 -50
  159. maxapi-0.5/maxapi/types/attachments/audio.py +0 -8
  160. maxapi-0.5/maxapi/types/attachments/buttons/attachment_button.py +0 -9
  161. maxapi-0.5/maxapi/types/attachments/buttons/button.py +0 -12
  162. maxapi-0.5/maxapi/types/attachments/buttons/callback_button.py +0 -12
  163. maxapi-0.5/maxapi/types/attachments/buttons/chat_button.py +0 -11
  164. maxapi-0.5/maxapi/types/attachments/buttons/link_button.py +0 -7
  165. maxapi-0.5/maxapi/types/attachments/buttons/request_contact.py +0 -5
  166. maxapi-0.5/maxapi/types/attachments/buttons/request_geo_location_button.py +0 -5
  167. maxapi-0.5/maxapi/types/attachments/contact.py +0 -7
  168. maxapi-0.5/maxapi/types/attachments/file.py +0 -9
  169. maxapi-0.5/maxapi/types/attachments/image.py +0 -14
  170. maxapi-0.5/maxapi/types/attachments/location.py +0 -9
  171. maxapi-0.5/maxapi/types/attachments/share.py +0 -10
  172. maxapi-0.5/maxapi/types/attachments/sticker.py +0 -9
  173. maxapi-0.5/maxapi/types/attachments/upload.py +0 -14
  174. maxapi-0.5/maxapi/types/attachments/video.py +0 -35
  175. maxapi-0.5/maxapi/types/callback.py +0 -11
  176. maxapi-0.5/maxapi/types/chats.py +0 -57
  177. maxapi-0.5/maxapi/types/command.py +0 -18
  178. maxapi-0.5/maxapi/types/errors.py +0 -6
  179. maxapi-0.5/maxapi/types/input_media.py +0 -24
  180. maxapi-0.5/maxapi/types/message.py +0 -154
  181. maxapi-0.5/maxapi/types/updates/bot_added.py +0 -21
  182. maxapi-0.5/maxapi/types/updates/bot_removed.py +0 -21
  183. maxapi-0.5/maxapi/types/updates/bot_started.py +0 -23
  184. maxapi-0.5/maxapi/types/updates/chat_title_changed.py +0 -22
  185. maxapi-0.5/maxapi/types/updates/message_callback.py +0 -76
  186. maxapi-0.5/maxapi/types/updates/message_created.py +0 -22
  187. maxapi-0.5/maxapi/types/updates/message_edited.py +0 -19
  188. maxapi-0.5/maxapi/types/updates/message_removed.py +0 -21
  189. maxapi-0.5/maxapi/types/updates/update.py +0 -11
  190. maxapi-0.5/maxapi/types/updates/user_added.py +0 -23
  191. maxapi-0.5/maxapi/types/updates/user_removed.py +0 -22
  192. maxapi-0.5/maxapi/types/users.py +0 -29
  193. maxapi-0.5/maxapi/utils/inline_keyboard.py +0 -18
  194. maxapi-0.5/setup.cfg +0 -31
  195. {maxapi-0.5 → maxapi-0.7}/README.md +0 -0
  196. {maxapi-0.5 → maxapi-0.7}/maxapi/__init__.py +0 -0
  197. {maxapi-0.5 → maxapi-0.7}/maxapi/connection/__init__.py +0 -0
  198. {maxapi-0.5 → maxapi-0.7}/maxapi/enums/__init__.py +0 -0
  199. {maxapi-0.5 → maxapi-0.7}/maxapi/filters/__init__.py +0 -0
  200. {maxapi-0.5 → maxapi-0.7}/maxapi/loggers.py +0 -0
  201. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/__init__.py +0 -0
  202. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/types/__init__.py +0 -0
  203. {maxapi-0.5 → maxapi-0.7}/maxapi/methods/types/getted_updates.py +0 -0
  204. {maxapi-0.5 → maxapi-0.7}/maxapi/types/__init__.py +0 -0
  205. {maxapi-0.5 → maxapi-0.7}/maxapi/types/attachments/__init__.py +0 -0
  206. {maxapi-0.5 → maxapi-0.7}/maxapi/types/attachments/buttons/__init__.py +0 -0
  207. {maxapi-0.5 → maxapi-0.7}/maxapi/types/updates/__init__.py +0 -0
  208. {maxapi-0.5 → maxapi-0.7}/maxapi/types/updates/message_chat_created.py +0 -0
  209. {maxapi-0.5 → maxapi-0.7}/maxapi/utils/__init__.py +0 -0
  210. {maxapi-0.5 → maxapi-0.7}/maxapi.egg-info/dependency_links.txt +0 -0
  211. {maxapi-0.5 → maxapi-0.7}/maxapi.egg-info/requires.txt +0 -0
  212. {maxapi-0.5 → maxapi-0.7}/maxapi.egg-info/top_level.txt +0 -0
  213. {maxapi-0.5 → maxapi-0.7}/setup.py +0 -0
maxapi-0.7/MANIFEST.in ADDED
@@ -0,0 +1,2 @@
1
+ include LICENSE.md
2
+ include README.md
@@ -1,13 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maxapi
3
- Version: 0.5
4
- Summary: Библиотека для разработки чат-бото с помощью API мессенджера MAX
5
- Home-page: https://github.com/love-apples/maxapi/tree/main
6
- Author: Denis
7
- License: MIT
3
+ Version: 0.7
4
+ Summary: Библиотека для разработки чат-ботов с помощью API мессенджера MAX
5
+ Author-email: Denis <your-email@example.com>
6
+ Project-URL: Homepage, https://github.com/love-apples/maxapi
8
7
  Keywords: max,api,bot
9
- Classifier: License :: OSI Approved :: MIT License
10
8
  Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
11
10
  Requires-Python: >=3.10
12
11
  Description-Content-Type: text/markdown
13
12
  Requires-Dist: aiohttp>=3.8.0
@@ -0,0 +1,676 @@
1
+ from datetime import datetime
2
+ from typing import Any, Dict, List, TYPE_CHECKING
3
+
4
+ from .methods.get_upload_url import GetUploadURL
5
+ from .methods.get_updates import GetUpdates
6
+ from .methods.remove_member_chat import RemoveMemberChat
7
+ from .methods.add_admin_chat import AddAdminChat
8
+ from .methods.add_members_chat import AddMembersChat
9
+ from .methods.get_members_chat import GetMembersChat
10
+ from .methods.remove_admin import RemoveAdmin
11
+ from .methods.get_list_admin_chat import GetListAdminChat
12
+ from .methods.delete_bot_from_chat import DeleteMeFromMessage
13
+ from .methods.get_me_from_chat import GetMeFromChat
14
+ from .methods.delete_pin_message import DeletePinMessage
15
+ from .methods.get_pinned_message import GetPinnedMessage
16
+ from .methods.pin_message import PinMessage
17
+ from .methods.delete_chat import DeleteChat
18
+ from .methods.send_action import SendAction
19
+ from .methods.edit_chat import EditChat
20
+ from .methods.get_chat_by_id import GetChatById
21
+ from .methods.get_chat_by_link import GetChatByLink
22
+ from .methods.send_callback import SendCallback
23
+ from .methods.get_video import GetVideo
24
+ from .methods.delete_message import DeleteMessage
25
+ from .methods.edit_message import EditMessage
26
+ from .methods.change_info import ChangeInfo
27
+ from .methods.get_me import GetMe
28
+ from .methods.get_messages import GetMessages
29
+ from .methods.get_chats import GetChats
30
+ from .methods.send_message import SendMessage
31
+
32
+ from .enums.parse_mode import ParseMode
33
+ from .enums.sender_action import SenderAction
34
+ from .enums.upload_type import UploadType
35
+
36
+ from .types.message import Message
37
+ from .types.attachments.attachment import Attachment
38
+ from .types.attachments.image import PhotoAttachmentRequestPayload
39
+ from .types.message import Messages, NewMessageLink
40
+ from .types.users import ChatAdmin, User
41
+ from .types.command import BotCommand
42
+
43
+ from .connection.base import BaseConnection
44
+
45
+ from .methods.types.added_admin_chat import AddedListAdminChat
46
+ from .methods.types.added_members_chat import AddedMembersChat
47
+ from .methods.types.deleted_bot_from_chat import DeletedBotFromChat
48
+ from .methods.types.deleted_chat import DeletedChat
49
+ from .methods.types.deleted_message import DeletedMessage
50
+ from .methods.types.deleted_pin_message import DeletedPinMessage
51
+ from .methods.types.edited_message import EditedMessage
52
+ from .methods.types.getted_list_admin_chat import GettedListAdminChat
53
+ from .methods.types.getted_members_chat import GettedMembersChat
54
+ from .methods.types.getted_pineed_message import GettedPin
55
+ from .methods.types.getted_upload_url import GettedUploadUrl
56
+ from .methods.types.pinned_message import PinnedMessage
57
+ from .methods.types.removed_admin import RemovedAdmin
58
+ from .methods.types.removed_member_chat import RemovedMemberChat
59
+ from .methods.types.sended_action import SendedAction
60
+ from .methods.types.sended_callback import SendedCallback
61
+ from .methods.types.sended_message import SendedMessage
62
+ from .types.attachments.video import Video
63
+ from .types.chats import Chat, ChatMember, Chats
64
+ from .types.updates import UpdateUnion
65
+
66
+
67
+ class Bot(BaseConnection):
68
+
69
+ """Основной класс для работы с API бота.
70
+
71
+ Предоставляет методы для взаимодействия с чатами, сообщениями,
72
+ пользователями и другими функциями бота.
73
+ """
74
+
75
+ def __init__(self, token: str):
76
+
77
+ """Инициализирует экземпляр бота с указанным токеном.
78
+
79
+ :param token: Токен доступа к API бота
80
+ """
81
+
82
+ super().__init__()
83
+
84
+ self.bot = self
85
+
86
+ self.__token = token
87
+ self.params = {'access_token': self.__token}
88
+ self.marker_updates = None
89
+
90
+ async def send_message(
91
+ self,
92
+ chat_id: int = None,
93
+ user_id: int = None,
94
+ disable_link_preview: bool = False,
95
+ text: str = None,
96
+ attachments: List[Attachment] = None,
97
+ link: NewMessageLink = None,
98
+ notify: bool = True,
99
+ parse_mode: ParseMode = None
100
+ ) -> SendedMessage:
101
+
102
+ """Отправляет сообщение в чат или пользователю.
103
+
104
+ :param chat_id: ID чата для отправки (обязателен, если не указан user_id)
105
+ :param user_id: ID пользователя для отправки (обязателен, если не указан chat_id)
106
+ :param disable_link_preview: Отключить предпросмотр ссылок (по умолчанию False)
107
+ :param text: Текст сообщения
108
+ :param attachments: Список вложений к сообщению
109
+ :param link: Данные ссылки сообщения
110
+ :param notify: Отправлять уведомление получателю (по умолчанию True)
111
+ :param parse_mode: Режим форматирования текста
112
+
113
+ :return: Объект отправленного сообщения
114
+ """
115
+
116
+ return await SendMessage(
117
+ bot=self,
118
+ chat_id=chat_id,
119
+ user_id=user_id,
120
+ disable_link_preview=disable_link_preview,
121
+ text=text,
122
+ attachments=attachments,
123
+ link=link,
124
+ notify=notify,
125
+ parse_mode=parse_mode
126
+ ).request()
127
+
128
+ async def send_action(
129
+ self,
130
+ chat_id: int = None,
131
+ action: SenderAction = SenderAction.TYPING_ON
132
+ ) -> SendedAction:
133
+
134
+ """Отправляет действие в чат (например, "печатает").
135
+
136
+ :param chat_id: ID чата для отправки действия
137
+ :param action: Тип действия (по умолчанию SenderAction.TYPING_ON)
138
+
139
+ :return: Результат отправки действия
140
+ """
141
+
142
+ return await SendAction(
143
+ bot=self,
144
+ chat_id=chat_id,
145
+ action=action
146
+ ).request()
147
+
148
+ async def edit_message(
149
+ self,
150
+ message_id: str,
151
+ text: str = None,
152
+ attachments: List[Attachment] = None,
153
+ link: NewMessageLink = None,
154
+ notify: bool = True,
155
+ parse_mode: ParseMode = None
156
+ ) -> EditedMessage:
157
+
158
+ """Редактирует существующее сообщение.
159
+
160
+ :param message_id: ID сообщения для редактирования
161
+ :param text: Новый текст сообщения
162
+ :param attachments: Новые вложения
163
+ :param link: Новая ссылка сообщения
164
+ :param notify: Уведомлять получателя об изменении (по умолчанию True)
165
+ :param parse_mode: Режим форматирования текста
166
+
167
+ :return: Объект отредактированного сообщения
168
+ """
169
+
170
+ return await EditMessage(
171
+ bot=self,
172
+ message_id=message_id,
173
+ text=text,
174
+ attachments=attachments,
175
+ link=link,
176
+ notify=notify,
177
+ parse_mode=parse_mode
178
+ ).request()
179
+
180
+ async def delete_message(
181
+ self,
182
+ message_id: str
183
+ ) -> DeletedMessage:
184
+
185
+ """Удаляет сообщение.
186
+
187
+ :param message_id: ID сообщения для удаления
188
+
189
+ :return: Результат удаления сообщения
190
+ """
191
+
192
+ return await DeleteMessage(
193
+ bot=self,
194
+ message_id=message_id,
195
+ ).request()
196
+
197
+ async def delete_chat(
198
+ self,
199
+ chat_id: int
200
+ ) -> DeletedChat:
201
+
202
+ """Удаляет чат.
203
+
204
+ :param chat_id: ID чата для удаления
205
+
206
+ :return: Результат удаления чата
207
+ """
208
+
209
+ return await DeleteChat(
210
+ bot=self,
211
+ chat_id=chat_id,
212
+ ).request()
213
+
214
+ async def get_messages(
215
+ self,
216
+ chat_id: int = None,
217
+ message_ids: List[str] = None,
218
+ from_time: datetime | int = None,
219
+ to_time: datetime | int = None,
220
+ count: int = 50,
221
+ ) -> Messages:
222
+
223
+ """Получает сообщения из чата.
224
+
225
+ :param chat_id: ID чата (обязателен, если не указаны message_ids)
226
+ :param message_ids: Список ID сообщений для получения
227
+ :param from_time: Время начала периода (datetime или timestamp)
228
+ :param to_time: Время конца периода (datetime или timestamp)
229
+ :param count: Количество сообщений (по умолчанию 50)
230
+
231
+ :return: Список сообщений
232
+ """
233
+
234
+ return await GetMessages(
235
+ bot=self,
236
+ chat_id=chat_id,
237
+ message_ids=message_ids,
238
+ from_time=from_time,
239
+ to_time=to_time,
240
+ count=count
241
+ ).request()
242
+
243
+ async def get_message(
244
+ self,
245
+ message_id: str
246
+ ) -> Messages:
247
+
248
+ """Получает одно сообщение по ID.
249
+
250
+ :param message_id: ID сообщения
251
+
252
+ :return: Объект сообщения
253
+ """
254
+
255
+ return await self.get_messages(
256
+ message_ids=[message_id]
257
+ )
258
+
259
+ async def get_me(self) -> User:
260
+
261
+ """Получает информацию о текущем боте.
262
+
263
+ :return: Объект пользователя бота
264
+ """
265
+
266
+ return await GetMe(self).request()
267
+
268
+ async def get_pin_message(
269
+ self,
270
+ chat_id: int
271
+ ) -> GettedPin:
272
+
273
+ """Получает закрепленное сообщение в чате.
274
+
275
+ :param chat_id: ID чата
276
+
277
+ :return: Закрепленное сообщение
278
+ """
279
+
280
+ return await GetPinnedMessage(
281
+ bot=self,
282
+ chat_id=chat_id
283
+ ).request()
284
+
285
+ async def change_info(
286
+ self,
287
+ name: str = None,
288
+ description: str = None,
289
+ commands: List[BotCommand] = None,
290
+ photo: Dict[str, Any] = None
291
+ ) -> User:
292
+
293
+ """Изменяет информацию о боте.
294
+
295
+ :param name: Новое имя бота
296
+ :param description: Новое описание бота
297
+ :param commands: Список команд бота
298
+ :param photo: Данные фотографии бота
299
+
300
+ :return: Обновленная информация о боте
301
+ """
302
+
303
+ return await ChangeInfo(
304
+ bot=self,
305
+ name=name,
306
+ description=description,
307
+ commands=commands,
308
+ photo=photo
309
+ ).request()
310
+
311
+ async def get_chats(
312
+ self,
313
+ count: int = 50,
314
+ marker: int = None
315
+ ) -> Chats:
316
+
317
+ """Получает список чатов бота.
318
+
319
+ :param count: Количество чатов (по умолчанию 50)
320
+ :param marker: Маркер для пагинации
321
+
322
+ :return: Список чатов
323
+ """
324
+
325
+ return await GetChats(
326
+ bot=self,
327
+ count=count,
328
+ marker=marker
329
+ ).request()
330
+
331
+ async def get_chat_by_link(
332
+ self,
333
+ link: str
334
+ ) -> Chat:
335
+
336
+ """Получает чат по ссылке.
337
+
338
+ :param link: Ссылка на чат
339
+
340
+ :return: Объект чата
341
+ """
342
+
343
+ return await GetChatByLink(bot=self, link=link).request()
344
+
345
+ async def get_chat_by_id(
346
+ self,
347
+ id: int
348
+ ) -> Chat:
349
+
350
+ """Получает чат по ID.
351
+
352
+ :param id: ID чата
353
+
354
+ :return: Объект чата
355
+ """
356
+
357
+ return await GetChatById(bot=self, id=id).request()
358
+
359
+ async def edit_chat(
360
+ self,
361
+ chat_id: int,
362
+ icon: PhotoAttachmentRequestPayload = None,
363
+ title: str = None,
364
+ pin: str = None,
365
+ notify: bool = True,
366
+ ) -> Chat:
367
+
368
+ """Редактирует параметры чата.
369
+
370
+ :param chat_id: ID чата
371
+ :param icon: Данные иконки чата
372
+ :param title: Новый заголовок чата
373
+ :param pin: ID сообщения для закрепления
374
+ :param notify: Уведомлять участников (по умолчанию True)
375
+
376
+ :return: Обновленный объект чата
377
+ """
378
+
379
+ return await EditChat(
380
+ bot=self,
381
+ chat_id=chat_id,
382
+ icon=icon,
383
+ title=title,
384
+ pin=pin,
385
+ notify=notify
386
+ ).request()
387
+
388
+ async def get_video(
389
+ self,
390
+ video_token: str
391
+ ) -> Video:
392
+
393
+ """Получает видео по токену.
394
+
395
+ :param video_token: Токен видео
396
+
397
+ :return: Объект видео
398
+ """
399
+
400
+ return await GetVideo(
401
+ bot=self,
402
+ video_token=video_token
403
+ ).request()
404
+
405
+ async def send_callback(
406
+ self,
407
+ callback_id: str,
408
+ message: 'Message' = None,
409
+ notification: str = None
410
+ ) -> SendedCallback:
411
+
412
+ """Отправляет callback ответ.
413
+
414
+ :param callback_id: ID callback
415
+ :param message: Сообщение для отправки
416
+ :param notification: Текст уведомления
417
+
418
+ :return: Результат отправки callback
419
+ """
420
+
421
+ return await SendCallback(
422
+ bot=self,
423
+ callback_id=callback_id,
424
+ message=message,
425
+ notification=notification
426
+ ).request()
427
+
428
+ async def pin_message(
429
+ self,
430
+ chat_id: int,
431
+ message_id: str,
432
+ notify: bool = True
433
+ ) -> PinnedMessage:
434
+
435
+ """Закрепляет сообщение в чате.
436
+
437
+ :param chat_id: ID чата
438
+ :param message_id: ID сообщения
439
+ :param notify: Уведомлять участников (по умолчанию True)
440
+
441
+ :return: Закрепленное сообщение
442
+ """
443
+
444
+ return await PinMessage(
445
+ bot=self,
446
+ chat_id=chat_id,
447
+ message_id=message_id,
448
+ notify=notify
449
+ ).request()
450
+
451
+ async def delete_pin_message(
452
+ self,
453
+ chat_id: int,
454
+ ) -> DeletedPinMessage:
455
+
456
+ """Удаляет закрепленное сообщение в чате.
457
+
458
+ :param chat_id: ID чата
459
+
460
+ :return: Результат удаления
461
+ """
462
+
463
+ return await DeletePinMessage(
464
+ bot=self,
465
+ chat_id=chat_id,
466
+ ).request()
467
+
468
+ async def get_me_from_chat(
469
+ self,
470
+ chat_id: int,
471
+ ) -> ChatMember:
472
+
473
+ """Получает информацию о боте в конкретном чате.
474
+
475
+ :param chat_id: ID чата
476
+
477
+ :return: Информация о боте в чате
478
+ """
479
+
480
+ return await GetMeFromChat(
481
+ bot=self,
482
+ chat_id=chat_id,
483
+ ).request()
484
+
485
+ async def delete_me_from_chat(
486
+ self,
487
+ chat_id: int,
488
+ ) -> DeletedBotFromChat:
489
+
490
+ """Удаляет бота из чата.
491
+
492
+ :param chat_id: ID чата
493
+
494
+ :return: Результат удаления
495
+ """
496
+
497
+ return await DeleteMeFromMessage(
498
+ bot=self,
499
+ chat_id=chat_id,
500
+ ).request()
501
+
502
+ async def get_list_admin_chat(
503
+ self,
504
+ chat_id: int,
505
+ ) -> GettedListAdminChat:
506
+
507
+ """Получает список администраторов чата.
508
+
509
+ :param chat_id: ID чата
510
+
511
+ :return: Список администраторов
512
+ """
513
+
514
+ return await GetListAdminChat(
515
+ bot=self,
516
+ chat_id=chat_id,
517
+ ).request()
518
+
519
+ async def add_list_admin_chat(
520
+ self,
521
+ chat_id: int,
522
+ admins: List[ChatAdmin],
523
+ marker: int = None
524
+ ) -> AddedListAdminChat:
525
+
526
+ """Добавляет администраторов в чат.
527
+
528
+ :param chat_id: ID чата
529
+ :param admins: Список администраторов
530
+ :param marker: Маркер для пагинации
531
+
532
+ :return: Результат добавления
533
+ """
534
+
535
+ return await AddAdminChat(
536
+ bot=self,
537
+ chat_id=chat_id,
538
+ admins=admins,
539
+ marker=marker,
540
+ ).request()
541
+
542
+ async def remove_admin(
543
+ self,
544
+ chat_id: int,
545
+ user_id: int
546
+ ) -> RemovedAdmin:
547
+
548
+ """Удаляет администратора из чата.
549
+
550
+ :param chat_id: ID чата
551
+ :param user_id: ID пользователя
552
+
553
+ :return: Результат удаления
554
+ """
555
+
556
+ return await RemoveAdmin(
557
+ bot=self,
558
+ chat_id=chat_id,
559
+ user_id=user_id,
560
+ ).request()
561
+
562
+ async def get_chat_members(
563
+ self,
564
+ chat_id: int,
565
+ user_ids: List[int] = None,
566
+ marker: int = None,
567
+ count: int = None,
568
+ ) -> GettedMembersChat:
569
+
570
+ """Получает участников чата.
571
+
572
+ :param chat_id: ID чата
573
+ :param user_ids: Фильтр по ID пользователей
574
+ :param marker: Маркер для пагинации
575
+ :param count: Количество участников
576
+
577
+ :return: Список участников
578
+ """
579
+
580
+ return await GetMembersChat(
581
+ bot=self,
582
+ chat_id=chat_id,
583
+ user_ids=user_ids,
584
+ marker=marker,
585
+ count=count,
586
+ ).request()
587
+
588
+ async def add_chat_members(
589
+ self,
590
+ chat_id: int,
591
+ user_ids: List[str],
592
+ ) -> AddedMembersChat:
593
+
594
+ """Добавляет участников в чат.
595
+
596
+ :param chat_id: ID чата
597
+ :param user_ids: Список ID пользователей
598
+
599
+ :return: Результат добавления
600
+ """
601
+
602
+ return await AddMembersChat(
603
+ bot=self,
604
+ chat_id=chat_id,
605
+ user_ids=user_ids,
606
+ ).request()
607
+
608
+ async def kick_chat_member(
609
+ self,
610
+ chat_id: int,
611
+ user_id: int,
612
+ block: bool = False,
613
+ ) -> RemovedMemberChat:
614
+
615
+ """Исключает участника из чата.
616
+
617
+ :param chat_id: ID чата
618
+ :param user_id: ID пользователя
619
+ :param block: Блокировать пользователя (по умолчанию False)
620
+
621
+ :return: Результат исключения
622
+ """
623
+
624
+ return await RemoveMemberChat(
625
+ bot=self,
626
+ chat_id=chat_id,
627
+ user_id=user_id,
628
+ block=block,
629
+ ).request()
630
+
631
+ async def get_updates(
632
+ self,
633
+ ) -> UpdateUnion:
634
+
635
+ """Получает обновления для бота.
636
+
637
+ :return: Список обновлений
638
+ """
639
+
640
+ return await GetUpdates(
641
+ bot=self,
642
+ ).request()
643
+
644
+ async def get_upload_url(
645
+ self,
646
+ type: UploadType
647
+ ) -> GettedUploadUrl:
648
+
649
+ """Получает URL для загрузки файлов.
650
+
651
+ :param type: Тип загружаемого файла
652
+
653
+ :return: URL для загрузки
654
+ """
655
+
656
+ return await GetUploadURL(
657
+ bot=self,
658
+ type=type
659
+ ).request()
660
+
661
+ async def set_my_commands(
662
+ self,
663
+ *commands: BotCommand
664
+ ) -> User:
665
+
666
+ """Устанавливает список команд бота.
667
+
668
+ :param commands: Список команд
669
+
670
+ :return: Обновленная информация о боте
671
+ """
672
+
673
+ return await ChangeInfo(
674
+ bot=self,
675
+ commands=list(commands)
676
+ ).request()