@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
|
@@ -2,12 +2,21 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { functions, ReadObject, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { BotCommand,
|
|
5
|
+
import { BotCommand, Chat, ChatAction, ChatID, ChatP, Document, InlineQueryResult, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageText, MessageTypes, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Reaction, Update, UpdateIntersection, UpdateMap, User } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { ClientAbstract } from "./0_client_abstract.js";
|
|
8
|
+
import { FileSource, WithUpdate } from "./0_utilities.js";
|
|
9
|
+
import { Composer, Middleware } from "./1_composer.js";
|
|
10
|
+
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, ClientParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageParams, ForwardMessagesParams, GetChatsParams, GetHistoryParams, GetMyCommandsParams, ReplyParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetMyCommandsParams, SetReactionsParams, UploadParams } from "./3_params.js";
|
|
11
|
+
export type NextFn<T = void> = () => Promise<T>;
|
|
12
|
+
export interface InvokeErrorHandler<C> {
|
|
13
|
+
(ctx: {
|
|
14
|
+
client: C;
|
|
15
|
+
error: unknown;
|
|
16
|
+
function: types.Type | functions.Function<unknown>;
|
|
17
|
+
n: number;
|
|
18
|
+
}, next: NextFn<boolean>): MaybePromise<boolean>;
|
|
19
|
+
}
|
|
11
20
|
declare const getEntity: unique symbol;
|
|
12
21
|
declare const getStickerSetName: unique symbol;
|
|
13
22
|
export declare const handleMigrationError: unique symbol;
|
|
@@ -25,62 +34,65 @@ export type Api = {
|
|
|
25
34
|
} ? Promisify<Functions[K][K_]["__F"]> : Functions[K][K_];
|
|
26
35
|
};
|
|
27
36
|
};
|
|
28
|
-
export interface Context
|
|
37
|
+
export interface Context {
|
|
29
38
|
/** The client that received the update. */
|
|
30
39
|
client: Client;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
/** The currently authorized user. */
|
|
41
|
+
me?: User;
|
|
42
|
+
/** Resolves to `message`, `editedMessage`, or the `message` field of `callbackQuery`. */
|
|
43
|
+
msg?: Message;
|
|
44
|
+
/** Resolves to `msg?.chat`. TODO */
|
|
45
|
+
chat?: ChatP;
|
|
46
|
+
/** Resolves to the `from` field of `message`, `editedMessage`, `callbackQuery`, or `inlineQuery`. */
|
|
47
|
+
from?: User;
|
|
48
|
+
/** Resolves to `msg?.senderChat`. */
|
|
49
|
+
senderChat?: ChatP;
|
|
40
50
|
/** Reply the received message with a text message. */
|
|
41
|
-
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
51
|
+
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<MessageText>;
|
|
42
52
|
/** Reply the received message with a poll. */
|
|
43
|
-
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
53
|
+
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePoll>;
|
|
44
54
|
/** Reply the received message with a photo. */
|
|
45
|
-
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
55
|
+
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePhoto>;
|
|
46
56
|
/** Reply the received message with a document. */
|
|
47
|
-
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
57
|
+
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDocument>;
|
|
48
58
|
/** Reply the received message with a location. */
|
|
49
|
-
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
59
|
+
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageLocation>;
|
|
50
60
|
/** Reply the received message with a dice. */
|
|
51
|
-
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
61
|
+
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDice>;
|
|
52
62
|
/** Reply the received message with a venue. */
|
|
53
|
-
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
63
|
+
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVenue>;
|
|
54
64
|
/** Reply the received message with a contact. */
|
|
55
|
-
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
65
|
+
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<MessageContact>;
|
|
56
66
|
/** Reply the received message with a video. */
|
|
57
|
-
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
67
|
+
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideo>;
|
|
58
68
|
/** Reply the received message with an animation. */
|
|
59
|
-
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
69
|
+
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAnimation>;
|
|
60
70
|
/** Reply the received message with a voice message. */
|
|
61
|
-
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
71
|
+
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVoice>;
|
|
62
72
|
/** Reply the received message with an audio file. */
|
|
63
|
-
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
73
|
+
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAudio>;
|
|
64
74
|
/** Reply the received message with a video note. */
|
|
65
|
-
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<
|
|
75
|
+
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideoNote>;
|
|
66
76
|
/** Delete the received message. */
|
|
67
77
|
delete: () => Promise<void>;
|
|
68
78
|
/** Forward the received message. */
|
|
69
79
|
forward: (to: ChatID, params?: ForwardMessagesParams) => Promise<this["msg"]>;
|
|
80
|
+
/** Change the reactions made to the received message. */
|
|
81
|
+
react: (reactions: Reaction[], params?: SetReactionsParams) => Promise<void>;
|
|
70
82
|
/** Send a chat action to the chat which the message was received from. */
|
|
71
83
|
sendChatAction: (action: ChatAction, params?: {
|
|
72
84
|
messageThreadId?: number;
|
|
73
85
|
}) => Promise<void>;
|
|
74
86
|
/** Edit a message in the chat which the message was received from. */
|
|
75
|
-
editMessageText: (messageId: number, text: string, params?: EditMessageParams) => Promise<
|
|
87
|
+
editMessageText: (messageId: number, text: string, params?: EditMessageParams) => Promise<MessageText>;
|
|
76
88
|
/** Answer the received callback query. */
|
|
77
89
|
answerCallbackQuery: (params?: AnswerCallbackQueryParams) => Promise<void>;
|
|
78
90
|
/** Answer the received inline query. */
|
|
79
91
|
answerInlineQuery: (results: InlineQueryResult[], params?: AnswerInlineQueryParams) => Promise<void>;
|
|
80
92
|
/** Retrieve a single message of the chat which the message was received from. */
|
|
81
|
-
getMessage: (messageId: number) => Promise<
|
|
93
|
+
getMessage: (messageId: number) => Promise<Message | null>;
|
|
82
94
|
/** Retrieve multiple messages of the chat which the message was received from. */
|
|
83
|
-
getMessages: (messageIds: number[]) => Promise<
|
|
95
|
+
getMessages: (messageIds: number[]) => Promise<Message[]>;
|
|
84
96
|
/** Forward a message of the chat which the message was received from. */
|
|
85
97
|
forwardMessage: (to: ChatID, messageId: number, params?: ForwardMessagesParams) => Promise<Message>;
|
|
86
98
|
/** Forward multiple messages of the chat which the message was received from. */
|
|
@@ -93,6 +105,10 @@ export interface Context extends Update {
|
|
|
93
105
|
setAvailableReactions: (availableReactions: "none" | "all" | Reaction[]) => Promise<void>;
|
|
94
106
|
/** Add a reaction to a message of the chat which the message was received from. */
|
|
95
107
|
addReaction: (messageId: number, reaction: Reaction, params?: AddReactionParams) => Promise<void>;
|
|
108
|
+
/** Remove a reaction from a message of the chat which the message was received from. */
|
|
109
|
+
removeReaction: (messageId: number, reaction: Reaction) => Promise<void>;
|
|
110
|
+
/** Change the reactions made to a message of the chat which the message was received from. */
|
|
111
|
+
setReactions: (messageId: number, reactions: Reaction[], params?: SetReactionsParams) => Promise<void>;
|
|
96
112
|
toJSON: () => Update;
|
|
97
113
|
}
|
|
98
114
|
export declare function skipInvoke<C extends Context>(): InvokeErrorHandler<Client<C>>;
|
|
@@ -189,7 +205,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
189
205
|
* @param text The message's text.
|
|
190
206
|
* @returns The sent text message.
|
|
191
207
|
*/
|
|
192
|
-
sendMessage(chatId: ChatID, text: string, params?: SendMessageParams): Promise<
|
|
208
|
+
sendMessage(chatId: ChatID, text: string, params?: SendMessageParams): Promise<MessageText>;
|
|
193
209
|
/**
|
|
194
210
|
* Edit a message's text.
|
|
195
211
|
*
|
|
@@ -199,7 +215,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
199
215
|
* @param text The new text of the message.
|
|
200
216
|
* @returns The edited text message.
|
|
201
217
|
*/
|
|
202
|
-
editMessageText(chatId: ChatID, messageId: number, text: string, params?: EditMessageParams): Promise<
|
|
218
|
+
editMessageText(chatId: ChatID, messageId: number, text: string, params?: EditMessageParams): Promise<MessageText>;
|
|
203
219
|
/**
|
|
204
220
|
* Retrieve multiple messages.
|
|
205
221
|
*
|
|
@@ -211,7 +227,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
211
227
|
* ```
|
|
212
228
|
* @returns The retrieved messages.
|
|
213
229
|
*/
|
|
214
|
-
getMessages(chatId: ChatID, messageIds: number[]): Promise<
|
|
230
|
+
getMessages(chatId: ChatID, messageIds: number[]): Promise<Message[]>;
|
|
215
231
|
private [getMessageWithReply];
|
|
216
232
|
/**
|
|
217
233
|
* Retrieve a single message.
|
|
@@ -224,7 +240,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
224
240
|
* ```
|
|
225
241
|
* @returns The retrieved message.
|
|
226
242
|
*/
|
|
227
|
-
getMessage(chatId: ChatID, messageId: number): Promise<
|
|
243
|
+
getMessage(chatId: ChatID, messageId: number): Promise<Message | null>;
|
|
228
244
|
/**
|
|
229
245
|
* Download a file.
|
|
230
246
|
*
|
|
@@ -281,7 +297,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
281
297
|
* @param options The poll's options.
|
|
282
298
|
* @returns The sent poll.
|
|
283
299
|
*/
|
|
284
|
-
sendPoll(chatId: ChatID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<
|
|
300
|
+
sendPoll(chatId: ChatID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
|
|
285
301
|
/**
|
|
286
302
|
* Send a chat action.
|
|
287
303
|
*
|
|
@@ -319,21 +335,21 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
319
335
|
* @param results The results to answer with.
|
|
320
336
|
*/
|
|
321
337
|
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
322
|
-
use(...middleware: Middleware<C
|
|
323
|
-
branch(predicate: (ctx: C) => MaybePromise<boolean>, trueHandler_: Middleware<C
|
|
324
|
-
filter<D extends C>(predicate: (ctx: C) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>;
|
|
325
|
-
filter(predicate: (ctx: C) => MaybePromise<boolean>, ...middleware: Middleware<C
|
|
326
|
-
on<T extends keyof
|
|
338
|
+
use(...middleware: Middleware<UpdateIntersection<C>>[]): Composer<UpdateIntersection<C>>;
|
|
339
|
+
branch(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, trueHandler_: Middleware<UpdateIntersection<C>>, falseHandler_: Middleware<UpdateIntersection<C>>): Composer<UpdateIntersection<C>>;
|
|
340
|
+
filter<D extends C>(predicate: (ctx: UpdateIntersection<C>) => ctx is D, ...middleware: Middleware<D>[]): Composer<D>;
|
|
341
|
+
filter(predicate: (ctx: UpdateIntersection<C>) => MaybePromise<boolean>, ...middleware: Middleware<UpdateIntersection<C>>[]): Composer<C>;
|
|
342
|
+
on<T extends keyof UpdateMap, F extends string, K extends keyof MessageTypes>(filter: T extends "message" | "editedMessage" ? T | [T, K, ...F[]] : T, ...middleawre: Middleware<WithUpdate<C, T, K, F>>[]): Composer<WithUpdate<C, T, K, F>>;
|
|
327
343
|
command(commands: string | RegExp | (string | RegExp)[] | {
|
|
328
344
|
names: string | RegExp | (string | RegExp)[];
|
|
329
345
|
prefixes: string | string[];
|
|
330
|
-
}, ...middleawre: Middleware<
|
|
346
|
+
}, ...middleawre: Middleware<WithUpdate<C, "message", "text">>[]): Composer<WithUpdate<C, "message", "text", string>>;
|
|
331
347
|
/**
|
|
332
348
|
* Set the bot's description in the given language. Bot-only.
|
|
333
349
|
*
|
|
334
350
|
* @method
|
|
335
351
|
*/
|
|
336
|
-
setMyDescription(
|
|
352
|
+
setMyDescription(params?: {
|
|
337
353
|
description?: string;
|
|
338
354
|
languageCode?: string;
|
|
339
355
|
}): Promise<void>;
|
|
@@ -342,7 +358,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
342
358
|
*
|
|
343
359
|
* @method
|
|
344
360
|
*/
|
|
345
|
-
setMyName(
|
|
361
|
+
setMyName(params?: {
|
|
346
362
|
name?: string;
|
|
347
363
|
languageCode?: string;
|
|
348
364
|
}): Promise<void>;
|
|
@@ -351,7 +367,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
351
367
|
*
|
|
352
368
|
* @method
|
|
353
369
|
*/
|
|
354
|
-
setMyShortDescription(
|
|
370
|
+
setMyShortDescription(params?: {
|
|
355
371
|
shortDescription?: string;
|
|
356
372
|
languageCode?: string;
|
|
357
373
|
}): Promise<void>;
|
|
@@ -402,7 +418,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
402
418
|
* @param chatId The chat to send the photo to.
|
|
403
419
|
* @param photo The photo to send.
|
|
404
420
|
*/
|
|
405
|
-
sendPhoto(chatId: ChatID, photo: FileSource, params?: SendPhotoParams): Promise<
|
|
421
|
+
sendPhoto(chatId: ChatID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
|
|
406
422
|
/**
|
|
407
423
|
* Send a document.
|
|
408
424
|
*
|
|
@@ -410,7 +426,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
410
426
|
* @param chatId The chat to send the document to.
|
|
411
427
|
* @param document The document to send.
|
|
412
428
|
*/
|
|
413
|
-
sendDocument(chatId: ChatID, document: FileSource, params?: SendDocumentParams): Promise<
|
|
429
|
+
sendDocument(chatId: ChatID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
|
|
414
430
|
/**
|
|
415
431
|
* Send a video.
|
|
416
432
|
*
|
|
@@ -418,7 +434,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
418
434
|
* @param chatId The chat to send the video to.
|
|
419
435
|
* @param video The video to send.
|
|
420
436
|
*/
|
|
421
|
-
sendVideo(chatId: ChatID, video: FileSource, params?: SendVideoParams): Promise<
|
|
437
|
+
sendVideo(chatId: ChatID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
|
|
422
438
|
/**
|
|
423
439
|
* Send an animation.
|
|
424
440
|
*
|
|
@@ -426,7 +442,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
426
442
|
* @param chatId The chat to send the animation to.
|
|
427
443
|
* @param animation The animation to send.
|
|
428
444
|
*/
|
|
429
|
-
sendAnimation(chatId: ChatID, animation: FileSource, params?: SendAnimationParams): Promise<
|
|
445
|
+
sendAnimation(chatId: ChatID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
|
|
430
446
|
/**
|
|
431
447
|
* Send a voice message.
|
|
432
448
|
*
|
|
@@ -434,7 +450,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
434
450
|
* @param chatId The chat to send the voice message to.
|
|
435
451
|
* @param voice The voice to send.
|
|
436
452
|
*/
|
|
437
|
-
sendVoice(chatId: ChatID, voice: FileSource, params?: SendVoiceParams): Promise<
|
|
453
|
+
sendVoice(chatId: ChatID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
|
|
438
454
|
/**
|
|
439
455
|
* Send an audio file.
|
|
440
456
|
*
|
|
@@ -442,7 +458,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
442
458
|
* @param chatId The chat to send the audio file to.
|
|
443
459
|
* @param audio The audio to send.
|
|
444
460
|
*/
|
|
445
|
-
sendAudio(chatId: ChatID, audio: FileSource, params?: SendAudioParams): Promise<
|
|
461
|
+
sendAudio(chatId: ChatID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
|
|
446
462
|
/**
|
|
447
463
|
* Send a video note.
|
|
448
464
|
*
|
|
@@ -450,7 +466,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
450
466
|
* @param chatId The chat to send the video note to.
|
|
451
467
|
* @param videoNote The video note to send.
|
|
452
468
|
*/
|
|
453
|
-
sendVideoNote(chatId: ChatID, audio: FileSource, params?: SendVideoNoteParams): Promise<
|
|
469
|
+
sendVideoNote(chatId: ChatID, audio: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
|
|
454
470
|
/**
|
|
455
471
|
* Send a location.
|
|
456
472
|
*
|
|
@@ -459,7 +475,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
459
475
|
* @param latitude The location's latitude.
|
|
460
476
|
* @param longitude The location's longitude.
|
|
461
477
|
*/
|
|
462
|
-
sendLocation(chatId: ChatID, latitude: number, longitude: number, params?: SendLocationParams): Promise<
|
|
478
|
+
sendLocation(chatId: ChatID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
|
|
463
479
|
/**
|
|
464
480
|
* Send a contact.
|
|
465
481
|
*
|
|
@@ -468,14 +484,14 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
468
484
|
* @param firstName The contact's first name.
|
|
469
485
|
* @param number The contact's phone number.
|
|
470
486
|
*/
|
|
471
|
-
sendContact(chatId: ChatID, firstName: string, number: string, params?: SendContactParams): Promise<
|
|
487
|
+
sendContact(chatId: ChatID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
|
|
472
488
|
/**
|
|
473
489
|
* Send a dice.
|
|
474
490
|
*
|
|
475
491
|
* @method
|
|
476
492
|
* @param chatId The chat to send the dice to.
|
|
477
493
|
*/
|
|
478
|
-
sendDice(chatId: ChatID, params?: SendDiceParams): Promise<
|
|
494
|
+
sendDice(chatId: ChatID, params?: SendDiceParams): Promise<MessageDice>;
|
|
479
495
|
/**
|
|
480
496
|
* Send a venue.
|
|
481
497
|
*
|
|
@@ -486,7 +502,7 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
486
502
|
* @param title The title of the venue.
|
|
487
503
|
* @param address The written address of the venue.
|
|
488
504
|
*/
|
|
489
|
-
sendVenue(chatId: ChatID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<
|
|
505
|
+
sendVenue(chatId: ChatID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
|
|
490
506
|
/**
|
|
491
507
|
* Get network statistics. This might not always be available.
|
|
492
508
|
*
|
|
@@ -528,12 +544,28 @@ export declare class Client<C extends Context = Context> extends ClientAbstract
|
|
|
528
544
|
*/
|
|
529
545
|
setAvailableReactions(chatId: ChatID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
|
|
530
546
|
/**
|
|
531
|
-
*
|
|
547
|
+
* Change reactions made to a message.
|
|
548
|
+
*
|
|
549
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
550
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
551
|
+
* @param reactions The new reactions.
|
|
552
|
+
*/
|
|
553
|
+
setReactions(chatId: number, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
|
|
554
|
+
/**
|
|
555
|
+
* Make a reaction to a message.
|
|
532
556
|
*
|
|
533
557
|
* @param chatId The identifier of the chat which the message belongs to.
|
|
534
558
|
* @param messageId The identifier of the message to add the reaction to.
|
|
535
559
|
* @param reaction The reaction to add.
|
|
536
560
|
*/
|
|
537
561
|
addReaction(chatId: number, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
|
|
562
|
+
/**
|
|
563
|
+
* Undo a reaction made to a message.
|
|
564
|
+
*
|
|
565
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
566
|
+
* @param messageId The identifier of the message which the reaction was made to.
|
|
567
|
+
* @param reaction The reaction to remove.
|
|
568
|
+
*/
|
|
569
|
+
removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
|
|
538
570
|
}
|
|
539
571
|
export {};
|