@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.
- package/esm/3_errors.d.ts +519 -510
- package/esm/3_errors.js +521 -509
- package/esm/3_types.d.ts +19 -7
- package/esm/3_types.js +19 -7
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/4_errors.d.ts +7 -12
- package/esm/4_errors.js +6 -7
- package/esm/5_client.d.ts +3 -3
- package/esm/5_client.js +3 -3
- package/esm/client/0_utilities.d.ts +30 -2
- package/esm/client/0_utilities.js +13 -5
- package/esm/client/1_composer.d.ts +30 -0
- package/esm/client/{4_composer.js → 1_composer.js} +15 -2
- package/esm/client/2_client_plain.d.ts +1 -1
- package/esm/client/2_client_plain.js +1 -1
- package/esm/client/{3_types.d.ts → 3_params.d.ts} +68 -172
- package/esm/client/3_params.js +1 -0
- package/esm/client/{5_client.d.ts → 4_client.d.ts} +89 -57
- package/esm/client/{5_client.js → 4_client.js} +499 -308
- package/esm/client/5_composer.d.ts +4 -0
- package/esm/client/5_composer.js +3 -0
- package/esm/storage/0_storage.d.ts +4 -1
- package/esm/storage/0_storage.js +36 -7
- package/esm/storage/1_storage_indexed_db.d.ts +6 -2
- package/esm/storage/1_storage_indexed_db.js +7 -5
- package/esm/storage/1_storage_local_storage.d.ts +1 -1
- package/esm/storage/1_storage_local_storage.js +1 -1
- package/esm/storage/1_storage_memory.d.ts +1 -1
- package/esm/storage/1_storage_memory.js +1 -1
- package/esm/storage/1_storage_session_storage.d.ts +1 -1
- package/esm/storage/1_storage_session_storage.js +1 -1
- package/esm/tl/2_types.d.ts +313 -24
- package/esm/tl/2_types.js +982 -46
- package/esm/tl/3_functions.d.ts +95 -32
- package/esm/tl/3_functions.js +227 -66
- package/esm/tl/3_utilities.d.ts +1 -0
- package/esm/tl/3_utilities.js +14 -0
- package/esm/tl/6_message.js +1 -1
- package/esm/types/0_authorization_state.d.ts +5 -0
- package/esm/types/0_authorization_state.js +1 -0
- package/esm/types/0_chat_photo.d.ts +22 -21
- package/esm/types/0_connection_state.d.ts +17 -0
- package/esm/types/0_connection_state.js +1 -0
- package/esm/types/0_giveaway_parameters.d.ts +9 -0
- package/esm/types/0_giveaway_parameters.js +9 -0
- package/esm/types/0_login_url.d.ts +0 -4
- package/esm/types/0_mask_position.d.ts +0 -4
- package/esm/types/0_message_entity.d.ts +91 -74
- package/esm/types/0_message_identifier.d.ts +4 -0
- package/esm/types/0_message_identifier.js +1 -0
- package/esm/types/0_network_statistics_entry.d.ts +4 -0
- package/esm/types/0_network_statistics_entry.js +1 -0
- package/esm/types/0_reaction.d.ts +14 -10
- package/esm/types/0_reaction.js +29 -1
- package/esm/types/1__getters.d.ts +3 -0
- package/esm/types/1_bot_command_scope.d.ts +32 -27
- package/esm/types/1_chat_p.d.ts +77 -68
- package/esm/types/1_giveaway.d.ts +8 -0
- package/esm/types/1_giveaway.js +7 -0
- package/esm/types/1_keyboard_button.d.ts +41 -57
- package/esm/types/1_keyboard_button.js +3 -0
- package/esm/types/1_message_reaction.d.ts +14 -0
- package/esm/types/1_message_reaction.js +22 -0
- package/esm/types/1_network_statistics.d.ts +5 -0
- package/esm/types/1_network_statistics.js +1 -0
- package/esm/types/1_poll.d.ts +0 -13
- package/esm/types/1_reaction_count.d.ts +7 -0
- package/esm/types/1_reaction_count.js +6 -0
- package/esm/types/1_user.d.ts +2 -2
- package/esm/types/2_game.d.ts +0 -7
- package/esm/types/2_inline_keyboard_button.d.ts +36 -37
- package/esm/types/2_inline_query.d.ts +0 -6
- package/esm/types/2_message_interactions.d.ts +8 -0
- package/esm/types/2_message_interactions.js +1 -0
- package/esm/types/2_message_reaction_count.d.ts +8 -0
- package/esm/types/2_message_reaction_count.js +1 -0
- package/esm/types/2_reply_keyboard_markup.d.ts +0 -7
- package/esm/types/3_inline_keyboard_markup.d.ts +0 -2
- package/esm/types/4_message.d.ts +457 -0
- package/esm/types/{3_message.js → 4_message.js} +216 -129
- package/{script/types/4_callback_query.d.ts → esm/types/5_callback_query.d.ts} +1 -1
- package/esm/types/5_chat.d.ts +37 -0
- package/esm/types/{4_chat.js → 5_chat.js} +2 -2
- package/esm/types/6_update.d.ts +134 -0
- package/esm/types/6_update.js +1 -0
- package/package.json +1 -1
- package/script/3_errors.d.ts +519 -510
- package/script/3_errors.js +533 -520
- package/script/3_types.d.ts +19 -7
- package/script/3_types.js +19 -7
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/4_errors.d.ts +7 -12
- package/script/4_errors.js +5 -6
- package/script/5_client.d.ts +3 -3
- package/script/5_client.js +3 -3
- package/script/client/0_utilities.d.ts +30 -2
- package/script/client/0_utilities.js +15 -6
- package/script/client/1_composer.d.ts +30 -0
- package/script/client/{4_composer.js → 1_composer.js} +17 -4
- package/script/client/2_client_plain.d.ts +1 -1
- package/script/client/2_client_plain.js +2 -2
- package/script/client/{3_types.d.ts → 3_params.d.ts} +68 -172
- package/script/client/3_params.js +2 -0
- package/script/client/{5_client.d.ts → 4_client.d.ts} +89 -57
- package/script/client/{5_client.js → 4_client.js} +505 -314
- package/script/client/5_composer.d.ts +4 -0
- package/script/client/{6_composer.js → 5_composer.js} +2 -2
- package/script/storage/0_storage.d.ts +4 -1
- package/script/storage/0_storage.js +36 -7
- package/script/storage/1_storage_indexed_db.d.ts +6 -2
- package/script/storage/1_storage_indexed_db.js +7 -5
- package/script/storage/1_storage_local_storage.d.ts +1 -1
- package/script/storage/1_storage_local_storage.js +1 -1
- package/script/storage/1_storage_memory.d.ts +1 -1
- package/script/storage/1_storage_memory.js +1 -1
- package/script/storage/1_storage_session_storage.d.ts +1 -1
- package/script/storage/1_storage_session_storage.js +1 -1
- package/script/tl/2_types.d.ts +313 -24
- package/script/tl/2_types.js +1169 -217
- package/script/tl/3_functions.d.ts +95 -32
- package/script/tl/3_functions.js +241 -77
- package/script/tl/3_utilities.d.ts +1 -0
- package/script/tl/3_utilities.js +16 -1
- package/script/tl/6_message.js +1 -1
- package/script/types/0_authorization_state.d.ts +5 -0
- package/script/types/0_authorization_state.js +2 -0
- package/script/types/0_chat_photo.d.ts +22 -21
- package/script/types/0_connection_state.d.ts +17 -0
- package/script/types/0_connection_state.js +2 -0
- package/script/types/0_giveaway_parameters.d.ts +9 -0
- package/script/types/0_giveaway_parameters.js +13 -0
- package/script/types/0_login_url.d.ts +0 -4
- package/script/types/0_mask_position.d.ts +0 -4
- package/script/types/0_message_entity.d.ts +91 -74
- package/script/types/0_message_identifier.d.ts +4 -0
- package/script/types/0_message_identifier.js +2 -0
- package/script/types/0_network_statistics_entry.d.ts +4 -0
- package/script/types/0_network_statistics_entry.js +2 -0
- package/script/types/0_reaction.d.ts +14 -10
- package/script/types/0_reaction.js +33 -0
- package/script/types/1__getters.d.ts +3 -0
- package/script/types/1_bot_command_scope.d.ts +32 -27
- package/script/types/1_chat_p.d.ts +77 -68
- package/script/types/1_giveaway.d.ts +8 -0
- package/script/types/1_giveaway.js +11 -0
- package/script/types/1_keyboard_button.d.ts +41 -57
- package/script/types/1_keyboard_button.js +3 -0
- package/script/types/1_message_reaction.d.ts +14 -0
- package/script/types/1_message_reaction.js +26 -0
- package/script/types/1_network_statistics.d.ts +5 -0
- package/script/types/1_network_statistics.js +2 -0
- package/script/types/1_poll.d.ts +0 -13
- package/script/types/1_reaction_count.d.ts +7 -0
- package/script/types/1_reaction_count.js +10 -0
- package/script/types/1_user.d.ts +2 -2
- package/script/types/2_game.d.ts +0 -7
- package/script/types/2_inline_keyboard_button.d.ts +36 -37
- package/script/types/2_inline_query.d.ts +0 -6
- package/script/types/2_message_interactions.d.ts +8 -0
- package/script/types/2_message_interactions.js +2 -0
- package/script/types/2_message_reaction_count.d.ts +8 -0
- package/script/types/2_message_reaction_count.js +2 -0
- package/script/types/2_reply_keyboard_markup.d.ts +0 -7
- package/script/types/3_inline_keyboard_markup.d.ts +0 -2
- package/script/types/4_message.d.ts +457 -0
- package/script/types/{3_message.js → 4_message.js} +218 -130
- package/{esm/types/4_callback_query.d.ts → script/types/5_callback_query.d.ts} +1 -1
- package/script/types/5_chat.d.ts +37 -0
- package/script/types/{4_chat.js → 5_chat.js} +3 -3
- package/script/types/6_update.d.ts +134 -0
- package/script/types/6_update.js +2 -0
- package/esm/client/3_types.js +0 -11
- package/esm/client/4_composer.d.ts +0 -31
- package/esm/client/6_composer.d.ts +0 -4
- package/esm/client/6_composer.js +0 -3
- package/esm/types/3_message.d.ts +0 -182
- package/esm/types/4_chat.d.ts +0 -34
- package/script/client/3_types.js +0 -15
- package/script/client/4_composer.d.ts +0 -31
- package/script/client/6_composer.d.ts +0 -4
- package/script/types/3_message.d.ts +0 -182
- package/script/types/4_chat.d.ts +0 -34
- /package/esm/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
- /package/esm/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
- /package/esm/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
- /package/esm/types/{0_audio.js → 1_audio.js} +0 -0
- /package/esm/types/{4_callback_query.js → 5_callback_query.js} +0 -0
- /package/script/client/{1_client_abstract.d.ts → 0_client_abstract.d.ts} +0 -0
- /package/script/client/{1_client_abstract.js → 0_client_abstract.js} +0 -0
- /package/script/types/{0_audio.d.ts → 1_audio.d.ts} +0 -0
- /package/script/types/{0_audio.js → 1_audio.js} +0 -0
- /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 {};
|