@mtkruto/node 0.1.132 → 0.1.134

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 (194) hide show
  1. package/esm/3_errors.d.ts +519 -510
  2. package/esm/3_errors.js +521 -509
  3. package/esm/3_types.d.ts +19 -7
  4. package/esm/3_types.js +19 -7
  5. package/esm/4_constants.d.ts +2 -2
  6. package/esm/4_constants.js +2 -2
  7. package/esm/4_errors.d.ts +7 -12
  8. package/esm/4_errors.js +6 -7
  9. package/esm/5_client.d.ts +3 -3
  10. package/esm/5_client.js +3 -3
  11. package/esm/client/0_utilities.d.ts +30 -2
  12. package/esm/client/0_utilities.js +13 -5
  13. package/esm/client/1_composer.d.ts +30 -0
  14. package/esm/client/{4_composer.js → 1_composer.js} +15 -2
  15. package/esm/client/2_client_plain.d.ts +1 -1
  16. package/esm/client/2_client_plain.js +1 -1
  17. package/esm/client/{3_types.d.ts → 3_params.d.ts} +68 -172
  18. package/esm/client/3_params.js +1 -0
  19. package/esm/client/{5_client.d.ts → 4_client.d.ts} +89 -57
  20. package/esm/client/{5_client.js → 4_client.js} +499 -308
  21. package/esm/client/5_composer.d.ts +4 -0
  22. package/esm/client/5_composer.js +3 -0
  23. package/esm/storage/0_storage.d.ts +4 -1
  24. package/esm/storage/0_storage.js +36 -7
  25. package/esm/storage/1_storage_indexed_db.d.ts +6 -2
  26. package/esm/storage/1_storage_indexed_db.js +7 -5
  27. package/esm/storage/1_storage_local_storage.d.ts +1 -1
  28. package/esm/storage/1_storage_local_storage.js +1 -1
  29. package/esm/storage/1_storage_memory.d.ts +1 -1
  30. package/esm/storage/1_storage_memory.js +1 -1
  31. package/esm/storage/1_storage_session_storage.d.ts +1 -1
  32. package/esm/storage/1_storage_session_storage.js +1 -1
  33. package/esm/tl/2_types.d.ts +313 -24
  34. package/esm/tl/2_types.js +982 -46
  35. package/esm/tl/3_functions.d.ts +95 -32
  36. package/esm/tl/3_functions.js +227 -66
  37. package/esm/tl/3_utilities.d.ts +1 -0
  38. package/esm/tl/3_utilities.js +14 -0
  39. package/esm/tl/6_message.js +1 -1
  40. package/esm/types/0_authorization_state.d.ts +5 -0
  41. package/esm/types/0_authorization_state.js +1 -0
  42. package/esm/types/0_chat_photo.d.ts +22 -21
  43. package/esm/types/0_connection_state.d.ts +17 -0
  44. package/esm/types/0_connection_state.js +1 -0
  45. package/esm/types/0_giveaway_parameters.d.ts +9 -0
  46. package/esm/types/0_giveaway_parameters.js +9 -0
  47. package/esm/types/0_login_url.d.ts +0 -4
  48. package/esm/types/0_mask_position.d.ts +0 -4
  49. package/esm/types/0_message_entity.d.ts +91 -74
  50. package/esm/types/0_message_identifier.d.ts +4 -0
  51. package/esm/types/0_message_identifier.js +1 -0
  52. package/esm/types/0_network_statistics_entry.d.ts +4 -0
  53. package/esm/types/0_network_statistics_entry.js +1 -0
  54. package/esm/types/0_reaction.d.ts +14 -10
  55. package/esm/types/0_reaction.js +29 -1
  56. package/esm/types/1__getters.d.ts +3 -0
  57. package/esm/types/1_bot_command_scope.d.ts +32 -27
  58. package/esm/types/1_chat_p.d.ts +77 -68
  59. package/esm/types/1_giveaway.d.ts +8 -0
  60. package/esm/types/1_giveaway.js +7 -0
  61. package/esm/types/1_keyboard_button.d.ts +41 -57
  62. package/esm/types/1_keyboard_button.js +3 -0
  63. package/esm/types/1_message_reaction.d.ts +14 -0
  64. package/esm/types/1_message_reaction.js +22 -0
  65. package/esm/types/1_network_statistics.d.ts +5 -0
  66. package/esm/types/1_network_statistics.js +1 -0
  67. package/esm/types/1_poll.d.ts +0 -13
  68. package/esm/types/1_reaction_count.d.ts +7 -0
  69. package/esm/types/1_reaction_count.js +6 -0
  70. package/esm/types/1_user.d.ts +2 -2
  71. package/esm/types/2_game.d.ts +0 -7
  72. package/esm/types/2_inline_keyboard_button.d.ts +36 -37
  73. package/esm/types/2_inline_query.d.ts +0 -6
  74. package/esm/types/2_message_interactions.d.ts +8 -0
  75. package/esm/types/2_message_interactions.js +1 -0
  76. package/esm/types/2_message_reaction_count.d.ts +8 -0
  77. package/esm/types/2_message_reaction_count.js +1 -0
  78. package/esm/types/2_reply_keyboard_markup.d.ts +0 -7
  79. package/esm/types/3_inline_keyboard_markup.d.ts +0 -2
  80. package/esm/types/4_message.d.ts +457 -0
  81. package/esm/types/{3_message.js → 4_message.js} +216 -129
  82. package/{script/types/4_callback_query.d.ts → esm/types/5_callback_query.d.ts} +1 -1
  83. package/esm/types/5_chat.d.ts +37 -0
  84. package/esm/types/{4_chat.js → 5_chat.js} +2 -2
  85. package/esm/types/6_update.d.ts +134 -0
  86. package/esm/types/6_update.js +1 -0
  87. package/package.json +1 -1
  88. package/script/3_errors.d.ts +519 -510
  89. package/script/3_errors.js +533 -520
  90. package/script/3_types.d.ts +19 -7
  91. package/script/3_types.js +19 -7
  92. package/script/4_constants.d.ts +2 -2
  93. package/script/4_constants.js +2 -2
  94. package/script/4_errors.d.ts +7 -12
  95. package/script/4_errors.js +5 -6
  96. package/script/5_client.d.ts +3 -3
  97. package/script/5_client.js +3 -3
  98. package/script/client/0_utilities.d.ts +30 -2
  99. package/script/client/0_utilities.js +15 -6
  100. package/script/client/1_composer.d.ts +30 -0
  101. package/script/client/{4_composer.js → 1_composer.js} +17 -4
  102. package/script/client/2_client_plain.d.ts +1 -1
  103. package/script/client/2_client_plain.js +2 -2
  104. package/script/client/{3_types.d.ts → 3_params.d.ts} +68 -172
  105. package/script/client/3_params.js +2 -0
  106. package/script/client/{5_client.d.ts → 4_client.d.ts} +89 -57
  107. package/script/client/{5_client.js → 4_client.js} +505 -314
  108. package/script/client/5_composer.d.ts +4 -0
  109. package/script/client/{6_composer.js → 5_composer.js} +2 -2
  110. package/script/storage/0_storage.d.ts +4 -1
  111. package/script/storage/0_storage.js +36 -7
  112. package/script/storage/1_storage_indexed_db.d.ts +6 -2
  113. package/script/storage/1_storage_indexed_db.js +7 -5
  114. package/script/storage/1_storage_local_storage.d.ts +1 -1
  115. package/script/storage/1_storage_local_storage.js +1 -1
  116. package/script/storage/1_storage_memory.d.ts +1 -1
  117. package/script/storage/1_storage_memory.js +1 -1
  118. package/script/storage/1_storage_session_storage.d.ts +1 -1
  119. package/script/storage/1_storage_session_storage.js +1 -1
  120. package/script/tl/2_types.d.ts +313 -24
  121. package/script/tl/2_types.js +1169 -217
  122. package/script/tl/3_functions.d.ts +95 -32
  123. package/script/tl/3_functions.js +241 -77
  124. package/script/tl/3_utilities.d.ts +1 -0
  125. package/script/tl/3_utilities.js +16 -1
  126. package/script/tl/6_message.js +1 -1
  127. package/script/types/0_authorization_state.d.ts +5 -0
  128. package/script/types/0_authorization_state.js +2 -0
  129. package/script/types/0_chat_photo.d.ts +22 -21
  130. package/script/types/0_connection_state.d.ts +17 -0
  131. package/script/types/0_connection_state.js +2 -0
  132. package/script/types/0_giveaway_parameters.d.ts +9 -0
  133. package/script/types/0_giveaway_parameters.js +13 -0
  134. package/script/types/0_login_url.d.ts +0 -4
  135. package/script/types/0_mask_position.d.ts +0 -4
  136. package/script/types/0_message_entity.d.ts +91 -74
  137. package/script/types/0_message_identifier.d.ts +4 -0
  138. package/script/types/0_message_identifier.js +2 -0
  139. package/script/types/0_network_statistics_entry.d.ts +4 -0
  140. package/script/types/0_network_statistics_entry.js +2 -0
  141. package/script/types/0_reaction.d.ts +14 -10
  142. package/script/types/0_reaction.js +33 -0
  143. package/script/types/1__getters.d.ts +3 -0
  144. package/script/types/1_bot_command_scope.d.ts +32 -27
  145. package/script/types/1_chat_p.d.ts +77 -68
  146. package/script/types/1_giveaway.d.ts +8 -0
  147. package/script/types/1_giveaway.js +11 -0
  148. package/script/types/1_keyboard_button.d.ts +41 -57
  149. package/script/types/1_keyboard_button.js +3 -0
  150. package/script/types/1_message_reaction.d.ts +14 -0
  151. package/script/types/1_message_reaction.js +26 -0
  152. package/script/types/1_network_statistics.d.ts +5 -0
  153. package/script/types/1_network_statistics.js +2 -0
  154. package/script/types/1_poll.d.ts +0 -13
  155. package/script/types/1_reaction_count.d.ts +7 -0
  156. package/script/types/1_reaction_count.js +10 -0
  157. package/script/types/1_user.d.ts +2 -2
  158. package/script/types/2_game.d.ts +0 -7
  159. package/script/types/2_inline_keyboard_button.d.ts +36 -37
  160. package/script/types/2_inline_query.d.ts +0 -6
  161. package/script/types/2_message_interactions.d.ts +8 -0
  162. package/script/types/2_message_interactions.js +2 -0
  163. package/script/types/2_message_reaction_count.d.ts +8 -0
  164. package/script/types/2_message_reaction_count.js +2 -0
  165. package/script/types/2_reply_keyboard_markup.d.ts +0 -7
  166. package/script/types/3_inline_keyboard_markup.d.ts +0 -2
  167. package/script/types/4_message.d.ts +457 -0
  168. package/script/types/{3_message.js → 4_message.js} +218 -130
  169. package/{esm/types/4_callback_query.d.ts → script/types/5_callback_query.d.ts} +1 -1
  170. package/script/types/5_chat.d.ts +37 -0
  171. package/script/types/{4_chat.js → 5_chat.js} +3 -3
  172. package/script/types/6_update.d.ts +134 -0
  173. package/script/types/6_update.js +2 -0
  174. package/esm/client/3_types.js +0 -11
  175. package/esm/client/4_composer.d.ts +0 -31
  176. package/esm/client/6_composer.d.ts +0 -4
  177. package/esm/client/6_composer.js +0 -3
  178. package/esm/types/3_message.d.ts +0 -182
  179. package/esm/types/4_chat.d.ts +0 -34
  180. package/script/client/3_types.js +0 -15
  181. package/script/client/4_composer.d.ts +0 -31
  182. package/script/client/6_composer.d.ts +0 -4
  183. package/script/types/3_message.d.ts +0 -182
  184. package/script/types/4_chat.d.ts +0 -34
  185. /package/esm/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
  186. /package/esm/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
  187. /package/esm/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
  188. /package/esm/types/{0_audio.js → 1_audio.js} +0 -0
  189. /package/esm/types/{4_callback_query.js → 5_callback_query.js} +0 -0
  190. /package/script/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
  191. /package/script/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
  192. /package/script/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
  193. /package/script/types/{0_audio.js → 1_audio.js} +0 -0
  194. /package/script/types/{4_callback_query.js → 5_callback_query.js} +0 -0
@@ -0,0 +1,457 @@
1
+ import { MaybePromise } from "../1_utilities.js";
2
+ import { enums } from "../2_tl.js";
3
+ import { Contact } from "./0_contact.js";
4
+ import { Dice } from "./0_dice.js";
5
+ import { ForceReply } from "./0_force_reply.js";
6
+ import { Location } from "./0_location.js";
7
+ import { MessageEntity } from "./0_message_entity.js";
8
+ import { ReplyKeyboardRemove } from "./0_reply_keyboard_remove.js";
9
+ import { Venue } from "./0_venue.js";
10
+ import { Voice } from "./0_voice.js";
11
+ import { EntityGetter } from "./1__getters.js";
12
+ import { Animation } from "./1_animation.js";
13
+ import { Audio } from "./1_audio.js";
14
+ import { ChatP } from "./1_chat_p.js";
15
+ import { Document } from "./1_document.js";
16
+ import { Giveaway } from "./1_giveaway.js";
17
+ import { MessageReaction } from "./1_message_reaction.js";
18
+ import { Photo } from "./1_photo.js";
19
+ import { Poll } from "./1_poll.js";
20
+ import { ReplyQuote } from "./1_reply_quote.js";
21
+ import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
22
+ import { User } from "./1_user.js";
23
+ import { VideoNote } from "./1_video_note.js";
24
+ import { Video } from "./1_video.js";
25
+ import { Game } from "./2_game.js";
26
+ import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
27
+ import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
28
+ /**
29
+ * Properties shared between all message types.
30
+ * @unlisted
31
+ */
32
+ export interface MessageBase {
33
+ /** Whether the message is outgoing (sent by the current user). */
34
+ out: boolean;
35
+ /** The identifier of the message. */
36
+ id: number;
37
+ /** The identifier of the message's thread. */
38
+ threadId?: number;
39
+ /** The user who sent the message. */
40
+ from?: User;
41
+ /** The chat which the message was sent on behalf of. */
42
+ senderChat?: ChatP;
43
+ /** The point of time in which the message was sent. */
44
+ date: Date;
45
+ /** The chat where the message was sent to. */
46
+ chat: ChatP;
47
+ /** A link to the message. */
48
+ link?: string;
49
+ /** The original sender of the message. */
50
+ forwardFrom?: User;
51
+ /** The original chat of the message. */
52
+ forwardFromChat?: ChatP;
53
+ /** The original identifier of the message. */
54
+ forwardId?: number;
55
+ /** The original signature of the message. */
56
+ forwardSignature?: string;
57
+ /** The name of the original sender of the message. */
58
+ forwardSenderName?: string;
59
+ /** The point of time in which the original message was sent. */
60
+ forwardDate?: Date;
61
+ /** Whether the message was sent in a topic thread. */
62
+ isTopicMessage: boolean;
63
+ /** Whether the message is an automatic forward. */
64
+ isAutomaticForward?: boolean;
65
+ /** The message that is being replied to. Not always available even if a message is being replied to. */
66
+ replyToMessage?: Message;
67
+ /** The identifier of the message that is being replied to. */
68
+ replyToMessageId?: number;
69
+ /** The reactions of the message. */
70
+ reactions?: MessageReaction[];
71
+ /** The part of the message that is being replied to. */
72
+ replyQuote?: ReplyQuote;
73
+ /** The inline bot that was used to send this message. */
74
+ viaBot?: User;
75
+ /** The point of time in which the message's last edit was made. */
76
+ editDate?: Date;
77
+ /** Whether the contents of the message is protected. */
78
+ hasProtectedContent?: boolean;
79
+ /** The identifier of the message's media group. */
80
+ mediaGroupId?: string;
81
+ /** The signature of the message. */
82
+ authorSignature?: string;
83
+ /** The number of times the message was viewed. */
84
+ views?: number;
85
+ /** The number of times the message was forwarded. */
86
+ forwards?: number;
87
+ /** The message's reply markup. */
88
+ replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
89
+ }
90
+ /**
91
+ * Properties shared between media message types.
92
+ * @unlisted
93
+ */
94
+ export interface MessageMediaBase extends MessageBase {
95
+ caption?: string;
96
+ captionEntities?: MessageEntity[];
97
+ hasMediaSpoiler?: boolean;
98
+ }
99
+ /**
100
+ * A text message.
101
+ * @unlisted
102
+ */
103
+ export interface MessageText extends MessageBase {
104
+ /** The text included in the message. */
105
+ text: string;
106
+ /** Entities of the text. */
107
+ entities: MessageEntity[];
108
+ }
109
+ /** @unlisted */
110
+ export interface MessagePhoto extends MessageMediaBase {
111
+ /** The photo included in the message. */
112
+ photo: Photo;
113
+ }
114
+ /**
115
+ * A document message.
116
+ * @unlisted
117
+ */
118
+ export interface MessageDocument extends MessageMediaBase {
119
+ /** The document included in the message. */
120
+ document: Document;
121
+ }
122
+ /**
123
+ * A video message.
124
+ * @unlisted
125
+ */
126
+ export interface MessageVideo extends MessageMediaBase {
127
+ /** The video included in the message. */
128
+ video: Video;
129
+ }
130
+ /**
131
+ * A sticker message.
132
+ * @unlisted
133
+ */
134
+ export interface MessageSticker extends MessageBase {
135
+ /** The sticker included in the message. */
136
+ sticker: Sticker;
137
+ }
138
+ /**
139
+ * An animation message. Animations are GIFs or H.264/MPEG-4 AVC videos without sound.
140
+ * @unlisted
141
+ */
142
+ export interface MessageAnimation extends MessageMediaBase {
143
+ /** The animation included in the message. */
144
+ animation: Animation;
145
+ }
146
+ /**
147
+ * A voice message.
148
+ * @unlisted
149
+ */
150
+ export interface MessageVoice extends MessageMediaBase {
151
+ /** The voice included in the message. */
152
+ voice: Voice;
153
+ }
154
+ /**
155
+ * An audio message.
156
+ * @unlisted
157
+ */
158
+ export interface MessageAudio extends MessageMediaBase {
159
+ /** The audio included in the message. */
160
+ audio: Audio;
161
+ }
162
+ /**
163
+ * A dice message.
164
+ * @unlisted
165
+ */
166
+ export interface MessageDice extends MessageBase {
167
+ /** The dice included in the message. */
168
+ dice: Dice;
169
+ }
170
+ /**
171
+ * A video note message.
172
+ * @unlisted
173
+ */
174
+ export interface MessageVideoNote extends MessageBase {
175
+ /** The video note included in the message. */
176
+ videoNote: VideoNote;
177
+ }
178
+ /**
179
+ * A contact message.
180
+ * @unlisted
181
+ */
182
+ export interface MessageContact extends MessageBase {
183
+ /** The contact included in the message. */
184
+ contact: Contact;
185
+ }
186
+ /**
187
+ * A game message.
188
+ * @unlisted
189
+ */
190
+ export interface MessageGame extends MessageBase {
191
+ /** The game included in the message. */
192
+ game: Game;
193
+ }
194
+ /**
195
+ * A poll message.
196
+ * @unlisted
197
+ */
198
+ export interface MessagePoll extends MessageBase {
199
+ /** The poll included in the message. */
200
+ poll: Poll;
201
+ }
202
+ /**
203
+ * A venue message.
204
+ * @unlisted
205
+ */
206
+ export interface MessageVenue extends MessageBase {
207
+ /** The venue included in the message. */
208
+ venue: Venue;
209
+ }
210
+ /**
211
+ * A location message.
212
+ * @unlisted
213
+ */
214
+ export interface MessageLocation extends MessageBase {
215
+ /** The location included in the message. */
216
+ location: Location;
217
+ }
218
+ /**
219
+ * A message that is received when new members join a chat.
220
+ * @unlisted
221
+ */
222
+ export interface MessageNewChatMembers extends MessageBase {
223
+ /** The new members of the chat. */
224
+ newChatMembers: User[];
225
+ }
226
+ /**
227
+ * A message that is received when a member leaves a chat.
228
+ * @unlisted
229
+ */
230
+ export interface MessageLeftChatMember extends MessageBase {
231
+ /** The member who left the chat. */
232
+ leftChatMember: User;
233
+ }
234
+ /**
235
+ * A message that is received when a chat's title is changed.
236
+ * @unlisted
237
+ */
238
+ export interface MessageNewChatTitle extends MessageBase {
239
+ /** The new title of the chat. */
240
+ newChatTitle: string;
241
+ }
242
+ /**
243
+ * A message that is received when a chat's photo is changed.
244
+ * @unlisted
245
+ */
246
+ export interface MessageNewChatPhoto extends MessageBase {
247
+ /** The new photo of the chat. */
248
+ newChatPhoto: Photo;
249
+ }
250
+ /**
251
+ * A message that is received when a chat's photo is removed.
252
+ * @unlisted
253
+ */
254
+ export interface MessageDeletedChatPhoto extends MessageBase {
255
+ deletedChatPhoto: true;
256
+ }
257
+ /**
258
+ * A message that is received by user accounts when a group is created.
259
+ * While bots don't receive them, they are able to see them if someone replies to them.
260
+ * @unlisted
261
+ */
262
+ export interface MessageGroupCreated extends MessageBase {
263
+ groupCreated: true;
264
+ /** The initial members of the group. */
265
+ newChatMembers: User[];
266
+ }
267
+ /**
268
+ * A message that is received by user accounts when a supergroup is created.
269
+ * While bots don't receive them, they are able to see them if someone replies to them.
270
+ * @unlisted
271
+ */
272
+ export interface MessageSupergroupCreated extends MessageBase {
273
+ supergroupCreated: true;
274
+ }
275
+ /**
276
+ * A message that is received by user accounts when a channel is created.
277
+ * While bots don't receive them, they are able to see them if someone replies to them.
278
+ * @unlisted
279
+ */
280
+ export interface MessageChannelCreated extends MessageBase {
281
+ channelCreated: true;
282
+ }
283
+ /**
284
+ * A message that is received when a chat's auto-delete timer is changed.
285
+ * @unlisted
286
+ */
287
+ export interface MessageAutoDeleteTimerChanged extends MessageBase {
288
+ /** The new auto-delete time in seconds. */
289
+ newAutoDeleteTime: number;
290
+ }
291
+ /**
292
+ * A message that is received when a supergroup is created as a result of a group migration.
293
+ * @unlisted
294
+ */
295
+ export interface MessageChatMigratedTo extends MessageBase {
296
+ /** The supergroup's ID. */
297
+ chatMigratedTo: number;
298
+ }
299
+ /**
300
+ * A message that is received when a group is migrated to a supergroup.
301
+ * @unlisted
302
+ */
303
+ export interface MessageChatMigratedFrom extends MessageBase {
304
+ /** The group's ID. */
305
+ chatMigratedFrom: number;
306
+ }
307
+ /**
308
+ * A message that is received when a message is pinned in a chat.
309
+ * @unlisted
310
+ */
311
+ export interface MessagePinnedMessage extends MessageBase {
312
+ /** The message that was pinned. */
313
+ pinnedMessage: Message;
314
+ }
315
+ /**
316
+ * A message that is received when a bot account receives a shared user.
317
+ * @unlisted
318
+ */
319
+ export interface MessageUserShared extends MessageBase {
320
+ userShared: {
321
+ requestId: number;
322
+ userId: number;
323
+ };
324
+ }
325
+ /**
326
+ * A message that is received when a bot is allowed to message a user.
327
+ * @unlisted
328
+ */
329
+ export interface MessageWriteAccessAllowed extends MessageBase {
330
+ writeAccessAllowed: {
331
+ webAppName?: string;
332
+ };
333
+ }
334
+ /**
335
+ * A message that is received when a new topic is created in a forum.
336
+ * @unlisted
337
+ */
338
+ export interface MessageForumTopicCreated extends MessageBase {
339
+ forumTopicCreated: {
340
+ name: string;
341
+ iconColor: string;
342
+ iconCutsomEmojiId?: string;
343
+ };
344
+ }
345
+ /**
346
+ * A message that is received when a topic is edited in a forum.
347
+ * @unlisted
348
+ */
349
+ export interface MessageForumTopicEdited extends MessageBase {
350
+ forumTopicEdited: {
351
+ name: string;
352
+ iconCutsomEmojiId?: string;
353
+ };
354
+ }
355
+ /**
356
+ * A message that is received when a topic is closed in a forum.
357
+ * @unlisted
358
+ */
359
+ export interface MessageForumTopicClosed extends MessageBase {
360
+ forumTopicClosed: true;
361
+ }
362
+ /**
363
+ * A message that is received when a topic is reopened in a forum.
364
+ * @unlisted
365
+ */
366
+ export interface MessageForumTopicReopened extends MessageBase {
367
+ forumTopicReopened: true;
368
+ }
369
+ /**
370
+ * A message that is received when a video chat is scheduled in a chat.
371
+ * @unlisted
372
+ */
373
+ export interface MessageVideoChatScheduled extends MessageBase {
374
+ videoChatScheduled: {
375
+ startDate: Date;
376
+ };
377
+ }
378
+ /**
379
+ * A message that is received when a video chat is started in a chat.
380
+ * @unlisted
381
+ */
382
+ export interface MessageVideoChatStarted extends MessageBase {
383
+ videoChatStarted: true;
384
+ }
385
+ /**
386
+ * A message that is received when a video chat is ended in a chat.
387
+ * @unlisted
388
+ */
389
+ export interface MessageVideoChatEnded extends MessageBase {
390
+ videoChatEnded: {
391
+ duration: number;
392
+ };
393
+ }
394
+ /**
395
+ * A message that is received when a giveaway is started in a chat.
396
+ * @unlisted
397
+ */
398
+ export interface MessageGiveaway extends MessageBase {
399
+ giveaway: Giveaway;
400
+ }
401
+ /**
402
+ * An unsupported message.
403
+ * @unlisted
404
+ */
405
+ export interface MessageUnsupported extends MessageBase {
406
+ unsupported: true;
407
+ }
408
+ /** @unlisted */
409
+ export interface MessageTypes {
410
+ text: MessageText;
411
+ photo: MessagePhoto;
412
+ document: MessageDocument;
413
+ video: MessageVideo;
414
+ sticker: MessageSticker;
415
+ animation: MessageAnimation;
416
+ voice: MessageVoice;
417
+ audio: MessageAudio;
418
+ dice: MessageDice;
419
+ videoNote: MessageVideoNote;
420
+ contact: MessageContact;
421
+ game: MessageGame;
422
+ poll: MessagePoll;
423
+ venue: MessageVenue;
424
+ location: MessageLocation;
425
+ newChatMembers: MessageNewChatMembers;
426
+ leftChatMember: MessageLeftChatMember;
427
+ newChatTitle: MessageNewChatTitle;
428
+ newChatPhoto: MessageNewChatPhoto;
429
+ deletedChatPhoto: MessageDeletedChatPhoto;
430
+ groupCreated: MessageGroupCreated;
431
+ supergroupCreated: MessageSupergroupCreated;
432
+ channelCreated: MessageChannelCreated;
433
+ newAutoDeleteTime: MessageAutoDeleteTimerChanged;
434
+ chatMigratedTo: MessageChatMigratedTo;
435
+ chatMigratedFrom: MessageChatMigratedFrom;
436
+ pinnedMessage: MessagePinnedMessage;
437
+ userShared: MessageUserShared;
438
+ writeAccessAllowed: MessageWriteAccessAllowed;
439
+ forumTopicCreated: MessageForumTopicCreated;
440
+ forumTopicEdited: MessageForumTopicEdited;
441
+ forumTopicClosed: MessageForumTopicClosed;
442
+ forumTopicReopened: MessageForumTopicReopened;
443
+ videoChatScheduled: MessageVideoChatScheduled;
444
+ videoChatStarted: MessageVideoChatStarted;
445
+ videoChatEnded: MessageVideoChatEnded;
446
+ giveaway: MessageGiveaway;
447
+ unsupported: MessageUnsupported;
448
+ }
449
+ export declare function assertMessageType<T extends keyof MessageTypes>(message: Message, type: T): MessageTypes[T];
450
+ export type Message = MessageText | MessagePhoto | MessageDocument | MessageVideo | MessageSticker | MessageAnimation | MessageVoice | MessageAudio | MessageDice | MessageVideoNote | MessageContact | MessageGame | MessagePoll | MessageVenue | MessageLocation | MessageNewChatMembers | MessageLeftChatMember | MessageNewChatTitle | MessageNewChatPhoto | MessageDeletedChatPhoto | MessageGroupCreated | MessageSupergroupCreated | MessageChannelCreated | MessageAutoDeleteTimerChanged | MessageChatMigratedTo | MessageChatMigratedFrom | MessagePinnedMessage | MessageUserShared | MessageWriteAccessAllowed | MessageForumTopicCreated | MessageForumTopicEdited | MessageForumTopicClosed | MessageForumTopicReopened | MessageVideoChatScheduled | MessageVideoChatStarted | MessageVideoChatEnded | MessageGiveaway | MessageUnsupported;
451
+ /** @unlisted */
452
+ export interface MessageGetter {
453
+ (chatId: number, messageId: number): MaybePromise<Message | null>;
454
+ }
455
+ type Message_MessageGetter = MessageGetter | null;
456
+ export declare function constructMessage(message_: enums.Message, getEntity: EntityGetter, getMessage: Message_MessageGetter, getStickerSetName: StickerSetNameGetter, getReply_?: boolean): Promise<Message>;
457
+ export {};