@mtkruto/node 0.1.132 → 0.1.133
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_types.d.ts +3 -0
- package/esm/3_types.js +3 -0
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/client/0_utilities.d.ts +2 -2
- package/esm/client/0_utilities.js +3 -5
- package/esm/client/3_types.d.ts +10 -5
- package/esm/client/4_composer.d.ts +4 -4
- package/esm/client/4_composer.js +13 -1
- package/esm/client/5_client.d.ts +36 -36
- package/esm/client/5_client.js +181 -177
- 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/types/0_chat_photo.d.ts +22 -21
- package/esm/types/0_giveaway_parameters.d.ts +9 -0
- package/esm/types/0_giveaway_parameters.js +9 -0
- package/esm/types/0_message_entity.d.ts +93 -74
- package/esm/types/0_reaction.d.ts +13 -10
- package/esm/types/0_reaction.js +16 -1
- package/esm/types/1_bot_command_scope.d.ts +32 -27
- package/esm/types/1_chat_p.d.ts +76 -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 +62 -56
- 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_user.d.ts +2 -2
- package/esm/types/2_inline_keyboard_button.d.ts +44 -37
- package/esm/types/3_message.d.ts +170 -113
- package/esm/types/3_message.js +218 -121
- package/esm/types/4_chat.d.ts +32 -29
- package/package.json +1 -1
- package/script/3_types.d.ts +3 -0
- package/script/3_types.js +3 -0
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/client/0_utilities.d.ts +2 -2
- package/script/client/0_utilities.js +3 -5
- package/script/client/3_types.d.ts +10 -5
- package/script/client/4_composer.d.ts +4 -4
- package/script/client/4_composer.js +13 -1
- package/script/client/5_client.d.ts +36 -36
- package/script/client/5_client.js +180 -176
- 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/types/0_chat_photo.d.ts +22 -21
- package/script/types/0_giveaway_parameters.d.ts +9 -0
- package/script/types/0_giveaway_parameters.js +13 -0
- package/script/types/0_message_entity.d.ts +93 -74
- package/script/types/0_reaction.d.ts +13 -10
- package/script/types/0_reaction.js +19 -0
- package/script/types/1_bot_command_scope.d.ts +32 -27
- package/script/types/1_chat_p.d.ts +76 -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 +62 -56
- 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_user.d.ts +2 -2
- package/script/types/2_inline_keyboard_button.d.ts +44 -37
- package/script/types/3_message.d.ts +170 -113
- package/script/types/3_message.js +220 -122
- package/script/types/4_chat.d.ts +32 -29
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UNREACHABLE } from "../1_utilities.js";
|
|
2
|
+
import { peerToChatId, types } from "../2_tl.js";
|
|
3
|
+
import { constructReaction } from "./0_reaction.js";
|
|
4
|
+
export function constructMessageReaction(reaction_, recentReactions) {
|
|
5
|
+
const choosers = recentReactions
|
|
6
|
+
.filter((v) => {
|
|
7
|
+
if (reaction_.reaction instanceof types.ReactionEmoji) {
|
|
8
|
+
return v.reaction instanceof types.ReactionEmoji && v.reaction.emoticon == reaction_.reaction.emoticon;
|
|
9
|
+
}
|
|
10
|
+
else if (reaction_.reaction instanceof types.ReactionCustomEmoji) {
|
|
11
|
+
return v.reaction instanceof types.ReactionCustomEmoji && v.reaction.document_id == reaction_.reaction.document_id;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
UNREACHABLE();
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
.map((v) => peerToChatId(v.peer_id));
|
|
18
|
+
const reaction = constructReaction(reaction_.reaction);
|
|
19
|
+
const count = reaction_.count;
|
|
20
|
+
const chosen = reaction_.chosen_order !== undefined ? true : false;
|
|
21
|
+
return { reaction, count, choosers, chosen };
|
|
22
|
+
}
|
package/esm/types/1_user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { types } from "../2_tl.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ChatPhotoUser } from "./0_chat_photo.js";
|
|
3
3
|
/** This object represents a Telegram user or bot. */
|
|
4
4
|
export interface User {
|
|
5
5
|
/** Unique identifier for this user or bot */
|
|
@@ -17,7 +17,7 @@ export interface User {
|
|
|
17
17
|
/** Additional usernames */
|
|
18
18
|
also?: string[];
|
|
19
19
|
/** The user's photo. */
|
|
20
|
-
photo?:
|
|
20
|
+
photo?: ChatPhotoUser;
|
|
21
21
|
/** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
|
|
22
22
|
languageCode?: string;
|
|
23
23
|
/** True, if the user is a scam user */
|
|
@@ -2,44 +2,51 @@ import { enums } from "../2_tl.js";
|
|
|
2
2
|
import { LoginUrl } from "./0_login_url.js";
|
|
3
3
|
import { WebAppInfo } from "./0_web_app_info.js";
|
|
4
4
|
import { UsernameResolver } from "./1__getters.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
5
|
+
/** @unlisted */
|
|
6
|
+
export interface InlineKeyboardButtonBase {
|
|
7
|
+
/** Label text on the button */
|
|
8
|
+
text: string;
|
|
9
|
+
}
|
|
10
|
+
/** @unlisted */
|
|
11
|
+
export interface InlineKeyboardButtonURL extends InlineKeyboardButtonBase {
|
|
12
|
+
/** HTTP or tg:// URL to be opened when the button is pressed. Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
/** @unlisted */
|
|
16
|
+
export interface InlineKeyboardButtonCallback extends InlineKeyboardButtonBase {
|
|
17
|
+
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
|
|
18
|
+
callbackData: string;
|
|
19
|
+
}
|
|
20
|
+
/** @unlisted */
|
|
21
|
+
export interface InlineKeyboardButtonWebApp extends InlineKeyboardButtonBase {
|
|
22
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
|
|
23
|
+
webApp: WebAppInfo;
|
|
24
|
+
}
|
|
25
|
+
/** @unlisted */
|
|
26
|
+
export interface InlineKeyboardButtonLogin extends InlineKeyboardButtonBase {
|
|
27
|
+
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login). */
|
|
28
|
+
loginUrl: LoginUrl;
|
|
29
|
+
}
|
|
30
|
+
/** @unlisted */
|
|
31
|
+
export interface InlineKeyboardButtonSwitchInline extends InlineKeyboardButtonBase {
|
|
32
|
+
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. */
|
|
33
|
+
switchInlineQuery: string;
|
|
34
|
+
}
|
|
35
|
+
/** @unlisted */
|
|
36
|
+
export interface InlineKeyboardButtonSwitchInlineCurrent extends InlineKeyboardButtonBase {
|
|
37
|
+
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. */
|
|
38
|
+
switchInlineQueryCurrentChat: string;
|
|
39
|
+
}
|
|
40
|
+
/** @unlisted */
|
|
41
|
+
export interface InlineKeyboardButtonGame extends InlineKeyboardButtonBase {
|
|
42
|
+
callbackGame: Record<never, never>;
|
|
43
|
+
}
|
|
44
|
+
/** @unlisted */
|
|
45
|
+
export interface InlineKeyboardButtonPay extends InlineKeyboardButtonBase {
|
|
46
|
+
/** Specify True to send a Pay button */
|
|
47
|
+
pay: boolean;
|
|
41
48
|
}
|
|
42
49
|
/** This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. */
|
|
43
|
-
export type InlineKeyboardButton =
|
|
50
|
+
export type InlineKeyboardButton = InlineKeyboardButtonURL | InlineKeyboardButtonCallback | InlineKeyboardButtonWebApp | InlineKeyboardButtonLogin | InlineKeyboardButtonSwitchInline | InlineKeyboardButtonSwitchInlineCurrent | InlineKeyboardButtonGame | InlineKeyboardButtonPay;
|
|
44
51
|
export declare function constructInlineKeyboardButton(button_: enums.KeyboardButton): InlineKeyboardButton;
|
|
45
52
|
export declare function inlineKeyboardButtonToTlObject(button: InlineKeyboardButton, usernameResolver: UsernameResolver): Promise<import("../tl/2_types.js").KeyboardButtonUrl_ | import("../tl/2_types.js").KeyboardButtonCallback_ | import("../tl/2_types.js").KeyboardButtonSwitchInline_ | import("../tl/2_types.js").KeyboardButtonBuy_ | import("../tl/2_types.js").InputKeyboardButtonUrlAuth_ | import("../tl/2_types.js").KeyboardButtonWebView_>;
|
package/esm/types/3_message.d.ts
CHANGED
|
@@ -11,172 +11,229 @@ import { Venue } from "./0_venue.js";
|
|
|
11
11
|
import { Voice } from "./0_voice.js";
|
|
12
12
|
import { EntityGetter } from "./1__getters.js";
|
|
13
13
|
import { Animation } from "./1_animation.js";
|
|
14
|
-
import { ReplyQuote } from "./1_reply_quote.js";
|
|
15
14
|
import { ChatP } from "./1_chat_p.js";
|
|
16
15
|
import { Document } from "./1_document.js";
|
|
16
|
+
import { ReplyQuote } from "./1_reply_quote.js";
|
|
17
17
|
import { Photo } from "./1_photo.js";
|
|
18
18
|
import { Poll } from "./1_poll.js";
|
|
19
19
|
import { Sticker, StickerSetNameGetter } from "./1_sticker.js";
|
|
20
20
|
import { User } from "./1_user.js";
|
|
21
21
|
import { VideoNote } from "./1_video_note.js";
|
|
22
22
|
import { Video } from "./1_video.js";
|
|
23
|
+
import { MessageReaction } from "./1_message_reaction.js";
|
|
24
|
+
import { Giveaway } from "./1_giveaway.js";
|
|
23
25
|
import { Game } from "./2_game.js";
|
|
24
26
|
import { ReplyKeyboardMarkup } from "./2_reply_keyboard_markup.js";
|
|
25
27
|
import { InlineKeyboardMarkup } from "./3_inline_keyboard_markup.js";
|
|
26
|
-
/**
|
|
27
|
-
export interface
|
|
28
|
-
/** Whether the message is outgoing */
|
|
28
|
+
/** Properties shared between all message types. */
|
|
29
|
+
export interface MessageBase {
|
|
29
30
|
out: boolean;
|
|
30
|
-
/** Unique message identifier inside this chat */
|
|
31
31
|
id: number;
|
|
32
|
-
/** Unique identifier of a message thread to which the message belongs; for supergroups only */
|
|
33
32
|
threadId?: number;
|
|
34
|
-
/** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
|
|
35
33
|
from?: User;
|
|
36
|
-
/** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
|
|
37
34
|
senderChat?: ChatP;
|
|
38
|
-
/** Date the message was sent in Unix time */
|
|
39
35
|
date: Date;
|
|
40
|
-
/** Conversation the message belongs to */
|
|
41
36
|
chat: ChatP;
|
|
42
|
-
/** A link to the message */
|
|
43
37
|
link?: string;
|
|
44
|
-
/** For forwarded messages, sender of the original message */
|
|
45
38
|
forwardFrom?: User;
|
|
46
|
-
/** For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
|
|
47
39
|
forwardFromChat?: ChatP;
|
|
48
|
-
/** For messages forwarded from channels, identifier of the original message in the channel */
|
|
49
40
|
forwardId?: number;
|
|
50
|
-
/** For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
|
|
51
41
|
forwardSignature?: string;
|
|
52
|
-
/** Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
|
|
53
42
|
forwardSenderName?: string;
|
|
54
|
-
/** For forwarded messages, date the original message was sent in Unix time */
|
|
55
43
|
forwardDate?: Date;
|
|
56
|
-
/** True, if the message is sent to a forum topic */
|
|
57
44
|
isTopicMessage: boolean;
|
|
58
|
-
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
59
45
|
isAutomaticForward?: boolean;
|
|
60
|
-
|
|
61
|
-
replyToMessage?: Omit<Message, "replyToMessage">;
|
|
46
|
+
replyToMessage?: Message;
|
|
62
47
|
replyToMessageId?: number;
|
|
48
|
+
reactions?: MessageReaction[];
|
|
63
49
|
replyQuote?: ReplyQuote;
|
|
64
|
-
/** Bot through which the message was sent */
|
|
65
50
|
viaBot?: User;
|
|
66
|
-
/** Date the message was last edited in Unix time */
|
|
67
51
|
editDate?: Date;
|
|
68
|
-
/** True, if the message can't be forwarded */
|
|
69
52
|
hasProtectedContent?: boolean;
|
|
70
|
-
/** The unique identifier of a media message group this message belongs to */
|
|
71
53
|
mediaGroupId?: string;
|
|
72
|
-
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
73
54
|
authorSignature?: string;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
55
|
+
views?: number;
|
|
56
|
+
replyMarkup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
|
|
57
|
+
}
|
|
58
|
+
/** Properties shared between media message types. */
|
|
59
|
+
export interface MessageMediaBase extends MessageBase {
|
|
79
60
|
caption?: string;
|
|
80
|
-
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
|
|
81
61
|
captionEntities?: MessageEntity[];
|
|
82
|
-
/** True, if the message media is covered by a spoiler animation */
|
|
83
62
|
hasMediaSpoiler?: boolean;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
63
|
+
}
|
|
64
|
+
export interface MessageText extends MessageBase {
|
|
65
|
+
text: string;
|
|
66
|
+
entities: MessageEntity[];
|
|
67
|
+
}
|
|
68
|
+
export interface MessagePhoto extends MessageMediaBase {
|
|
69
|
+
photo: Photo;
|
|
70
|
+
}
|
|
71
|
+
export interface MessageDocument extends MessageMediaBase {
|
|
72
|
+
document: Document;
|
|
73
|
+
}
|
|
74
|
+
export interface MessageVideo extends MessageMediaBase {
|
|
75
|
+
video: Video;
|
|
76
|
+
}
|
|
77
|
+
export interface MessageSticker extends MessageBase {
|
|
78
|
+
sticker: Sticker;
|
|
79
|
+
}
|
|
80
|
+
export interface MessageAnimation extends MessageMediaBase {
|
|
81
|
+
animation: Animation;
|
|
82
|
+
}
|
|
83
|
+
export interface MessageVoice extends MessageMediaBase {
|
|
84
|
+
voice: Voice;
|
|
85
|
+
}
|
|
86
|
+
export interface MessageAudio extends MessageMediaBase {
|
|
87
|
+
audio: Audio;
|
|
88
|
+
}
|
|
89
|
+
export interface MessageDice extends MessageBase {
|
|
90
|
+
dice: Dice;
|
|
91
|
+
}
|
|
92
|
+
export interface MessageVideoNote extends MessageBase {
|
|
93
|
+
videoNote: VideoNote;
|
|
94
|
+
}
|
|
95
|
+
export interface MessageContact extends MessageBase {
|
|
96
|
+
contact: Contact;
|
|
97
|
+
}
|
|
98
|
+
export interface MessageGame extends MessageBase {
|
|
99
|
+
game: Game;
|
|
100
|
+
}
|
|
101
|
+
export interface MessagePoll extends MessageBase {
|
|
102
|
+
poll: Poll;
|
|
103
|
+
}
|
|
104
|
+
export interface MessageVenue extends MessageBase {
|
|
105
|
+
venue: Venue;
|
|
106
|
+
}
|
|
107
|
+
export interface MessageLocation extends MessageBase {
|
|
108
|
+
location: Location;
|
|
109
|
+
}
|
|
110
|
+
export interface MessageNewChatMembers extends MessageBase {
|
|
111
|
+
newChatMembers: User[];
|
|
112
|
+
}
|
|
113
|
+
export interface MessageLeftChatMember extends MessageBase {
|
|
114
|
+
leftChatMember: User;
|
|
115
|
+
}
|
|
116
|
+
export interface MessageNewChatTitle extends MessageBase {
|
|
117
|
+
newChatTitle: string;
|
|
118
|
+
}
|
|
119
|
+
export interface MessageNewChatPhoto extends MessageBase {
|
|
120
|
+
newChatPhoto: Photo;
|
|
121
|
+
}
|
|
122
|
+
export interface MessageDeletedChatPhoto extends MessageBase {
|
|
123
|
+
deletedChatPhoto: true;
|
|
124
|
+
}
|
|
125
|
+
export interface MessageGroupCreated extends MessageBase {
|
|
126
|
+
groupCreated: true;
|
|
127
|
+
newChatMembers: User[];
|
|
128
|
+
}
|
|
129
|
+
export interface MessageSupergroupCreated extends MessageBase {
|
|
130
|
+
supergroupCreated: true;
|
|
131
|
+
}
|
|
132
|
+
export interface MessageChannelCreated extends MessageBase {
|
|
133
|
+
channelCreated: true;
|
|
134
|
+
}
|
|
135
|
+
export interface MessageAutoDeleteTimerChanged extends MessageBase {
|
|
136
|
+
newAutoDeleteTime: number;
|
|
137
|
+
}
|
|
138
|
+
export interface MessageChatMigratedTo extends MessageBase {
|
|
139
|
+
chatMigratedTo: number;
|
|
140
|
+
}
|
|
141
|
+
export interface MessageChatMigratedFrom extends MessageBase {
|
|
142
|
+
chatMigratedFrom: number;
|
|
143
|
+
}
|
|
144
|
+
export interface MessagePinnedMessage extends MessageBase {
|
|
145
|
+
pinnedMessage: Message;
|
|
146
|
+
}
|
|
147
|
+
export interface MessageUserShared extends MessageBase {
|
|
148
|
+
userShared: {
|
|
144
149
|
requestId: number;
|
|
145
150
|
userId: number;
|
|
146
151
|
};
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
}
|
|
153
|
+
export interface MessageWriteAccessAllowed extends MessageBase {
|
|
154
|
+
writeAccessAllowed: {
|
|
149
155
|
webAppName?: string;
|
|
150
156
|
};
|
|
151
|
-
|
|
152
|
-
|
|
157
|
+
}
|
|
158
|
+
export interface MessageForumTopicCreated extends MessageBase {
|
|
159
|
+
forumTopicCreated: {
|
|
153
160
|
name: string;
|
|
154
161
|
iconColor: string;
|
|
155
162
|
iconCutsomEmojiId?: string;
|
|
156
163
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
}
|
|
165
|
+
export interface MessageForumTopicEdited extends MessageBase {
|
|
166
|
+
forumTopicEdited: {
|
|
167
|
+
name: string;
|
|
160
168
|
iconCutsomEmojiId?: string;
|
|
161
169
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
}
|
|
171
|
+
export interface MessageForumTopicClosed extends MessageBase {
|
|
172
|
+
forumTopicClosed: true;
|
|
173
|
+
}
|
|
174
|
+
export interface MessageForumTopicReopened extends MessageBase {
|
|
175
|
+
forumTopicReopened: true;
|
|
176
|
+
}
|
|
177
|
+
export interface MessageVideoChatScheduled extends MessageBase {
|
|
178
|
+
videoChatScheduled: {
|
|
168
179
|
startDate: Date;
|
|
169
180
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
181
|
+
}
|
|
182
|
+
export interface MessageVideoChatStarted extends MessageBase {
|
|
183
|
+
videoChatStarted: true;
|
|
184
|
+
}
|
|
185
|
+
export interface MessageVideoChatEnded extends MessageBase {
|
|
186
|
+
videoChatEnded: {
|
|
174
187
|
duration: number;
|
|
175
188
|
};
|
|
176
189
|
}
|
|
177
|
-
export interface
|
|
178
|
-
|
|
190
|
+
export interface MessageGiveaway extends MessageBase {
|
|
191
|
+
giveaway: Giveaway;
|
|
192
|
+
}
|
|
193
|
+
export interface MessageTypes {
|
|
194
|
+
text: MessageText;
|
|
195
|
+
photo: MessagePhoto;
|
|
196
|
+
document: MessageDocument;
|
|
197
|
+
video: MessageVideo;
|
|
198
|
+
sticker: MessageSticker;
|
|
199
|
+
animation: MessageAnimation;
|
|
200
|
+
voice: MessageVoice;
|
|
201
|
+
audio: MessageAudio;
|
|
202
|
+
dice: MessageDice;
|
|
203
|
+
videoNote: MessageVideoNote;
|
|
204
|
+
contact: MessageContact;
|
|
205
|
+
game: MessageGame;
|
|
206
|
+
poll: MessagePoll;
|
|
207
|
+
venue: MessageVenue;
|
|
208
|
+
location: MessageLocation;
|
|
209
|
+
newChatMembers: MessageNewChatMembers;
|
|
210
|
+
leftChatMember: MessageLeftChatMember;
|
|
211
|
+
newChatTitle: MessageNewChatTitle;
|
|
212
|
+
newChatPhoto: MessageNewChatPhoto;
|
|
213
|
+
deletedChatPhoto: MessageDeletedChatPhoto;
|
|
214
|
+
groupCreated: MessageGroupCreated;
|
|
215
|
+
supergroupCreated: MessageSupergroupCreated;
|
|
216
|
+
channelCreated: MessageChannelCreated;
|
|
217
|
+
newAutoDeleteTime: MessageAutoDeleteTimerChanged;
|
|
218
|
+
chatMigratedTo: MessageChatMigratedTo;
|
|
219
|
+
chatMigratedFrom: MessageChatMigratedFrom;
|
|
220
|
+
pinnedMessage: MessagePinnedMessage;
|
|
221
|
+
userShared: MessageUserShared;
|
|
222
|
+
writeAccessAllowed: MessageWriteAccessAllowed;
|
|
223
|
+
forumTopicCreated: MessageForumTopicCreated;
|
|
224
|
+
forumTopicEdited: MessageForumTopicEdited;
|
|
225
|
+
forumTopicClosed: MessageForumTopicClosed;
|
|
226
|
+
forumTopicReopened: MessageForumTopicReopened;
|
|
227
|
+
videoChatScheduled: MessageVideoChatScheduled;
|
|
228
|
+
videoChatStarted: MessageVideoChatStarted;
|
|
229
|
+
videoChatEnded: MessageVideoChatEnded;
|
|
230
|
+
giveaway: MessageGiveaway;
|
|
231
|
+
}
|
|
232
|
+
export declare function assertMessageType<T extends keyof MessageTypes>(message: Message, type: T): MessageTypes[T];
|
|
233
|
+
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;
|
|
234
|
+
export interface MessageGetter {
|
|
235
|
+
(chatId: number, messageId: number): MaybePromise<Message | null>;
|
|
179
236
|
}
|
|
180
|
-
type Message_MessageGetter = MessageGetter
|
|
237
|
+
type Message_MessageGetter = MessageGetter | null;
|
|
181
238
|
export declare function constructMessage(message_: enums.Message, getEntity: EntityGetter, getMessage: Message_MessageGetter, getStickerSetName: StickerSetNameGetter, getReply_?: boolean): Promise<Message>;
|
|
182
239
|
export {};
|