ng-bot-api 0.1.0__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.
Files changed (193) hide show
  1. ng_bot_api/__init__.py +56 -0
  2. ng_bot_api/api_version.py +2 -0
  3. ng_bot_api/async_bot.py +97 -0
  4. ng_bot_api/core/__init__.py +31 -0
  5. ng_bot_api/core/base.py +36 -0
  6. ng_bot_api/core/caller.py +17 -0
  7. ng_bot_api/core/decoding.py +85 -0
  8. ng_bot_api/core/encoding.py +42 -0
  9. ng_bot_api/core/errors.py +75 -0
  10. ng_bot_api/core/input_file.py +56 -0
  11. ng_bot_api/core/polling.py +39 -0
  12. ng_bot_api/core/registry.py +72 -0
  13. ng_bot_api/core/request.py +67 -0
  14. ng_bot_api/core/typespec.py +57 -0
  15. ng_bot_api/dispatcher/__init__.py +17 -0
  16. ng_bot_api/dispatcher/dispatcher.py +95 -0
  17. ng_bot_api/dispatcher/filter_base.py +78 -0
  18. ng_bot_api/dispatcher/filters.py +124 -0
  19. ng_bot_api/dispatcher/handler.py +34 -0
  20. ng_bot_api/dispatcher/router.py +69 -0
  21. ng_bot_api/methods/__init__.py +115 -0
  22. ng_bot_api/methods/async_01.py +99 -0
  23. ng_bot_api/methods/async_02.py +114 -0
  24. ng_bot_api/methods/async_03.py +85 -0
  25. ng_bot_api/methods/async_04.py +110 -0
  26. ng_bot_api/methods/async_05.py +114 -0
  27. ng_bot_api/methods/async_06.py +74 -0
  28. ng_bot_api/methods/async_07.py +114 -0
  29. ng_bot_api/methods/async_08.py +106 -0
  30. ng_bot_api/methods/async_09.py +97 -0
  31. ng_bot_api/methods/async_10.py +92 -0
  32. ng_bot_api/methods/async_11.py +107 -0
  33. ng_bot_api/methods/async_12.py +119 -0
  34. ng_bot_api/methods/async_13.py +119 -0
  35. ng_bot_api/methods/async_14.py +113 -0
  36. ng_bot_api/methods/async_15.py +117 -0
  37. ng_bot_api/methods/async_16.py +115 -0
  38. ng_bot_api/methods/async_17.py +121 -0
  39. ng_bot_api/methods/async_18.py +118 -0
  40. ng_bot_api/methods/async_19.py +128 -0
  41. ng_bot_api/methods/async_20.py +115 -0
  42. ng_bot_api/methods/async_21.py +127 -0
  43. ng_bot_api/methods/async_22.py +110 -0
  44. ng_bot_api/methods/async_23.py +116 -0
  45. ng_bot_api/methods/async_24.py +118 -0
  46. ng_bot_api/methods/async_25.py +109 -0
  47. ng_bot_api/methods/async_26.py +124 -0
  48. ng_bot_api/methods/async_27.py +119 -0
  49. ng_bot_api/methods/async_28.py +119 -0
  50. ng_bot_api/methods/async_29.py +108 -0
  51. ng_bot_api/methods/async_30.py +115 -0
  52. ng_bot_api/methods/async_31.py +112 -0
  53. ng_bot_api/methods/async_32.py +126 -0
  54. ng_bot_api/methods/async_33.py +105 -0
  55. ng_bot_api/methods/async_34.py +117 -0
  56. ng_bot_api/methods/async_35.py +122 -0
  57. ng_bot_api/methods/async_36.py +121 -0
  58. ng_bot_api/methods/async_37.py +126 -0
  59. ng_bot_api/methods/async_38.py +112 -0
  60. ng_bot_api/methods/async_39.py +84 -0
  61. ng_bot_api/methods/async_40.py +125 -0
  62. ng_bot_api/methods/async_41.py +115 -0
  63. ng_bot_api/methods/async_42.py +30 -0
  64. ng_bot_api/methods/sync_01.py +99 -0
  65. ng_bot_api/methods/sync_02.py +114 -0
  66. ng_bot_api/methods/sync_03.py +85 -0
  67. ng_bot_api/methods/sync_04.py +110 -0
  68. ng_bot_api/methods/sync_05.py +114 -0
  69. ng_bot_api/methods/sync_06.py +74 -0
  70. ng_bot_api/methods/sync_07.py +114 -0
  71. ng_bot_api/methods/sync_08.py +106 -0
  72. ng_bot_api/methods/sync_09.py +97 -0
  73. ng_bot_api/methods/sync_10.py +92 -0
  74. ng_bot_api/methods/sync_11.py +107 -0
  75. ng_bot_api/methods/sync_12.py +119 -0
  76. ng_bot_api/methods/sync_13.py +119 -0
  77. ng_bot_api/methods/sync_14.py +113 -0
  78. ng_bot_api/methods/sync_15.py +117 -0
  79. ng_bot_api/methods/sync_16.py +115 -0
  80. ng_bot_api/methods/sync_17.py +121 -0
  81. ng_bot_api/methods/sync_18.py +118 -0
  82. ng_bot_api/methods/sync_19.py +128 -0
  83. ng_bot_api/methods/sync_20.py +115 -0
  84. ng_bot_api/methods/sync_21.py +127 -0
  85. ng_bot_api/methods/sync_22.py +110 -0
  86. ng_bot_api/methods/sync_23.py +116 -0
  87. ng_bot_api/methods/sync_24.py +118 -0
  88. ng_bot_api/methods/sync_25.py +109 -0
  89. ng_bot_api/methods/sync_26.py +124 -0
  90. ng_bot_api/methods/sync_27.py +119 -0
  91. ng_bot_api/methods/sync_28.py +119 -0
  92. ng_bot_api/methods/sync_29.py +108 -0
  93. ng_bot_api/methods/sync_30.py +115 -0
  94. ng_bot_api/methods/sync_31.py +112 -0
  95. ng_bot_api/methods/sync_32.py +126 -0
  96. ng_bot_api/methods/sync_33.py +105 -0
  97. ng_bot_api/methods/sync_34.py +117 -0
  98. ng_bot_api/methods/sync_35.py +122 -0
  99. ng_bot_api/methods/sync_36.py +121 -0
  100. ng_bot_api/methods/sync_37.py +126 -0
  101. ng_bot_api/methods/sync_38.py +112 -0
  102. ng_bot_api/methods/sync_39.py +84 -0
  103. ng_bot_api/methods/sync_40.py +125 -0
  104. ng_bot_api/methods/sync_41.py +115 -0
  105. ng_bot_api/methods/sync_42.py +30 -0
  106. ng_bot_api/py.typed +0 -0
  107. ng_bot_api/sync_bot.py +95 -0
  108. ng_bot_api/types/__init__.py +82 -0
  109. ng_bot_api/types/available_types_01.py +102 -0
  110. ng_bot_api/types/available_types_02.py +141 -0
  111. ng_bot_api/types/available_types_03.py +311 -0
  112. ng_bot_api/types/available_types_04.py +84 -0
  113. ng_bot_api/types/available_types_05.py +134 -0
  114. ng_bot_api/types/available_types_06.py +126 -0
  115. ng_bot_api/types/available_types_07.py +119 -0
  116. ng_bot_api/types/available_types_08.py +120 -0
  117. ng_bot_api/types/available_types_09.py +115 -0
  118. ng_bot_api/types/available_types_10.py +109 -0
  119. ng_bot_api/types/available_types_11.py +121 -0
  120. ng_bot_api/types/available_types_12.py +120 -0
  121. ng_bot_api/types/available_types_13.py +128 -0
  122. ng_bot_api/types/available_types_14.py +124 -0
  123. ng_bot_api/types/available_types_15.py +129 -0
  124. ng_bot_api/types/available_types_16.py +121 -0
  125. ng_bot_api/types/available_types_17.py +124 -0
  126. ng_bot_api/types/available_types_18.py +128 -0
  127. ng_bot_api/types/available_types_19.py +115 -0
  128. ng_bot_api/types/available_types_20.py +123 -0
  129. ng_bot_api/types/available_types_21.py +101 -0
  130. ng_bot_api/types/available_types_22.py +121 -0
  131. ng_bot_api/types/available_types_23.py +128 -0
  132. ng_bot_api/types/available_types_24.py +107 -0
  133. ng_bot_api/types/available_types_25.py +100 -0
  134. ng_bot_api/types/available_types_26.py +81 -0
  135. ng_bot_api/types/available_types_27.py +114 -0
  136. ng_bot_api/types/available_types_28.py +125 -0
  137. ng_bot_api/types/available_types_29.py +118 -0
  138. ng_bot_api/types/available_types_30.py +113 -0
  139. ng_bot_api/types/available_types_31.py +120 -0
  140. ng_bot_api/types/available_types_32.py +124 -0
  141. ng_bot_api/types/available_types_33.py +125 -0
  142. ng_bot_api/types/available_types_34.py +113 -0
  143. ng_bot_api/types/available_types_35.py +125 -0
  144. ng_bot_api/types/available_types_36.py +119 -0
  145. ng_bot_api/types/available_types_37.py +126 -0
  146. ng_bot_api/types/available_types_38.py +118 -0
  147. ng_bot_api/types/available_types_39.py +121 -0
  148. ng_bot_api/types/available_types_40.py +121 -0
  149. ng_bot_api/types/available_types_41.py +116 -0
  150. ng_bot_api/types/available_types_42.py +112 -0
  151. ng_bot_api/types/available_types_43.py +110 -0
  152. ng_bot_api/types/available_types_44.py +30 -0
  153. ng_bot_api/types/games_01.py +57 -0
  154. ng_bot_api/types/getting_updates_01.py +123 -0
  155. ng_bot_api/types/inline_mode_01.py +124 -0
  156. ng_bot_api/types/inline_mode_02.py +91 -0
  157. ng_bot_api/types/inline_mode_03.py +116 -0
  158. ng_bot_api/types/inline_mode_04.py +126 -0
  159. ng_bot_api/types/inline_mode_05.py +124 -0
  160. ng_bot_api/types/inline_mode_06.py +124 -0
  161. ng_bot_api/types/inline_mode_07.py +119 -0
  162. ng_bot_api/types/inline_mode_08.py +104 -0
  163. ng_bot_api/types/inline_mode_09.py +84 -0
  164. ng_bot_api/types/payments_01.py +124 -0
  165. ng_bot_api/types/payments_02.py +124 -0
  166. ng_bot_api/types/payments_03.py +119 -0
  167. ng_bot_api/types/payments_04.py +70 -0
  168. ng_bot_api/types/rich_messages_01.py +126 -0
  169. ng_bot_api/types/rich_messages_02.py +125 -0
  170. ng_bot_api/types/rich_messages_03.py +115 -0
  171. ng_bot_api/types/rich_messages_04.py +116 -0
  172. ng_bot_api/types/rich_messages_05.py +128 -0
  173. ng_bot_api/types/rich_messages_06.py +125 -0
  174. ng_bot_api/types/rich_messages_07.py +114 -0
  175. ng_bot_api/types/rich_messages_08.py +118 -0
  176. ng_bot_api/types/rich_messages_09.py +124 -0
  177. ng_bot_api/types/rich_messages_10.py +125 -0
  178. ng_bot_api/types/rich_messages_11.py +122 -0
  179. ng_bot_api/types/rich_messages_12.py +122 -0
  180. ng_bot_api/types/stickers_01.py +107 -0
  181. ng_bot_api/types/telegram_passport_01.py +120 -0
  182. ng_bot_api/types/telegram_passport_02.py +113 -0
  183. ng_bot_api/types/telegram_passport_03.py +24 -0
  184. ng_bot_api/types/unions_01.py +140 -0
  185. ng_bot_api/types/unions_02.py +132 -0
  186. ng_bot_api/types/unions_03.py +134 -0
  187. ng_bot_api/types/unions_04.py +149 -0
  188. ng_bot_api/types/unions_05.py +96 -0
  189. ng_bot_api/webhook.py +78 -0
  190. ng_bot_api-0.1.0.dist-info/METADATA +179 -0
  191. ng_bot_api-0.1.0.dist-info/RECORD +193 -0
  192. ng_bot_api-0.1.0.dist-info/WHEEL +4 -0
  193. ng_bot_api-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,110 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ BotAccessSettings, BusinessConnection, InlineQueryResult, SentGuestMessage, UserChatBoosts,
6
+ )
7
+
8
+
9
+ class AsyncMethods22(AsyncCaller):
10
+ __slots__ = ()
11
+
12
+ async def answer_guest_query(
13
+ self,
14
+ guest_query_id: str,
15
+ result: InlineQueryResult,
16
+ ) -> SentGuestMessage:
17
+ """Use this method to reply to a received guest message. On success, a SentGuestMessage object is returned.
18
+
19
+ Args:
20
+ guest_query_id: Unique identifier for the query to be answered
21
+ result: A JSON-serialized object describing the message to be sent
22
+
23
+ https://core.telegram.org/bots/api#answerguestquery
24
+ """
25
+ return await self._call('answerGuestQuery', locals(), 'SentGuestMessage')
26
+
27
+ async def get_user_chat_boosts(
28
+ self,
29
+ chat_id: int | str,
30
+ user_id: int,
31
+ ) -> UserChatBoosts:
32
+ """Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object.
33
+
34
+ Args:
35
+ chat_id: Unique identifier for the chat or username of the channel in the format @username
36
+ user_id: Unique identifier of the target user
37
+
38
+ https://core.telegram.org/bots/api#getuserchatboosts
39
+ """
40
+ return await self._call('getUserChatBoosts', locals(), 'UserChatBoosts')
41
+
42
+ async def get_business_connection(
43
+ self,
44
+ business_connection_id: str,
45
+ ) -> BusinessConnection:
46
+ """Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.
47
+
48
+ Args:
49
+ business_connection_id: Unique identifier of the business connection
50
+
51
+ https://core.telegram.org/bots/api#getbusinessconnection
52
+ """
53
+ return await self._call('getBusinessConnection', locals(), 'BusinessConnection')
54
+
55
+ async def get_managed_bot_token(
56
+ self,
57
+ user_id: int,
58
+ ) -> str:
59
+ """Use this method to get the token of a managed bot. Returns the token as String on success.
60
+
61
+ Args:
62
+ user_id: User identifier of the managed bot whose token will be returned
63
+
64
+ https://core.telegram.org/bots/api#getmanagedbottoken
65
+ """
66
+ return await self._call('getManagedBotToken', locals(), 'str')
67
+
68
+ async def replace_managed_bot_token(
69
+ self,
70
+ user_id: int,
71
+ ) -> str:
72
+ """Use this method to revoke the current token of a managed bot and generate a new one. Returns the new token as String on success.
73
+
74
+ Args:
75
+ user_id: User identifier of the managed bot whose token will be replaced
76
+
77
+ https://core.telegram.org/bots/api#replacemanagedbottoken
78
+ """
79
+ return await self._call('replaceManagedBotToken', locals(), 'str')
80
+
81
+ async def get_managed_bot_access_settings(
82
+ self,
83
+ user_id: int,
84
+ ) -> BotAccessSettings:
85
+ """Use this method to get the access settings of a managed bot. Returns a BotAccessSettings object on success.
86
+
87
+ Args:
88
+ user_id: User identifier of the managed bot whose access settings will be returned
89
+
90
+ https://core.telegram.org/bots/api#getmanagedbotaccesssettings
91
+ """
92
+ return await self._call('getManagedBotAccessSettings', locals(), 'BotAccessSettings')
93
+
94
+ async def set_managed_bot_access_settings(
95
+ self,
96
+ user_id: int,
97
+ is_access_restricted: bool,
98
+ *,
99
+ added_user_ids: list[int] | None = None,
100
+ ) -> bool:
101
+ """Use this method to change the access settings of a managed bot. Returns True on success.
102
+
103
+ Args:
104
+ user_id: User identifier of the managed bot whose access settings will be changed
105
+ is_access_restricted: Pass True if only selected users can access the bot. The bot's owner can always access it.
106
+ added_user_ids: A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if is_access_restricted is False.
107
+
108
+ https://core.telegram.org/bots/api#setmanagedbotaccesssettings
109
+ """
110
+ return await self._call('setManagedBotAccessSettings', locals(), 'bool')
@@ -0,0 +1,116 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import BotCommand, BotCommandScope
5
+
6
+
7
+ class AsyncMethods23(AsyncCaller):
8
+ __slots__ = ()
9
+
10
+ async def set_my_settings(
11
+ self,
12
+ *,
13
+ supports_inline_queries: bool | None = None,
14
+ inline_query_placeholder: str | None = None,
15
+ needs_inline_query_location: bool | None = None,
16
+ inline_feedback_share_denominator: int | None = None,
17
+ can_join_groups: bool | None = None,
18
+ can_read_all_group_messages: bool | None = None,
19
+ can_connect_to_business: bool | None = None,
20
+ can_manage_bots: bool | None = None,
21
+ supports_guest_queries: bool | None = None,
22
+ supports_join_request_queries: bool | None = None,
23
+ has_topics_enabled: bool | None = None,
24
+ allows_users_to_create_topics: bool | None = None,
25
+ has_topic_sidebar: bool | None = None,
26
+ can_communicate_with_bots: bool | None = None,
27
+ callback_query_mode: str | None = None,
28
+ ) -> bool:
29
+ """Use this method to change the settings of the bot. Settings that aren't specified remain unchanged. Returns True on success.
30
+
31
+ Args:
32
+ supports_inline_queries: Pass True to enable inline mode for the bot or False to disable it
33
+ inline_query_placeholder: New placeholder for inline queries, which is shown in the input field after the bot's username. Pass an empty string to use the default placeholder.
34
+ needs_inline_query_location: Pass True to request the location of the user with every inline query to the bot or False to stop requesting it
35
+ inline_feedback_share_denominator: Denominator of the share of chosen inline results received by the bot; the bot receives 1 out of inline_feedback_share_denominator chosen results. Must be one of 1, 10, 100, or 1000. Pass 0 to stop receiving chosen inline results.
36
+ can_join_groups: Pass True to allow adding the bot to groups or False to disallow it
37
+ can_read_all_group_messages: Pass True to disable privacy mode for the bot or False to enable it
38
+ can_connect_to_business: Pass True to allow connecting the bot to user accounts to manage them or False to disallow it
39
+ can_manage_bots: Pass True to allow creating other bots that will be controlled by the bot or False to disallow it
40
+ supports_guest_queries: Pass True to allow guest queries to the bot from chats it isn't a member of or False to disallow them
41
+ supports_join_request_queries: Pass True to allow assigning the bot to process join request queries or False to disallow it
42
+ has_topics_enabled: Pass True to enable forum topic mode in private chats with the bot or False to disable it
43
+ allows_users_to_create_topics: Pass True to allow users to create and delete topics in private chats with the bot or False to disallow it
44
+ has_topic_sidebar: Pass True to show topics in private chats with the bot in a sidebar or False to stop showing them in a sidebar
45
+ can_communicate_with_bots: Pass True to allow the bot to communicate with other bots in groups, private chats, and through business accounts or False to disallow it
46
+ callback_query_mode: Mode in which the bot receives callback queries from buttons in messages sent by the bot. Must be one of “default” (the field message is always used and contains an InaccessibleMessage if the message is inaccessible to the bot), “auto” (the field inline_message_id is used instead of the field message if the message is inaccessible to the bot; the field message can still contain an inaccessible message if the message has just been deleted), or “inline” (the field inline_message_id is always used instead of the field message).
47
+
48
+ https://core.telegram.org/bots/api#setmysettings
49
+ """
50
+ return await self._call('setMySettings', locals(), 'bool')
51
+
52
+ async def set_my_commands(
53
+ self,
54
+ commands: list[BotCommand],
55
+ *,
56
+ scope: BotCommandScope | None = None,
57
+ language_code: str | None = None,
58
+ ) -> bool:
59
+ """Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.
60
+
61
+ Args:
62
+ commands: A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
63
+ scope: A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
64
+ language_code: A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
65
+
66
+ https://core.telegram.org/bots/api#setmycommands
67
+ """
68
+ return await self._call('setMyCommands', locals(), 'bool')
69
+
70
+ async def delete_my_commands(
71
+ self,
72
+ *,
73
+ scope: BotCommandScope | None = None,
74
+ language_code: str | None = None,
75
+ ) -> bool:
76
+ """Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
77
+
78
+ Args:
79
+ scope: A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
80
+ language_code: A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands.
81
+
82
+ https://core.telegram.org/bots/api#deletemycommands
83
+ """
84
+ return await self._call('deleteMyCommands', locals(), 'bool')
85
+
86
+ async def get_my_commands(
87
+ self,
88
+ *,
89
+ scope: BotCommandScope | None = None,
90
+ language_code: str | None = None,
91
+ ) -> list[BotCommand]:
92
+ """Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.
93
+
94
+ Args:
95
+ scope: A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
96
+ language_code: A two-letter ISO 639-1 language code or an empty string
97
+
98
+ https://core.telegram.org/bots/api#getmycommands
99
+ """
100
+ return await self._call('getMyCommands', locals(), 'list[BotCommand]')
101
+
102
+ async def set_my_name(
103
+ self,
104
+ *,
105
+ name: str | None = None,
106
+ language_code: str | None = None,
107
+ ) -> bool:
108
+ """Use this method to change the bot's name. Returns True on success.
109
+
110
+ Args:
111
+ name: New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language.
112
+ language_code: A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name.
113
+
114
+ https://core.telegram.org/bots/api#setmyname
115
+ """
116
+ return await self._call('setMyName', locals(), 'bool')
@@ -0,0 +1,118 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import BotDescription, BotName, BotShortDescription, InputProfilePhoto, MenuButton
5
+
6
+
7
+ class AsyncMethods24(AsyncCaller):
8
+ __slots__ = ()
9
+
10
+ async def get_my_name(
11
+ self,
12
+ *,
13
+ language_code: str | None = None,
14
+ ) -> BotName:
15
+ """Use this method to get the current bot name for the given user language. Returns BotName on success.
16
+
17
+ Args:
18
+ language_code: A two-letter ISO 639-1 language code or an empty string
19
+
20
+ https://core.telegram.org/bots/api#getmyname
21
+ """
22
+ return await self._call('getMyName', locals(), 'BotName')
23
+
24
+ async def set_my_description(
25
+ self,
26
+ *,
27
+ description: str | None = None,
28
+ language_code: str | None = None,
29
+ ) -> bool:
30
+ """Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.
31
+
32
+ Args:
33
+ description: New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language.
34
+ language_code: A two-letter ISO 639-1 language code. If empty, the description will be applied to all users for whose language there is no dedicated description.
35
+
36
+ https://core.telegram.org/bots/api#setmydescription
37
+ """
38
+ return await self._call('setMyDescription', locals(), 'bool')
39
+
40
+ async def get_my_description(
41
+ self,
42
+ *,
43
+ language_code: str | None = None,
44
+ ) -> BotDescription:
45
+ """Use this method to get the current bot description for the given user language. Returns BotDescription on success.
46
+
47
+ Args:
48
+ language_code: A two-letter ISO 639-1 language code or an empty string
49
+
50
+ https://core.telegram.org/bots/api#getmydescription
51
+ """
52
+ return await self._call('getMyDescription', locals(), 'BotDescription')
53
+
54
+ async def set_my_short_description(
55
+ self,
56
+ *,
57
+ short_description: str | None = None,
58
+ language_code: str | None = None,
59
+ ) -> bool:
60
+ """Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success.
61
+
62
+ Args:
63
+ short_description: New short description for the bot; 0-120 characters. Pass an empty string to remove the dedicated short description for the given language.
64
+ language_code: A two-letter ISO 639-1 language code. If empty, the short description will be applied to all users for whose language there is no dedicated short description.
65
+
66
+ https://core.telegram.org/bots/api#setmyshortdescription
67
+ """
68
+ return await self._call('setMyShortDescription', locals(), 'bool')
69
+
70
+ async def get_my_short_description(
71
+ self,
72
+ *,
73
+ language_code: str | None = None,
74
+ ) -> BotShortDescription:
75
+ """Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.
76
+
77
+ Args:
78
+ language_code: A two-letter ISO 639-1 language code or an empty string
79
+
80
+ https://core.telegram.org/bots/api#getmyshortdescription
81
+ """
82
+ return await self._call('getMyShortDescription', locals(), 'BotShortDescription')
83
+
84
+ async def set_my_profile_photo(
85
+ self,
86
+ photo: InputProfilePhoto,
87
+ ) -> bool:
88
+ """Changes the profile photo of the bot. Returns True on success.
89
+
90
+ Args:
91
+ photo: The new profile photo to set
92
+
93
+ https://core.telegram.org/bots/api#setmyprofilephoto
94
+ """
95
+ return await self._call('setMyProfilePhoto', locals(), 'bool')
96
+
97
+ async def remove_my_profile_photo(self) -> bool:
98
+ """Removes the profile photo of the bot. Requires no parameters. Returns True on success.
99
+
100
+ https://core.telegram.org/bots/api#removemyprofilephoto
101
+ """
102
+ return await self._call('removeMyProfilePhoto', {}, 'bool')
103
+
104
+ async def set_chat_menu_button(
105
+ self,
106
+ *,
107
+ chat_id: int | None = None,
108
+ menu_button: MenuButton | None = None,
109
+ ) -> bool:
110
+ """Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
111
+
112
+ Args:
113
+ chat_id: Unique identifier for the target private chat. If not specified, the bot's default menu button will be changed.
114
+ menu_button: A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault.
115
+
116
+ https://core.telegram.org/bots/api#setchatmenubutton
117
+ """
118
+ return await self._call('setChatMenuButton', locals(), 'bool')
@@ -0,0 +1,109 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import ChatAdministratorRights, Gifts, MenuButton, MessageEntity
5
+
6
+
7
+ class AsyncMethods25(AsyncCaller):
8
+ __slots__ = ()
9
+
10
+ async def get_chat_menu_button(
11
+ self,
12
+ *,
13
+ chat_id: int | None = None,
14
+ ) -> MenuButton:
15
+ """Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
16
+
17
+ Args:
18
+ chat_id: Unique identifier for the target private chat. If not specified, the bot's default menu button will be returned.
19
+
20
+ https://core.telegram.org/bots/api#getchatmenubutton
21
+ """
22
+ return await self._call('getChatMenuButton', locals(), 'MenuButton')
23
+
24
+ async def set_my_default_administrator_rights(
25
+ self,
26
+ *,
27
+ rights: ChatAdministratorRights | None = None,
28
+ for_channels: bool | None = None,
29
+ ) -> bool:
30
+ """Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.
31
+
32
+ Args:
33
+ rights: A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.
34
+ for_channels: Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.
35
+
36
+ https://core.telegram.org/bots/api#setmydefaultadministratorrights
37
+ """
38
+ return await self._call('setMyDefaultAdministratorRights', locals(), 'bool')
39
+
40
+ async def get_my_default_administrator_rights(
41
+ self,
42
+ *,
43
+ for_channels: bool | None = None,
44
+ ) -> ChatAdministratorRights:
45
+ """Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
46
+
47
+ Args:
48
+ for_channels: Pass True to get the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be returned.
49
+
50
+ https://core.telegram.org/bots/api#getmydefaultadministratorrights
51
+ """
52
+ return await self._call('getMyDefaultAdministratorRights', locals(), 'ChatAdministratorRights')
53
+
54
+ async def get_available_gifts(self) -> Gifts:
55
+ """Returns the list of gifts that can be sent by the bot to users and channel chats. Requires no parameters. Returns a Gifts object.
56
+
57
+ https://core.telegram.org/bots/api#getavailablegifts
58
+ """
59
+ return await self._call('getAvailableGifts', {}, 'Gifts')
60
+
61
+ async def send_gift(
62
+ self,
63
+ gift_id: str,
64
+ *,
65
+ user_id: int | None = None,
66
+ chat_id: int | str | None = None,
67
+ pay_for_upgrade: bool | None = None,
68
+ text: str | None = None,
69
+ text_parse_mode: str | None = None,
70
+ text_entities: list[MessageEntity] | None = None,
71
+ ) -> bool:
72
+ """Sends a gift to the given user or channel chat. The gift can't be converted to Telegram Stars by the receiver. Returns True on success.
73
+
74
+ Args:
75
+ user_id: Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.
76
+ chat_id: Required if user_id is not specified. Unique identifier for the chat that will receive the gift or username of the channel in the format @username.
77
+ gift_id: Identifier of the gift; limited gifts can't be sent to channel chats
78
+ pay_for_upgrade: Pass True to pay for the gift upgrade from the bot's balance, thereby making the upgrade free for the receiver
79
+ text: Text that will be shown along with the gift; 0-128 characters
80
+ text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
81
+ text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
82
+
83
+ https://core.telegram.org/bots/api#sendgift
84
+ """
85
+ return await self._call('sendGift', locals(), 'bool')
86
+
87
+ async def gift_premium_subscription(
88
+ self,
89
+ user_id: int,
90
+ month_count: int,
91
+ star_count: int,
92
+ *,
93
+ text: str | None = None,
94
+ text_parse_mode: str | None = None,
95
+ text_entities: list[MessageEntity] | None = None,
96
+ ) -> bool:
97
+ """Gifts a Telegram Premium subscription to the given user. Returns True on success.
98
+
99
+ Args:
100
+ user_id: Unique identifier of the target user who will receive a Telegram Premium subscription
101
+ month_count: Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12
102
+ star_count: Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months
103
+ text: Text that will be shown along with the service message about the subscription; 0-128 characters
104
+ text_parse_mode: Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
105
+ text_entities: A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
106
+
107
+ https://core.telegram.org/bots/api#giftpremiumsubscription
108
+ """
109
+ return await self._call('giftPremiumSubscription', locals(), 'bool')
@@ -0,0 +1,124 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import MessageEntity
5
+
6
+
7
+ class AsyncMethods26(AsyncCaller):
8
+ __slots__ = ()
9
+
10
+ async def verify_user(
11
+ self,
12
+ user_id: int,
13
+ *,
14
+ custom_description: str | None = None,
15
+ custom_description_parse_mode: str | None = None,
16
+ custom_description_entities: list[MessageEntity] | None = None,
17
+ ) -> bool:
18
+ """Verifies a user on behalf of the organization which is represented by the bot. Returns True on success.
19
+
20
+ Args:
21
+ user_id: Unique identifier of the target user
22
+ custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
23
+ custom_description_parse_mode: Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.
24
+ custom_description_entities: A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported.
25
+
26
+ https://core.telegram.org/bots/api#verifyuser
27
+ """
28
+ return await self._call('verifyUser', locals(), 'bool')
29
+
30
+ async def verify_chat(
31
+ self,
32
+ chat_id: int | str,
33
+ *,
34
+ custom_description: str | None = None,
35
+ custom_description_parse_mode: str | None = None,
36
+ custom_description_entities: list[MessageEntity] | None = None,
37
+ ) -> bool:
38
+ """Verifies a chat on behalf of the organization which is represented by the bot. Returns True on success.
39
+
40
+ Args:
41
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. Channel direct messages chats can't be verified.
42
+ custom_description: Custom description for the verification; 0-70 characters. Must be empty if the organization isn't allowed to provide a custom verification description.
43
+ custom_description_parse_mode: Mode for parsing entities in the custom description. See formatting options for more details. Only “text_link” entities are supported.
44
+ custom_description_entities: A JSON-serialized list of special entities that appear in the custom description, which can be specified instead of custom_description_parse_mode. Only “text_link” entities are supported.
45
+
46
+ https://core.telegram.org/bots/api#verifychat
47
+ """
48
+ return await self._call('verifyChat', locals(), 'bool')
49
+
50
+ async def remove_user_verification(
51
+ self,
52
+ user_id: int,
53
+ ) -> bool:
54
+ """Removes verification from a user who is currently verified on behalf of the organization represented by the bot. Returns True on success.
55
+
56
+ Args:
57
+ user_id: Unique identifier of the target user
58
+
59
+ https://core.telegram.org/bots/api#removeuserverification
60
+ """
61
+ return await self._call('removeUserVerification', locals(), 'bool')
62
+
63
+ async def remove_chat_verification(
64
+ self,
65
+ chat_id: int | str,
66
+ ) -> bool:
67
+ """Removes verification from a chat that is currently verified on behalf of the organization represented by the bot. Returns True on success.
68
+
69
+ Args:
70
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
71
+
72
+ https://core.telegram.org/bots/api#removechatverification
73
+ """
74
+ return await self._call('removeChatVerification', locals(), 'bool')
75
+
76
+ async def read_business_message(
77
+ self,
78
+ business_connection_id: str,
79
+ chat_id: int,
80
+ message_id: int,
81
+ ) -> bool:
82
+ """Marks an incoming message as read on behalf of a business account. Requires the can_read_messages business bot right. Returns True on success.
83
+
84
+ Args:
85
+ business_connection_id: Unique identifier of the business connection on behalf of which to read the message
86
+ chat_id: Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours.
87
+ message_id: Unique identifier of the message to mark as read
88
+
89
+ https://core.telegram.org/bots/api#readbusinessmessage
90
+ """
91
+ return await self._call('readBusinessMessage', locals(), 'bool')
92
+
93
+ async def delete_business_messages(
94
+ self,
95
+ business_connection_id: str,
96
+ message_ids: list[int],
97
+ ) -> bool:
98
+ """Deletes messages on behalf of a business account. Requires the can_delete_sent_messages business bot right to delete messages sent by the bot itself, or the can_delete_all_messages business bot right to delete any message. Returns True on success.
99
+
100
+ Args:
101
+ business_connection_id: Unique identifier of the business connection on behalf of which to delete the messages
102
+ message_ids: A JSON-serialized list of 1-100 identifiers of messages to delete. All messages must be from the same chat. See deleteMessage for limitations on which messages can be deleted.
103
+
104
+ https://core.telegram.org/bots/api#deletebusinessmessages
105
+ """
106
+ return await self._call('deleteBusinessMessages', locals(), 'bool')
107
+
108
+ async def set_business_account_name(
109
+ self,
110
+ business_connection_id: str,
111
+ first_name: str,
112
+ *,
113
+ last_name: str | None = None,
114
+ ) -> bool:
115
+ """Changes the first and last name of a managed business account. Requires the can_edit_name business bot right. Returns True on success.
116
+
117
+ Args:
118
+ business_connection_id: Unique identifier of the business connection
119
+ first_name: The new value of the first name for the business account; 1-64 characters
120
+ last_name: The new value of the last name for the business account; 0-64 characters
121
+
122
+ https://core.telegram.org/bots/api#setbusinessaccountname
123
+ """
124
+ return await self._call('setBusinessAccountName', locals(), 'bool')