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,121 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ..core.base import BotObject
7
+
8
+ if TYPE_CHECKING:
9
+ from .available_types_01 import Chat, User
10
+ from .available_types_04 import MessageEntity
11
+ from .available_types_10 import PollMedia, PollOption
12
+
13
+ __all__ = ['Checklist', 'ChecklistTask', 'InputChecklistTask', 'Poll']
14
+
15
+
16
+ @dataclass(kw_only=True, slots=True)
17
+ class Poll(BotObject):
18
+ """This object contains information about a poll.
19
+
20
+ https://core.telegram.org/bots/api#poll
21
+ """
22
+
23
+ id: str
24
+ """Unique poll identifier"""
25
+ question: str
26
+ """Poll question, 1-300 characters"""
27
+ question_entities: list[MessageEntity] | None = None
28
+ """Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions"""
29
+ options: list[PollOption]
30
+ """List of poll options"""
31
+ total_voter_count: int
32
+ """Total number of users that voted in the poll"""
33
+ is_closed: bool
34
+ """True, if the poll is closed"""
35
+ is_anonymous: bool
36
+ """True, if the poll is anonymous"""
37
+ type: str
38
+ """Poll type, currently can be “regular” or “quiz”"""
39
+ allows_multiple_answers: bool
40
+ """True, if the poll allows multiple answers"""
41
+ allows_revoting: bool
42
+ """True, if the poll allows changing the chosen answer options"""
43
+ members_only: bool
44
+ """True, if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours"""
45
+ country_codes: list[str] | None = None
46
+ """Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll."""
47
+ correct_option_ids: list[int] | None = None
48
+ """Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot."""
49
+ explanation: str | None = None
50
+ """Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters"""
51
+ explanation_entities: list[MessageEntity] | None = None
52
+ """Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation"""
53
+ explanation_media: PollMedia | None = None
54
+ """Optional. Media added to the quiz explanation"""
55
+ open_period: int | None = None
56
+ """Optional. Amount of time in seconds the poll will be active after creation"""
57
+ close_date: int | None = None
58
+ """Optional. Point in time (Unix timestamp) when the poll will be automatically closed"""
59
+ description: str | None = None
60
+ """Optional. Description of the poll; for polls inside the Message object only"""
61
+ description_entities: list[MessageEntity] | None = None
62
+ """Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description"""
63
+ media: PollMedia | None = None
64
+ """Optional. Media added to the poll description; for polls inside the Message object only"""
65
+
66
+
67
+ @dataclass(kw_only=True, slots=True)
68
+ class ChecklistTask(BotObject):
69
+ """Describes a task in a checklist.
70
+
71
+ https://core.telegram.org/bots/api#checklisttask
72
+ """
73
+
74
+ id: int
75
+ """Unique identifier of the task"""
76
+ text: str
77
+ """Text of the task"""
78
+ text_entities: list[MessageEntity] | None = None
79
+ """Optional. Special entities that appear in the task text"""
80
+ completed_by_user: User | None = None
81
+ """Optional. User that completed the task; omitted if the task wasn't completed by a user"""
82
+ completed_by_chat: Chat | None = None
83
+ """Optional. Chat that completed the task; omitted if the task wasn't completed by a chat"""
84
+ completion_date: int | None = None
85
+ """Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed"""
86
+
87
+
88
+ @dataclass(kw_only=True, slots=True)
89
+ class Checklist(BotObject):
90
+ """Describes a checklist.
91
+
92
+ https://core.telegram.org/bots/api#checklist
93
+ """
94
+
95
+ title: str
96
+ """Title of the checklist"""
97
+ title_entities: list[MessageEntity] | None = None
98
+ """Optional. Special entities that appear in the checklist title"""
99
+ tasks: list[ChecklistTask]
100
+ """List of tasks in the checklist"""
101
+ others_can_add_tasks: bool | None = None
102
+ """Optional. True, if users other than the creator of the list can add tasks to the list"""
103
+ others_can_mark_tasks_as_done: bool | None = None
104
+ """Optional. True, if users other than the creator of the list can mark tasks as done or not done"""
105
+
106
+
107
+ @dataclass(kw_only=True, slots=True)
108
+ class InputChecklistTask(BotObject):
109
+ """Describes a task to add to a checklist.
110
+
111
+ https://core.telegram.org/bots/api#inputchecklisttask
112
+ """
113
+
114
+ id: int
115
+ """Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist"""
116
+ text: str
117
+ """Text of the task; 1-100 characters after entities parsing"""
118
+ parse_mode: str | None = None
119
+ """Optional. Mode for parsing entities in the text. See formatting options for more details."""
120
+ text_entities: list[MessageEntity] | None = None
121
+ """Optional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed."""
@@ -0,0 +1,120 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ..core.base import BotObject
7
+
8
+ if TYPE_CHECKING:
9
+ from .available_types_01 import User
10
+ from .available_types_04 import MessageEntity
11
+ from .available_types_11 import InputChecklistTask
12
+
13
+ __all__ = [
14
+ 'InputChecklist', 'Location', 'MessageAutoDeleteTimerChanged', 'ProximityAlertTriggered',
15
+ 'Venue', 'WebAppData',
16
+ ]
17
+
18
+
19
+ @dataclass(kw_only=True, slots=True)
20
+ class InputChecklist(BotObject):
21
+ """Describes a checklist to create.
22
+
23
+ https://core.telegram.org/bots/api#inputchecklist
24
+ """
25
+
26
+ title: str
27
+ """Title of the checklist; 1-255 characters after entities parsing"""
28
+ parse_mode: str | None = None
29
+ """Optional. Mode for parsing entities in the title. See formatting options for more details."""
30
+ title_entities: list[MessageEntity] | None = None
31
+ """Optional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed."""
32
+ tasks: list[InputChecklistTask]
33
+ """List of 1-30 tasks in the checklist"""
34
+ others_can_add_tasks: bool | None = None
35
+ """Optional. Pass True if other users can add tasks to the checklist"""
36
+ others_can_mark_tasks_as_done: bool | None = None
37
+ """Optional. Pass True if other users can mark tasks as done or not done in the checklist"""
38
+
39
+
40
+ @dataclass(kw_only=True, slots=True)
41
+ class Location(BotObject):
42
+ """This object represents a point on the map.
43
+
44
+ https://core.telegram.org/bots/api#location
45
+ """
46
+
47
+ latitude: float
48
+ """Latitude as defined by the sender"""
49
+ longitude: float
50
+ """Longitude as defined by the sender"""
51
+ horizontal_accuracy: float | None = None
52
+ """Optional. The radius of uncertainty for the location, measured in meters; 0-1500"""
53
+ live_period: int | None = None
54
+ """Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only."""
55
+ heading: int | None = None
56
+ """Optional. The direction in which the user is moving, in degrees; 1-360. For active live locations only."""
57
+ proximity_alert_radius: int | None = None
58
+ """Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."""
59
+
60
+
61
+ @dataclass(kw_only=True, slots=True)
62
+ class Venue(BotObject):
63
+ """This object represents a venue.
64
+
65
+ https://core.telegram.org/bots/api#venue
66
+ """
67
+
68
+ location: Location
69
+ """Venue location. Can't be a live location."""
70
+ title: str
71
+ """Name of the venue"""
72
+ address: str
73
+ """Address of the venue"""
74
+ foursquare_id: str | None = None
75
+ """Optional. Foursquare identifier of the venue"""
76
+ foursquare_type: str | None = None
77
+ """Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)"""
78
+ google_place_id: str | None = None
79
+ """Optional. Google Places identifier of the venue"""
80
+ google_place_type: str | None = None
81
+ """Optional. Google Places type of the venue. (See supported types.)"""
82
+
83
+
84
+ @dataclass(kw_only=True, slots=True)
85
+ class WebAppData(BotObject):
86
+ """Describes data sent from a Web App to the bot.
87
+
88
+ https://core.telegram.org/bots/api#webappdata
89
+ """
90
+
91
+ data: str
92
+ """The data. Be aware that a bad client can send arbitrary data in this field."""
93
+ button_text: str
94
+ """Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."""
95
+
96
+
97
+ @dataclass(kw_only=True, slots=True)
98
+ class ProximityAlertTriggered(BotObject):
99
+ """This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
100
+
101
+ https://core.telegram.org/bots/api#proximityalerttriggered
102
+ """
103
+
104
+ traveler: User
105
+ """User that triggered the alert"""
106
+ watcher: User
107
+ """User that set the alert"""
108
+ distance: int
109
+ """The distance between the users"""
110
+
111
+
112
+ @dataclass(kw_only=True, slots=True)
113
+ class MessageAutoDeleteTimerChanged(BotObject):
114
+ """This object represents a service message about a change in auto-delete timer settings.
115
+
116
+ https://core.telegram.org/bots/api#messageautodeletetimerchanged
117
+ """
118
+
119
+ message_auto_delete_time: int
120
+ """New auto-delete time for messages in the chat; in seconds"""
@@ -0,0 +1,128 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ..core.base import BotObject
7
+
8
+ if TYPE_CHECKING:
9
+ from .available_types_01 import Chat, User
10
+ from .available_types_04 import MessageEntity
11
+ from .unions_01 import MaybeInaccessibleMessage
12
+
13
+ __all__ = [
14
+ 'BackgroundFillSolid', 'BotSubscriptionUpdated', 'ChatBoostAdded', 'ManagedBotCreated',
15
+ 'ManagedBotUpdated', 'MessageGenerationStopped', 'PollOptionAdded', 'PollOptionDeleted',
16
+ ]
17
+
18
+
19
+ @dataclass(kw_only=True, slots=True)
20
+ class ManagedBotCreated(BotObject):
21
+ """This object contains information about the bot that was created to be managed by the current bot.
22
+
23
+ https://core.telegram.org/bots/api#managedbotcreated
24
+ """
25
+
26
+ bot: User
27
+ """Information about the bot. The bot's token can be fetched using the method getManagedBotToken."""
28
+
29
+
30
+ @dataclass(kw_only=True, slots=True)
31
+ class ManagedBotUpdated(BotObject):
32
+ """This object contains information about the creation, token update, or owner update of a bot that is managed by the current bot.
33
+
34
+ https://core.telegram.org/bots/api#managedbotupdated
35
+ """
36
+
37
+ user: User
38
+ """User that created the bot"""
39
+ bot: User
40
+ """Information about the bot. The token of the bot can be fetched using the method getManagedBotToken."""
41
+
42
+
43
+ @dataclass(kw_only=True, slots=True)
44
+ class BotSubscriptionUpdated(BotObject):
45
+ """This object contains information about changes to a user payment subscription toward the current bot.
46
+
47
+ https://core.telegram.org/bots/api#botsubscriptionupdated
48
+ """
49
+
50
+ user: User
51
+ """User who subscribed for payments toward the bot"""
52
+ invoice_payload: str
53
+ """Bot-specified invoice payload"""
54
+ state: str
55
+ """The new state of the subscription. Currently, it can be one of “canceled” if the user canceled the subscription, “active” if the user re-enabled a previously canceled subscription, or “failed” if payment for the subscription failed."""
56
+
57
+
58
+ @dataclass(kw_only=True, slots=True)
59
+ class MessageGenerationStopped(BotObject):
60
+ """This object describes an update about a user stopping message generation.
61
+
62
+ https://core.telegram.org/bots/api#messagegenerationstopped
63
+ """
64
+
65
+ chat: Chat
66
+ """Chat in which the message is generated"""
67
+ message_thread_id: int | None = None
68
+ """Optional. Unique identifier of the message thread in which the message is generated"""
69
+ draft_id: int
70
+ """Unique identifier of the message draft which was stopped"""
71
+
72
+
73
+ @dataclass(kw_only=True, slots=True)
74
+ class PollOptionAdded(BotObject):
75
+ """Describes a service message about an option added to a poll.
76
+
77
+ https://core.telegram.org/bots/api#polloptionadded
78
+ """
79
+
80
+ poll_message: MaybeInaccessibleMessage | None = None
81
+ """Optional. Message containing the poll to which the option was added, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply."""
82
+ option_persistent_id: str
83
+ """Unique identifier of the added option"""
84
+ option_text: str
85
+ """Option text"""
86
+ option_text_entities: list[MessageEntity] | None = None
87
+ """Optional. Special entities that appear in the option_text"""
88
+
89
+
90
+ @dataclass(kw_only=True, slots=True)
91
+ class PollOptionDeleted(BotObject):
92
+ """Describes a service message about an option deleted from a poll.
93
+
94
+ https://core.telegram.org/bots/api#polloptiondeleted
95
+ """
96
+
97
+ poll_message: MaybeInaccessibleMessage | None = None
98
+ """Optional. Message containing the poll from which the option was deleted, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply."""
99
+ option_persistent_id: str
100
+ """Unique identifier of the deleted option"""
101
+ option_text: str
102
+ """Option text"""
103
+ option_text_entities: list[MessageEntity] | None = None
104
+ """Optional. Special entities that appear in the option_text"""
105
+
106
+
107
+ @dataclass(kw_only=True, slots=True)
108
+ class ChatBoostAdded(BotObject):
109
+ """This object represents a service message about a user boosting a chat.
110
+
111
+ https://core.telegram.org/bots/api#chatboostadded
112
+ """
113
+
114
+ boost_count: int
115
+ """Number of boosts added by the user"""
116
+
117
+
118
+ @dataclass(kw_only=True, slots=True)
119
+ class BackgroundFillSolid(BotObject):
120
+ """The background is filled using the selected color.
121
+
122
+ https://core.telegram.org/bots/api#backgroundfillsolid
123
+ """
124
+
125
+ type: str = 'solid'
126
+ """Type of the background fill, always “solid”"""
127
+ color: int
128
+ """The color of the background fill in the RGB24 format"""
@@ -0,0 +1,124 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ..core.base import BotObject
7
+
8
+ if TYPE_CHECKING:
9
+ from .available_types_07 import Document
10
+ from .unions_01 import BackgroundFill, BackgroundType
11
+
12
+ __all__ = [
13
+ 'BackgroundFillFreeformGradient', 'BackgroundFillGradient', 'BackgroundTypeChatTheme',
14
+ 'BackgroundTypeFill', 'BackgroundTypePattern', 'BackgroundTypeWallpaper', 'ChatBackground',
15
+ ]
16
+
17
+
18
+ @dataclass(kw_only=True, slots=True)
19
+ class BackgroundFillGradient(BotObject):
20
+ """The background is a gradient fill.
21
+
22
+ https://core.telegram.org/bots/api#backgroundfillgradient
23
+ """
24
+
25
+ type: str = 'gradient'
26
+ """Type of the background fill, always “gradient”"""
27
+ top_color: int
28
+ """Top color of the gradient in the RGB24 format"""
29
+ bottom_color: int
30
+ """Bottom color of the gradient in the RGB24 format"""
31
+ rotation_angle: int
32
+ """Clockwise rotation angle of the background fill in degrees; 0-359"""
33
+
34
+
35
+ @dataclass(kw_only=True, slots=True)
36
+ class BackgroundFillFreeformGradient(BotObject):
37
+ """The background is a freeform gradient that rotates after every message in the chat.
38
+
39
+ https://core.telegram.org/bots/api#backgroundfillfreeformgradient
40
+ """
41
+
42
+ type: str = 'freeform_gradient'
43
+ """Type of the background fill, always “freeform_gradient”"""
44
+ colors: list[int]
45
+ """A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format"""
46
+
47
+
48
+ @dataclass(kw_only=True, slots=True)
49
+ class BackgroundTypeFill(BotObject):
50
+ """The background is automatically filled based on the selected colors.
51
+
52
+ https://core.telegram.org/bots/api#backgroundtypefill
53
+ """
54
+
55
+ type: str = 'fill'
56
+ """Type of the background, always “fill”"""
57
+ fill: BackgroundFill
58
+ """The background fill"""
59
+ dark_theme_dimming: int
60
+ """Dimming of the background in dark themes, as a percentage; 0-100"""
61
+
62
+
63
+ @dataclass(kw_only=True, slots=True)
64
+ class BackgroundTypeWallpaper(BotObject):
65
+ """The background is a wallpaper in the JPEG format.
66
+
67
+ https://core.telegram.org/bots/api#backgroundtypewallpaper
68
+ """
69
+
70
+ type: str = 'wallpaper'
71
+ """Type of the background, always “wallpaper”"""
72
+ document: Document
73
+ """Document with the wallpaper"""
74
+ dark_theme_dimming: int
75
+ """Dimming of the background in dark themes, as a percentage; 0-100"""
76
+ is_blurred: bool | None = None
77
+ """Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12"""
78
+ is_moving: bool | None = None
79
+ """Optional. True, if the background moves slightly when the device is tilted"""
80
+
81
+
82
+ @dataclass(kw_only=True, slots=True)
83
+ class BackgroundTypePattern(BotObject):
84
+ """The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
85
+
86
+ https://core.telegram.org/bots/api#backgroundtypepattern
87
+ """
88
+
89
+ type: str = 'pattern'
90
+ """Type of the background, always “pattern”"""
91
+ document: Document
92
+ """Document with the pattern"""
93
+ fill: BackgroundFill
94
+ """The background fill that is combined with the pattern"""
95
+ intensity: int
96
+ """Intensity of the pattern when it is shown above the filled background; 0-100"""
97
+ is_inverted: bool | None = None
98
+ """Optional. True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only."""
99
+ is_moving: bool | None = None
100
+ """Optional. True, if the background moves slightly when the device is tilted"""
101
+
102
+
103
+ @dataclass(kw_only=True, slots=True)
104
+ class BackgroundTypeChatTheme(BotObject):
105
+ """The background is taken directly from a built-in chat theme.
106
+
107
+ https://core.telegram.org/bots/api#backgroundtypechattheme
108
+ """
109
+
110
+ type: str = 'chat_theme'
111
+ """Type of the background, always “chat_theme”"""
112
+ theme_name: str
113
+ """Name of the chat theme, which is usually an emoji"""
114
+
115
+
116
+ @dataclass(kw_only=True, slots=True)
117
+ class ChatBackground(BotObject):
118
+ """This object represents a chat background.
119
+
120
+ https://core.telegram.org/bots/api#chatbackground
121
+ """
122
+
123
+ type: BackgroundType
124
+ """Type of the background"""
@@ -0,0 +1,129 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import TYPE_CHECKING
5
+
6
+ from ..core.base import BotObject
7
+
8
+ if TYPE_CHECKING:
9
+ from .available_types_03 import Message
10
+ from .available_types_11 import ChecklistTask
11
+ from .available_types_24 import Community
12
+
13
+ __all__ = [
14
+ 'ChecklistTasksAdded', 'ChecklistTasksDone', 'CommunityChatAdded', 'CommunityChatJoined',
15
+ 'CommunityChatRemoved', 'ForumTopicClosed', 'ForumTopicCreated', 'ForumTopicEdited',
16
+ 'ForumTopicReopened', 'GeneralForumTopicHidden',
17
+ ]
18
+
19
+
20
+ @dataclass(kw_only=True, slots=True)
21
+ class ChecklistTasksDone(BotObject):
22
+ """Describes a service message about checklist tasks marked as done or not done.
23
+
24
+ https://core.telegram.org/bots/api#checklisttasksdone
25
+ """
26
+
27
+ checklist_message: Message | None = None
28
+ """Optional. Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply."""
29
+ marked_as_done_task_ids: list[int] | None = None
30
+ """Optional. Identifiers of the tasks that were marked as done"""
31
+ marked_as_not_done_task_ids: list[int] | None = None
32
+ """Optional. Identifiers of the tasks that were marked as not done"""
33
+
34
+
35
+ @dataclass(kw_only=True, slots=True)
36
+ class ChecklistTasksAdded(BotObject):
37
+ """Describes a service message about tasks added to a checklist.
38
+
39
+ https://core.telegram.org/bots/api#checklisttasksadded
40
+ """
41
+
42
+ checklist_message: Message | None = None
43
+ """Optional. Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply."""
44
+ tasks: list[ChecklistTask]
45
+ """List of tasks added to the checklist"""
46
+
47
+
48
+ @dataclass(kw_only=True, slots=True)
49
+ class CommunityChatAdded(BotObject):
50
+ """Describes a service message about a chat or a bot being added to a community.
51
+
52
+ https://core.telegram.org/bots/api#communitychatadded
53
+ """
54
+
55
+ community: Community
56
+ """The new community to which the chat or the bot belongs"""
57
+
58
+
59
+ @dataclass(kw_only=True, slots=True)
60
+ class CommunityChatJoined(BotObject):
61
+ """Describes a service message about a chat being joined by a user from a community.
62
+
63
+ https://core.telegram.org/bots/api#communitychatjoined
64
+ """
65
+
66
+ community: Community
67
+ """The community from which the chat was joined"""
68
+
69
+
70
+ @dataclass(kw_only=True, slots=True)
71
+ class CommunityChatRemoved(BotObject):
72
+ """Describes a service message about a chat or a bot being removed from a community. Currently holds no information.
73
+
74
+ https://core.telegram.org/bots/api#communitychatremoved
75
+ """
76
+
77
+
78
+ @dataclass(kw_only=True, slots=True)
79
+ class ForumTopicCreated(BotObject):
80
+ """This object represents a service message about a new forum topic created in the chat.
81
+
82
+ https://core.telegram.org/bots/api#forumtopiccreated
83
+ """
84
+
85
+ name: str
86
+ """Name of the topic"""
87
+ icon_color: int
88
+ """Color of the topic icon in RGB format"""
89
+ icon_custom_emoji_id: str | None = None
90
+ """Optional. Unique identifier of the custom emoji shown as the topic icon"""
91
+ is_name_implicit: bool | None = None
92
+ """Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot"""
93
+
94
+
95
+ @dataclass(kw_only=True, slots=True)
96
+ class ForumTopicClosed(BotObject):
97
+ """This object represents a service message about a forum topic closed in the chat. Currently holds no information.
98
+
99
+ https://core.telegram.org/bots/api#forumtopicclosed
100
+ """
101
+
102
+
103
+ @dataclass(kw_only=True, slots=True)
104
+ class ForumTopicEdited(BotObject):
105
+ """This object represents a service message about an edited forum topic.
106
+
107
+ https://core.telegram.org/bots/api#forumtopicedited
108
+ """
109
+
110
+ name: str | None = None
111
+ """Optional. New name of the topic, if it was edited"""
112
+ icon_custom_emoji_id: str | None = None
113
+ """Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed"""
114
+
115
+
116
+ @dataclass(kw_only=True, slots=True)
117
+ class ForumTopicReopened(BotObject):
118
+ """This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
119
+
120
+ https://core.telegram.org/bots/api#forumtopicreopened
121
+ """
122
+
123
+
124
+ @dataclass(kw_only=True, slots=True)
125
+ class GeneralForumTopicHidden(BotObject):
126
+ """This object represents a service message about the General forum topic hidden in the chat. Currently holds no information.
127
+
128
+ https://core.telegram.org/bots/api#generalforumtopichidden
129
+ """