@mtkruto/node 0.1.190 → 0.1.200
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/0_errors.d.ts +12 -0
- package/esm/0_errors.js +19 -0
- package/esm/1_utilities.d.ts +1 -1
- package/esm/1_utilities.js +1 -1
- package/esm/2_tl.d.ts +6 -6
- package/esm/2_tl.js +6 -6
- package/esm/3_storage.d.ts +5 -5
- package/esm/3_storage.js +5 -5
- package/esm/3_types.d.ts +6 -5
- package/esm/3_types.js +6 -5
- package/esm/4_constants.d.ts +2 -2
- package/esm/4_constants.js +2 -2
- package/esm/5_client.d.ts +1 -1
- package/esm/5_client.js +1 -1
- package/esm/client/0_client_abstract.js +3 -2
- package/esm/client/0_html.js +4 -3
- package/esm/client/0_markdown.js +6 -5
- package/esm/client/0_params.d.ts +7 -1
- package/esm/client/0_types.d.ts +1 -2
- package/esm/client/0_types.js +1 -2
- package/esm/client/0_utilities.d.ts +0 -3
- package/esm/client/0_utilities.js +2 -21
- package/esm/client/1_business_connection_manager.d.ts +11 -0
- package/esm/client/1_business_connection_manager.js +47 -0
- package/esm/client/1_client_encrypted.js +1 -1
- package/esm/client/1_client_plain.js +3 -4
- package/esm/client/1_composer.js +3 -2
- package/esm/client/1_file_manager.js +4 -4
- package/esm/client/1_update_manager.d.ts +8 -1
- package/esm/client/1_update_manager.js +88 -8
- package/esm/client/2_message_manager.d.ts +7 -6
- package/esm/client/2_message_manager.js +89 -74
- package/esm/client/3_chat_list_manager.js +3 -2
- package/esm/client/3_story_manager.js +2 -1
- package/esm/client/4_client.d.ts +422 -421
- package/esm/client/4_client.js +578 -520
- package/esm/mod.d.ts +1 -0
- package/esm/mod.js +1 -0
- package/esm/storage/0_storage.d.ts +5 -0
- package/esm/storage/0_storage.js +20 -0
- package/esm/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +1 -1
- package/esm/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +1 -1
- package/{script/storage/1_storage_memory.d.ts → esm/storage/2_storage_memory.d.ts} +1 -4
- package/esm/storage/{1_storage_memory.js → 2_storage_memory.js} +8 -28
- package/esm/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +1 -1
- package/esm/tl/2_types.d.ts +1071 -183
- package/esm/tl/2_types.js +2916 -464
- package/esm/tl/3_functions.d.ts +381 -17
- package/esm/tl/3_functions.js +1002 -120
- package/{script/tl/4_tl_writer.d.ts → esm/tl/5_tl_writer.d.ts} +1 -1
- package/{script/tl/4_rpc_result.d.ts → esm/tl/6_rpc_result.d.ts} +1 -1
- package/esm/tl/{4_rpc_result.js → 6_rpc_result.js} +1 -1
- package/esm/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/esm/tl/{6_message.js → 7_message.js} +3 -3
- package/esm/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/esm/tl/{7_message_container.js → 8_message_container.js} +3 -3
- package/esm/types/0_chat_photo.d.ts +1 -0
- package/esm/types/0_chat_photo.js +8 -5
- package/esm/types/0_message_entity.d.ts +1 -1
- package/esm/types/0_thumbnail.js +1 -1
- package/esm/types/1_bot_command_scope.d.ts +1 -1
- package/esm/types/1_photo.js +2 -2
- package/esm/types/1_story_privacy.d.ts +1 -1
- package/esm/types/2_business_connection.d.ts +11 -0
- package/esm/types/2_business_connection.js +12 -0
- package/esm/types/2_chat_member.d.ts +1 -1
- package/esm/types/2_chosen_inline_result.d.ts +1 -1
- package/esm/types/2_game.js +1 -1
- package/esm/types/2_inline_keyboard_button.d.ts +1 -1
- package/esm/types/2_inline_query.d.ts +1 -1
- package/esm/types/2_invite_link.d.ts +1 -1
- package/esm/types/2_message_reaction_count.d.ts +1 -1
- package/esm/types/2_message_reactions.d.ts +1 -1
- package/esm/types/2_story_content.js +1 -1
- package/{script/types/1_story_interactive_area.d.ts → esm/types/2_story_interactive_area.d.ts} +2 -2
- package/esm/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +1 -1
- package/esm/types/3_chat_member_updated.d.ts +1 -1
- package/esm/types/3_reply_markup.d.ts +1 -1
- package/esm/types/3_story.d.ts +2 -2
- package/esm/types/3_story.js +1 -1
- package/esm/types/4_inline_query_result.d.ts +1 -1
- package/esm/types/4_inline_query_result.js +1 -1
- package/esm/types/4_message.d.ts +9 -3
- package/esm/types/4_message.js +22 -5
- package/esm/types/5_callback_query.d.ts +1 -1
- package/esm/types/5_callback_query.js +2 -1
- package/esm/types/5_chat.d.ts +1 -1
- package/esm/types/6_update.d.ts +12 -2
- package/esm/types/{0__file_id.js → _file_id.js} +2 -1
- package/package.json +1 -1
- package/script/0_errors.d.ts +12 -0
- package/script/0_errors.js +27 -0
- package/script/1_utilities.d.ts +1 -1
- package/script/1_utilities.js +1 -1
- package/script/2_tl.d.ts +6 -6
- package/script/2_tl.js +6 -6
- package/script/3_storage.d.ts +5 -5
- package/script/3_storage.js +5 -5
- package/script/3_types.d.ts +6 -5
- package/script/3_types.js +6 -5
- package/script/4_constants.d.ts +2 -2
- package/script/4_constants.js +2 -2
- package/script/5_client.d.ts +1 -1
- package/script/5_client.js +1 -1
- package/script/client/0_client_abstract.js +3 -2
- package/script/client/0_html.js +4 -3
- package/script/client/0_markdown.js +6 -5
- package/script/client/0_params.d.ts +7 -1
- package/script/client/0_types.d.ts +1 -2
- package/script/client/0_types.js +0 -4
- package/script/client/0_utilities.d.ts +0 -3
- package/script/client/0_utilities.js +3 -24
- package/script/client/1_business_connection_manager.d.ts +11 -0
- package/script/client/1_business_connection_manager.js +51 -0
- package/script/client/1_client_encrypted.js +2 -2
- package/script/client/1_client_plain.js +3 -4
- package/script/client/1_composer.js +3 -2
- package/script/client/1_file_manager.js +5 -5
- package/script/client/1_update_manager.d.ts +8 -1
- package/script/client/1_update_manager.js +88 -8
- package/script/client/2_message_manager.d.ts +7 -6
- package/script/client/2_message_manager.js +88 -73
- package/script/client/3_chat_list_manager.js +3 -2
- package/script/client/3_story_manager.js +2 -1
- package/script/client/4_client.d.ts +422 -421
- package/script/client/4_client.js +578 -520
- package/script/mod.d.ts +1 -0
- package/script/mod.js +1 -0
- package/script/storage/0_storage.d.ts +5 -0
- package/script/storage/0_storage.js +20 -0
- package/script/storage/{1_storage_indexed_db.js → 2_storage_indexed_db.js} +7 -7
- package/script/storage/{1_storage_local_storage.js → 2_storage_local_storage.js} +10 -10
- package/{esm/storage/1_storage_memory.d.ts → script/storage/2_storage_memory.d.ts} +1 -4
- package/script/storage/{1_storage_memory.js → 2_storage_memory.js} +12 -32
- package/script/storage/{1_storage_session_storage.js → 2_storage_session_storage.js} +10 -10
- package/script/tl/2_types.d.ts +1071 -183
- package/script/tl/2_types.js +3028 -504
- package/script/tl/3_functions.d.ts +381 -17
- package/script/tl/3_functions.js +1047 -143
- package/{esm/tl/4_tl_writer.d.ts → script/tl/5_tl_writer.d.ts} +1 -1
- package/{esm/tl/4_rpc_result.d.ts → script/tl/6_rpc_result.d.ts} +1 -1
- package/script/tl/{4_rpc_result.js → 6_rpc_result.js} +2 -2
- package/script/tl/{6_message.d.ts → 7_message.d.ts} +2 -2
- package/script/tl/{6_message.js → 7_message.js} +8 -8
- package/script/tl/{7_message_container.d.ts → 8_message_container.d.ts} +1 -1
- package/script/tl/{7_message_container.js → 8_message_container.js} +7 -7
- package/script/types/0_chat_photo.d.ts +1 -0
- package/script/types/0_chat_photo.js +16 -13
- package/script/types/0_message_entity.d.ts +1 -1
- package/script/types/0_thumbnail.js +6 -6
- package/script/types/1_bot_command_scope.d.ts +1 -1
- package/script/types/1_photo.js +7 -7
- package/script/types/1_story_privacy.d.ts +1 -1
- package/script/types/2_business_connection.d.ts +11 -0
- package/script/types/2_business_connection.js +16 -0
- package/script/types/2_chat_member.d.ts +1 -1
- package/script/types/2_chosen_inline_result.d.ts +1 -1
- package/script/types/2_game.js +3 -3
- package/script/types/2_inline_keyboard_button.d.ts +1 -1
- package/script/types/2_inline_query.d.ts +1 -1
- package/script/types/2_invite_link.d.ts +1 -1
- package/script/types/2_message_reaction_count.d.ts +1 -1
- package/script/types/2_message_reactions.d.ts +1 -1
- package/script/types/2_story_content.js +4 -4
- package/{esm/types/1_story_interactive_area.d.ts → script/types/2_story_interactive_area.d.ts} +2 -2
- package/script/types/{1_story_interactive_area.js → 2_story_interactive_area.js} +2 -2
- package/script/types/3_chat_member_updated.d.ts +1 -1
- package/script/types/3_reply_markup.d.ts +1 -1
- package/script/types/3_story.d.ts +2 -2
- package/script/types/3_story.js +2 -2
- package/script/types/4_inline_query_result.d.ts +1 -1
- package/script/types/4_inline_query_result.js +2 -2
- package/script/types/4_message.d.ts +9 -3
- package/script/types/4_message.js +37 -20
- package/script/types/5_callback_query.d.ts +1 -1
- package/script/types/5_callback_query.js +2 -1
- package/script/types/5_chat.d.ts +1 -1
- package/script/types/6_update.d.ts +12 -2
- package/script/types/{0__file_id.js → _file_id.js} +2 -1
- /package/esm/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/esm/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/esm/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/esm/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/esm/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/esm/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/esm/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/esm/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/esm/types/{0_venue.js → 1_venue.js} +0 -0
- /package/esm/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/esm/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/esm/types/{1__getters.js → _getters.js} +0 -0
- /package/script/storage/{0_utilities.d.ts → 1_utilities.d.ts} +0 -0
- /package/script/storage/{0_utilities.js → 1_utilities.js} +0 -0
- /package/script/storage/{1_storage_indexed_db.d.ts → 2_storage_indexed_db.d.ts} +0 -0
- /package/script/storage/{1_storage_local_storage.d.ts → 2_storage_local_storage.d.ts} +0 -0
- /package/script/storage/{1_storage_session_storage.d.ts → 2_storage_session_storage.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.d.ts → 4_tl_reader.d.ts} +0 -0
- /package/script/tl/{3_tl_reader.js → 4_tl_reader.js} +0 -0
- /package/script/tl/{4_tl_writer.js → 5_tl_writer.js} +0 -0
- /package/script/types/{0_venue.d.ts → 1_venue.d.ts} +0 -0
- /package/script/types/{0_venue.js → 1_venue.js} +0 -0
- /package/script/types/{0__file_id.d.ts → _file_id.d.ts} +0 -0
- /package/script/types/{1__getters.d.ts → _getters.d.ts} +0 -0
- /package/script/types/{1__getters.js → _getters.js} +0 -0
|
@@ -2,9 +2,9 @@ import { MaybePromise } from "../1_utilities.js";
|
|
|
2
2
|
import { enums, functions, types } from "../2_tl.js";
|
|
3
3
|
import { Storage } from "../3_storage.js";
|
|
4
4
|
import { DC } from "../3_transport.js";
|
|
5
|
-
import { BotCommand, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
|
|
5
|
+
import { BotCommand, BusinessConnection, Chat, ChatAction, ChatMember, ChatP, FileSource, ID, InactiveChat, InlineQueryResult, InputStoryContent, InviteLink, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageLocation, MessagePhoto, MessagePoll, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, NetworkStatistics, ParseMode, Poll, Reaction, Sticker, Story, Update, User } from "../3_types.js";
|
|
6
6
|
import { Migrate } from "../4_errors.js";
|
|
7
|
-
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams
|
|
7
|
+
import { AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AuthorizeUserParams, BanChatMemberParams, CreateInviteLinkParams, CreateStoryParams, DeleteMessageParams, DeleteMessagesParams, DownloadParams, EditMessageLiveLocationParams, EditMessageParams, EditMessageReplyMarkupParams, ForwardMessagesParams, GetChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetMyCommandsParams, PinMessageParams, ReplyParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendLocationParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetChatMemberRightsParams, SetChatPhotoParams, SetMyCommandsParams, SetReactionsParams, StopPollParams } from "./0_params.js";
|
|
8
8
|
import { Api } from "./0_types.js";
|
|
9
9
|
import { ClientPlainParams } from "./1_client_plain.js";
|
|
10
10
|
import { Composer as Composer_, NextFunction } from "./1_composer.js";
|
|
@@ -21,34 +21,35 @@ export interface Context {
|
|
|
21
21
|
from?: User;
|
|
22
22
|
/** Resolves to `msg?.senderChat`. */
|
|
23
23
|
senderChat?: ChatP;
|
|
24
|
+
toJSON: () => Update;
|
|
24
25
|
/** Context-aware alias for `client.sendMessage()`. */
|
|
25
|
-
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId"> & ReplyParams) => Promise<MessageText>;
|
|
26
|
+
reply: (text: string, params?: Omit<SendMessageParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageText>;
|
|
26
27
|
/** Context-aware alias for `client.sendPoll()`. */
|
|
27
|
-
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePoll>;
|
|
28
|
+
replyPoll: (question: string, options: [string, string, ...string[]], params?: Omit<SendPollParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePoll>;
|
|
28
29
|
/** Context-aware alias for `client.sendPhoto()`. */
|
|
29
|
-
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId"> & ReplyParams) => Promise<MessagePhoto>;
|
|
30
|
+
replyPhoto: (photo: FileSource, params?: Omit<SendPhotoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessagePhoto>;
|
|
30
31
|
/** Context-aware alias for `client.sendDocument()`. */
|
|
31
|
-
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDocument>;
|
|
32
|
+
replyDocument: (document: FileSource, params?: Omit<SendDocumentParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDocument>;
|
|
32
33
|
/** Context-aware alias for `client.sendSticker()`. */
|
|
33
|
-
replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId"> & ReplyParams) => Promise<MessageSticker>;
|
|
34
|
+
replySticker: (sticker: FileSource, params?: Omit<SendStickerParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageSticker>;
|
|
34
35
|
/** Context-aware alias for `client.sendLocation()`. */
|
|
35
|
-
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageLocation>;
|
|
36
|
+
replyLocation: (latitude: number, longitude: number, params?: Omit<SendLocationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageLocation>;
|
|
36
37
|
/** Context-aware alias for `client.sendDice()`. */
|
|
37
|
-
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageDice>;
|
|
38
|
+
replyDice: (params?: Omit<SendDiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageDice>;
|
|
38
39
|
/** Context-aware alias for `client.sendVenue()`. */
|
|
39
|
-
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVenue>;
|
|
40
|
+
replyVenue: (latitude: number, longitude: number, title: string, address: string, params?: Omit<SendVenueParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVenue>;
|
|
40
41
|
/** Context-aware alias for `client.sendContact()`. */
|
|
41
|
-
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId"> & ReplyParams) => Promise<MessageContact>;
|
|
42
|
+
replyContact: (firstName: string, number: string, params?: Omit<SendContactParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageContact>;
|
|
42
43
|
/** Context-aware alias for `client.sendVideo()`. */
|
|
43
|
-
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideo>;
|
|
44
|
+
replyVideo: (video: FileSource, params?: Omit<SendVideoParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideo>;
|
|
44
45
|
/** Context-aware alias for `client.sendAnimation()`. */
|
|
45
|
-
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAnimation>;
|
|
46
|
+
replyAnimation: (animation: FileSource, params?: Omit<SendAnimationParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAnimation>;
|
|
46
47
|
/** Context-aware alias for `client.sendVoice()`. */
|
|
47
|
-
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVoice>;
|
|
48
|
+
replyVoice: (voice: FileSource, params?: Omit<SendVoiceParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVoice>;
|
|
48
49
|
/** Context-aware alias for `client.sendAudio()`. */
|
|
49
|
-
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId"> & ReplyParams) => Promise<MessageAudio>;
|
|
50
|
+
replyAudio: (audio: FileSource, params?: Omit<SendAudioParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageAudio>;
|
|
50
51
|
/** Context-aware alias for `client.sendPoll()`. */
|
|
51
|
-
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId"> & ReplyParams) => Promise<MessageVideoNote>;
|
|
52
|
+
replyVideoNote: (videoNote: FileSource, params?: Omit<SendVideoNoteParams, "replyToMessageId" | "businessConnectionId"> & ReplyParams) => Promise<MessageVideoNote>;
|
|
52
53
|
/** Context-aware alias for `client.deleteMessage()`. */
|
|
53
54
|
delete: () => Promise<void>;
|
|
54
55
|
/** Context-aware alias for `client.forwardMessage()`. */
|
|
@@ -147,7 +148,8 @@ export interface Context {
|
|
|
147
148
|
setChatStickerSet: (setName: string) => Promise<void>;
|
|
148
149
|
/** Context-aware alias for `client.deleteChatStickerSet()`. */
|
|
149
150
|
deleteChatStickerSet: () => Promise<void>;
|
|
150
|
-
|
|
151
|
+
/** Context-aware alias for `client.getBusinessConnection()`. */
|
|
152
|
+
getBusinessConnection: () => Promise<BusinessConnection>;
|
|
151
153
|
}
|
|
152
154
|
export declare class Composer<C extends Context = Context> extends Composer_<C> {
|
|
153
155
|
}
|
|
@@ -229,7 +231,7 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
229
231
|
* Before establishing the connection, the session is saved.
|
|
230
232
|
*/
|
|
231
233
|
connect(): Promise<void>;
|
|
232
|
-
reconnect(dc
|
|
234
|
+
reconnect(dc?: DC): Promise<void>;
|
|
233
235
|
[handleMigrationError](err: Migrate): Promise<void>;
|
|
234
236
|
disconnect(): Promise<void>;
|
|
235
237
|
/**
|
|
@@ -294,6 +296,51 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
294
296
|
private [getEntity];
|
|
295
297
|
private [getEntity];
|
|
296
298
|
private [getEntity];
|
|
299
|
+
/**
|
|
300
|
+
* Get information on the currently authorized user.
|
|
301
|
+
*
|
|
302
|
+
* @method ac
|
|
303
|
+
*/
|
|
304
|
+
getMe(): Promise<User>;
|
|
305
|
+
/**
|
|
306
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
307
|
+
*
|
|
308
|
+
* @method ac
|
|
309
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
310
|
+
* @param username The username to show.
|
|
311
|
+
*/
|
|
312
|
+
showUsername(id: ID, username: string): Promise<void>;
|
|
313
|
+
/**
|
|
314
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
315
|
+
*
|
|
316
|
+
* @method ac
|
|
317
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
318
|
+
* @param username The username to hide.
|
|
319
|
+
*/
|
|
320
|
+
hideUsername(id: ID, username: string): Promise<void>;
|
|
321
|
+
/**
|
|
322
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
323
|
+
*
|
|
324
|
+
* @method ac
|
|
325
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
326
|
+
* @param order The new order to use.
|
|
327
|
+
* @returns Whether the order was changed.
|
|
328
|
+
*/
|
|
329
|
+
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
330
|
+
/**
|
|
331
|
+
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
332
|
+
*
|
|
333
|
+
* @method ac
|
|
334
|
+
* @param id A supergroup ID or a channel ID.
|
|
335
|
+
*/
|
|
336
|
+
hideUsernames(id: ID): Promise<boolean>;
|
|
337
|
+
/**
|
|
338
|
+
* Get a business connection. Bot-only.
|
|
339
|
+
*
|
|
340
|
+
* @method ac
|
|
341
|
+
* @param id The identifier of the business connection.
|
|
342
|
+
*/
|
|
343
|
+
getBusinessConnection(id: string): Promise<BusinessConnection>;
|
|
297
344
|
/**
|
|
298
345
|
* Send a text message.
|
|
299
346
|
*
|
|
@@ -303,6 +350,128 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
303
350
|
* @returns The sent text message.
|
|
304
351
|
*/
|
|
305
352
|
sendMessage(chatId: ID, text: string, params?: SendMessageParams): Promise<MessageText>;
|
|
353
|
+
/**
|
|
354
|
+
* Send a photo.
|
|
355
|
+
*
|
|
356
|
+
* @method ms
|
|
357
|
+
* @param chatId The chat to send the photo to.
|
|
358
|
+
* @param photo The photo to send.
|
|
359
|
+
* @returns The sent photo.
|
|
360
|
+
*/
|
|
361
|
+
sendPhoto(chatId: ID, photo: FileSource, params?: SendPhotoParams): Promise<MessagePhoto>;
|
|
362
|
+
/**
|
|
363
|
+
* Send a document.
|
|
364
|
+
*
|
|
365
|
+
* @method ms
|
|
366
|
+
* @param chatId The chat to send the document to.
|
|
367
|
+
* @param document The document to send.
|
|
368
|
+
* @returns The sent document.
|
|
369
|
+
*/
|
|
370
|
+
sendDocument(chatId: ID, document: FileSource, params?: SendDocumentParams): Promise<MessageDocument>;
|
|
371
|
+
/**
|
|
372
|
+
* Send a sticker.
|
|
373
|
+
*
|
|
374
|
+
* @method ms
|
|
375
|
+
* @param chatId The chat to send the sticker to.
|
|
376
|
+
* @param document The sticker to send.
|
|
377
|
+
* @returns The sent sticker.
|
|
378
|
+
*/
|
|
379
|
+
sendSticker(chatId: ID, sticker: FileSource, params?: SendStickerParams): Promise<MessageSticker>;
|
|
380
|
+
/**
|
|
381
|
+
* Send a video.
|
|
382
|
+
*
|
|
383
|
+
* @method ms
|
|
384
|
+
* @param chatId The chat to send the video to.
|
|
385
|
+
* @param video The video to send.
|
|
386
|
+
* @returns The sent video.
|
|
387
|
+
*/
|
|
388
|
+
sendVideo(chatId: ID, video: FileSource, params?: SendVideoParams): Promise<MessageVideo>;
|
|
389
|
+
/**
|
|
390
|
+
* Send an animation.
|
|
391
|
+
*
|
|
392
|
+
* @method ms
|
|
393
|
+
* @param chatId The chat to send the animation to.
|
|
394
|
+
* @param animation The animation to send.
|
|
395
|
+
* @returns The sent animation.
|
|
396
|
+
*/
|
|
397
|
+
sendAnimation(chatId: ID, animation: FileSource, params?: SendAnimationParams): Promise<MessageAnimation>;
|
|
398
|
+
/**
|
|
399
|
+
* Send a voice message.
|
|
400
|
+
*
|
|
401
|
+
* @method ms
|
|
402
|
+
* @param chatId The chat to send the voice message to.
|
|
403
|
+
* @param voice The voice to send.
|
|
404
|
+
* @returns The sent voice message.
|
|
405
|
+
*/
|
|
406
|
+
sendVoice(chatId: ID, voice: FileSource, params?: SendVoiceParams): Promise<MessageVoice>;
|
|
407
|
+
/**
|
|
408
|
+
* Send an audio file.
|
|
409
|
+
*
|
|
410
|
+
* @method ms
|
|
411
|
+
* @param chatId The chat to send the audio file to.
|
|
412
|
+
* @param audio The audio to send.
|
|
413
|
+
* @returns The sent audio filr.
|
|
414
|
+
*/
|
|
415
|
+
sendAudio(chatId: ID, audio: FileSource, params?: SendAudioParams): Promise<MessageAudio>;
|
|
416
|
+
/**
|
|
417
|
+
* Send a video note.
|
|
418
|
+
*
|
|
419
|
+
* @method ms
|
|
420
|
+
* @param chatId The chat to send the video note to.
|
|
421
|
+
* @param videoNote The video note to send.
|
|
422
|
+
* @returns The sent video note.
|
|
423
|
+
*/
|
|
424
|
+
sendVideoNote(chatId: ID, videoNote: FileSource, params?: SendVideoNoteParams): Promise<MessageVideoNote>;
|
|
425
|
+
/**
|
|
426
|
+
* Send a location.
|
|
427
|
+
*
|
|
428
|
+
* @method ms
|
|
429
|
+
* @param chatId The chat to send the location to.
|
|
430
|
+
* @param latitude The location's latitude.
|
|
431
|
+
* @param longitude The location's longitude.
|
|
432
|
+
* @returns The sent location.
|
|
433
|
+
*/
|
|
434
|
+
sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
|
|
435
|
+
/**
|
|
436
|
+
* Send a contact.
|
|
437
|
+
*
|
|
438
|
+
* @method ms
|
|
439
|
+
* @param chatId The chat to send the contact to.
|
|
440
|
+
* @param firstName The contact's first name.
|
|
441
|
+
* @param number The contact's phone number.
|
|
442
|
+
* @returns The sent contact.
|
|
443
|
+
*/
|
|
444
|
+
sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
|
|
445
|
+
/**
|
|
446
|
+
* Send a dice.
|
|
447
|
+
*
|
|
448
|
+
* @method ms
|
|
449
|
+
* @param chatId The chat to send the dice to.
|
|
450
|
+
* @returns The sent dice.
|
|
451
|
+
*/
|
|
452
|
+
sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
|
|
453
|
+
/**
|
|
454
|
+
* Send a venue.
|
|
455
|
+
*
|
|
456
|
+
* @method ms
|
|
457
|
+
* @param chatId The chat to send the venue to.
|
|
458
|
+
* @param latitude The latitude of the venue.
|
|
459
|
+
* @param longitude The longitude of the venue.
|
|
460
|
+
* @param title The title of the venue.
|
|
461
|
+
* @param address The written address of the venue.
|
|
462
|
+
* @returns The sent venue.
|
|
463
|
+
*/
|
|
464
|
+
sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
|
|
465
|
+
/**
|
|
466
|
+
* Send a poll.
|
|
467
|
+
*
|
|
468
|
+
* @method ms
|
|
469
|
+
* @param chatId The chat to send the poll to.
|
|
470
|
+
* @param question The poll's question.
|
|
471
|
+
* @param options The poll's options.
|
|
472
|
+
* @returns The sent poll.
|
|
473
|
+
*/
|
|
474
|
+
sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
|
|
306
475
|
/**
|
|
307
476
|
* Edit a message's text.
|
|
308
477
|
*
|
|
@@ -383,18 +552,52 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
383
552
|
*/
|
|
384
553
|
getMessage(chatId: ID, messageId: number): Promise<Message | null>;
|
|
385
554
|
/**
|
|
386
|
-
*
|
|
555
|
+
* Delete multiple messages.
|
|
387
556
|
*
|
|
388
|
-
* @method
|
|
389
|
-
* @param
|
|
390
|
-
* @
|
|
391
|
-
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
392
|
-
* await outFile.write(chunk);
|
|
393
|
-
* }
|
|
394
|
-
* ```
|
|
395
|
-
* @returns A generator yielding the contents of the file.
|
|
557
|
+
* @method ms
|
|
558
|
+
* @param chatId The identifier of the chat that contains the messages.
|
|
559
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
396
560
|
*/
|
|
397
|
-
|
|
561
|
+
deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
|
|
562
|
+
/**
|
|
563
|
+
* Delete a single message.
|
|
564
|
+
*
|
|
565
|
+
* @method ms
|
|
566
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
567
|
+
* @param messageId The identifier of the message to delete.
|
|
568
|
+
*/
|
|
569
|
+
deleteMessage(chatId: ID, messageId: number, params?: DeleteMessageParams): Promise<void>;
|
|
570
|
+
/**
|
|
571
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
572
|
+
*
|
|
573
|
+
* @method ms
|
|
574
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
575
|
+
* @param memberId The identifier of the member.
|
|
576
|
+
*/
|
|
577
|
+
deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
|
|
578
|
+
/**
|
|
579
|
+
* Pin a message in a chat.
|
|
580
|
+
*
|
|
581
|
+
* @method ms
|
|
582
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
583
|
+
* @param messageId The message's identifier.
|
|
584
|
+
*/
|
|
585
|
+
pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
|
|
586
|
+
/**
|
|
587
|
+
* Unpin a pinned message.
|
|
588
|
+
*
|
|
589
|
+
* @method ms
|
|
590
|
+
* @param chatId The identifier of the chat that contains the message.
|
|
591
|
+
* @param messageId The message's identifier.
|
|
592
|
+
*/
|
|
593
|
+
unpinMessage(chatId: ID, messageId: number): Promise<void>;
|
|
594
|
+
/**
|
|
595
|
+
* Unpin all pinned messages.
|
|
596
|
+
*
|
|
597
|
+
* @method ms
|
|
598
|
+
* @param chatId The identifier of the chat.
|
|
599
|
+
*/
|
|
600
|
+
unpinMessages(chatId: ID): Promise<void>;
|
|
398
601
|
/**
|
|
399
602
|
* Forward multiple messages.
|
|
400
603
|
*
|
|
@@ -415,29 +618,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
415
618
|
* @returns The forwarded message.
|
|
416
619
|
*/
|
|
417
620
|
forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
|
|
418
|
-
/**
|
|
419
|
-
* Get information on the currently authorized user.
|
|
420
|
-
*
|
|
421
|
-
* @method ac
|
|
422
|
-
*/
|
|
423
|
-
getMe(): Promise<User>;
|
|
424
|
-
/**
|
|
425
|
-
* Answer a callback query. Bot-only.
|
|
426
|
-
*
|
|
427
|
-
* @method cq
|
|
428
|
-
* @param id ID of the callback query to answer.
|
|
429
|
-
*/
|
|
430
|
-
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
431
|
-
/**
|
|
432
|
-
* Send a poll.
|
|
433
|
-
*
|
|
434
|
-
* @method ms
|
|
435
|
-
* @param chatId The chat to send the poll to.
|
|
436
|
-
* @param question The poll's question.
|
|
437
|
-
* @param options The poll's options.
|
|
438
|
-
* @returns The sent poll.
|
|
439
|
-
*/
|
|
440
|
-
sendPoll(chatId: ID, question: string, options: [string, string, ...string[]], params?: SendPollParams): Promise<MessagePoll>;
|
|
441
621
|
/**
|
|
442
622
|
* Stop a poll.
|
|
443
623
|
*
|
|
@@ -459,258 +639,281 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
459
639
|
messageThreadId?: number;
|
|
460
640
|
}): Promise<void>;
|
|
461
641
|
/**
|
|
462
|
-
*
|
|
642
|
+
* Search the messages of a chat. User-only.
|
|
463
643
|
*
|
|
464
|
-
* @method
|
|
465
|
-
* @param
|
|
466
|
-
* @
|
|
644
|
+
* @method ms
|
|
645
|
+
* @param chatId The identifier of the chat to search the messages in.
|
|
646
|
+
* @param query The message search query.
|
|
467
647
|
*/
|
|
468
|
-
|
|
648
|
+
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
469
649
|
/**
|
|
470
|
-
*
|
|
650
|
+
* Download a file.
|
|
471
651
|
*
|
|
472
|
-
* @method
|
|
473
|
-
* @param
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
*
|
|
652
|
+
* @method fs
|
|
653
|
+
* @param fileId The identifier of the file to download.
|
|
654
|
+
* @example ```ts
|
|
655
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
656
|
+
* await outFile.write(chunk);
|
|
657
|
+
* }
|
|
658
|
+
* ```
|
|
659
|
+
* @returns A generator yielding the contents of the file.
|
|
660
|
+
*/
|
|
661
|
+
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
662
|
+
/**
|
|
663
|
+
* Get custom emoji documents for download.
|
|
478
664
|
*
|
|
479
|
-
* @method
|
|
480
|
-
* @
|
|
665
|
+
* @method fs
|
|
666
|
+
* @param id Identifier of one or more of custom emojis.
|
|
667
|
+
* @returns The custom emoji documents.
|
|
481
668
|
*/
|
|
482
|
-
|
|
669
|
+
getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
|
|
483
670
|
/**
|
|
484
|
-
*
|
|
671
|
+
* Get chats from a chat list. User-only.
|
|
485
672
|
*
|
|
486
|
-
* @method
|
|
487
|
-
* @param id The ID of the inline query to answer.
|
|
488
|
-
* @param results The results to answer with.
|
|
673
|
+
* @method ch
|
|
489
674
|
*/
|
|
490
|
-
|
|
675
|
+
getChats(params?: GetChatsParams): Promise<Chat[]>;
|
|
491
676
|
/**
|
|
492
|
-
*
|
|
677
|
+
* Get a chat.
|
|
493
678
|
*
|
|
494
|
-
* @method
|
|
679
|
+
* @method ch
|
|
495
680
|
*/
|
|
496
|
-
|
|
497
|
-
description?: string;
|
|
498
|
-
languageCode?: string;
|
|
499
|
-
}): Promise<void>;
|
|
681
|
+
getChat(chatId: ID): Promise<Chat>;
|
|
500
682
|
/**
|
|
501
|
-
*
|
|
683
|
+
* Get chat history. User-only.
|
|
502
684
|
*
|
|
503
|
-
* @method
|
|
685
|
+
* @method ch
|
|
686
|
+
* @param chatId The identifier of the chat to get its history.
|
|
504
687
|
*/
|
|
505
|
-
|
|
506
|
-
name?: string;
|
|
507
|
-
languageCode?: string;
|
|
508
|
-
}): Promise<void>;
|
|
688
|
+
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
509
689
|
/**
|
|
510
|
-
* Set
|
|
690
|
+
* Set a chat's available reactions. User-only.
|
|
511
691
|
*
|
|
512
|
-
* @method
|
|
692
|
+
* @method ch
|
|
693
|
+
* @param chatId The identifier of the chat.
|
|
694
|
+
* @param availableReactions The new available reactions.
|
|
513
695
|
*/
|
|
514
|
-
|
|
515
|
-
shortDescription?: string;
|
|
516
|
-
languageCode?: string;
|
|
517
|
-
}): Promise<void>;
|
|
696
|
+
setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
|
|
518
697
|
/**
|
|
519
|
-
*
|
|
698
|
+
* Set a chat's photo.
|
|
520
699
|
*
|
|
521
|
-
* @method
|
|
522
|
-
* @
|
|
700
|
+
* @method ch
|
|
701
|
+
* @param chatId The identifier of the chat.
|
|
702
|
+
* @param photo A photo to set as the chat's photo.
|
|
523
703
|
*/
|
|
524
|
-
|
|
525
|
-
languageCode?: string;
|
|
526
|
-
}): Promise<string>;
|
|
704
|
+
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
527
705
|
/**
|
|
528
|
-
*
|
|
706
|
+
* Delete a chat's photo.
|
|
529
707
|
*
|
|
530
|
-
* @method
|
|
531
|
-
* @
|
|
708
|
+
* @method ch
|
|
709
|
+
* @param chatId The identifier of the chat.
|
|
532
710
|
*/
|
|
533
|
-
|
|
534
|
-
languageCode?: string;
|
|
535
|
-
}): Promise<string>;
|
|
711
|
+
deleteChatPhoto(chatId: number): Promise<void>;
|
|
536
712
|
/**
|
|
537
|
-
*
|
|
713
|
+
* Ban a member from a chat.
|
|
538
714
|
*
|
|
539
|
-
* @method
|
|
540
|
-
* @
|
|
715
|
+
* @method ch
|
|
716
|
+
* @param chatId The identifier of the chat.
|
|
717
|
+
* @param memberId The identifier of the member.
|
|
541
718
|
*/
|
|
542
|
-
|
|
543
|
-
languageCode?: string;
|
|
544
|
-
}): Promise<string>;
|
|
719
|
+
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
545
720
|
/**
|
|
546
|
-
*
|
|
721
|
+
* Unban a member from a chat.
|
|
547
722
|
*
|
|
548
|
-
* @method
|
|
549
|
-
* @param chatId The identifier of the chat
|
|
550
|
-
* @param
|
|
723
|
+
* @method ch
|
|
724
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
725
|
+
* @param memberId The identifier of the member.
|
|
551
726
|
*/
|
|
552
|
-
|
|
727
|
+
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
553
728
|
/**
|
|
554
|
-
*
|
|
729
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
555
730
|
*
|
|
556
|
-
* @method
|
|
557
|
-
* @param chatId The identifier of the chat
|
|
558
|
-
* @param
|
|
731
|
+
* @method ch
|
|
732
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
733
|
+
* @param memberId The identifier of the member.
|
|
559
734
|
*/
|
|
560
|
-
|
|
735
|
+
kickChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
561
736
|
/**
|
|
562
|
-
*
|
|
737
|
+
* Set the rights of a chat member.
|
|
563
738
|
*
|
|
564
|
-
* @method
|
|
565
|
-
* @param chatId The chat
|
|
566
|
-
* @param
|
|
567
|
-
* @returns The sent photo.
|
|
739
|
+
* @method ch
|
|
740
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
741
|
+
* @param memberId The identifier of a member.
|
|
568
742
|
*/
|
|
569
|
-
|
|
743
|
+
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
570
744
|
/**
|
|
571
|
-
*
|
|
745
|
+
* Get the administrators of a chat.
|
|
572
746
|
*
|
|
573
|
-
* @method
|
|
574
|
-
* @param chatId The
|
|
575
|
-
* @
|
|
576
|
-
* @returns The sent document.
|
|
747
|
+
* @method ch
|
|
748
|
+
* @param chatId The identifier of the chat.
|
|
749
|
+
* @returns The chat's administrators.
|
|
577
750
|
*/
|
|
578
|
-
|
|
751
|
+
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
579
752
|
/**
|
|
580
|
-
*
|
|
753
|
+
* Enable join requests in a chat. User-only.
|
|
581
754
|
*
|
|
582
|
-
* @method
|
|
583
|
-
* @param chatId The chat
|
|
584
|
-
* @param document The sticker to send.
|
|
585
|
-
* @returns The sent sticker.
|
|
755
|
+
* @method ch
|
|
756
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
586
757
|
*/
|
|
587
|
-
|
|
758
|
+
enableJoinRequests(chatId: ID): Promise<void>;
|
|
588
759
|
/**
|
|
589
|
-
*
|
|
760
|
+
* Disable join requests in a chat. User-only.
|
|
590
761
|
*
|
|
591
|
-
* @method
|
|
592
|
-
* @param chatId The chat
|
|
593
|
-
* @param video The video to send.
|
|
594
|
-
* @returns The sent video.
|
|
762
|
+
* @method ch
|
|
763
|
+
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
595
764
|
*/
|
|
596
|
-
|
|
765
|
+
disableJoinRequests(chatId: ID): Promise<void>;
|
|
597
766
|
/**
|
|
598
|
-
*
|
|
767
|
+
* Get inactive chats. User-only.
|
|
599
768
|
*
|
|
600
|
-
* @method
|
|
601
|
-
* @
|
|
602
|
-
* @param animation The animation to send.
|
|
603
|
-
* @returns The sent animation.
|
|
769
|
+
* @method ch
|
|
770
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
604
771
|
*/
|
|
605
|
-
|
|
772
|
+
getInactiveChats(): Promise<InactiveChat[]>;
|
|
606
773
|
/**
|
|
607
|
-
*
|
|
774
|
+
* Get the invite links created for a chat. User-only.
|
|
608
775
|
*
|
|
609
|
-
* @method
|
|
610
|
-
* @param chatId The
|
|
611
|
-
* @
|
|
612
|
-
* @returns The sent voice message.
|
|
776
|
+
* @method ch
|
|
777
|
+
* @param chatId The identifier of the chat.
|
|
778
|
+
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
613
779
|
*/
|
|
614
|
-
|
|
780
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
615
781
|
/**
|
|
616
|
-
*
|
|
782
|
+
* Join a chat. User-only.
|
|
617
783
|
*
|
|
618
|
-
* @method
|
|
619
|
-
* @param chatId The
|
|
620
|
-
* @param audio The audio to send.
|
|
621
|
-
* @returns The sent audio filr.
|
|
784
|
+
* @method ch
|
|
785
|
+
* @param chatId The identifier of the chat to join.
|
|
622
786
|
*/
|
|
623
|
-
|
|
787
|
+
joinChat(chatId: ID): Promise<void>;
|
|
624
788
|
/**
|
|
625
|
-
*
|
|
789
|
+
* Leave a chat.
|
|
626
790
|
*
|
|
627
|
-
* @method
|
|
628
|
-
* @param chatId The
|
|
629
|
-
* @param videoNote The video note to send.
|
|
630
|
-
* @returns The sent video note.
|
|
791
|
+
* @method ch
|
|
792
|
+
* @param chatId The identifier of the chat to leave.
|
|
631
793
|
*/
|
|
632
|
-
|
|
794
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
633
795
|
/**
|
|
634
|
-
*
|
|
796
|
+
* Get information on a user's chat membership.
|
|
635
797
|
*
|
|
636
|
-
* @method
|
|
637
|
-
* @param chatId The chat
|
|
638
|
-
* @param
|
|
639
|
-
* @param longitude The location's longitude.
|
|
640
|
-
* @returns The sent location.
|
|
798
|
+
* @method ch
|
|
799
|
+
* @param chatId The identifier of a chat that includes the user.
|
|
800
|
+
* @param userId The identifier of the user.
|
|
641
801
|
*/
|
|
642
|
-
|
|
802
|
+
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
643
803
|
/**
|
|
644
|
-
*
|
|
804
|
+
* Set a chat's sticker set.
|
|
645
805
|
*
|
|
646
|
-
* @method
|
|
647
|
-
* @param chatId The chat
|
|
648
|
-
* @param
|
|
649
|
-
* @param number The contact's phone number.
|
|
650
|
-
* @returns The sent contact.
|
|
806
|
+
* @method ch
|
|
807
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
808
|
+
* @param setName The name of the set.
|
|
651
809
|
*/
|
|
652
|
-
|
|
810
|
+
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
653
811
|
/**
|
|
654
|
-
*
|
|
812
|
+
* Delete a chat's sticker set.
|
|
655
813
|
*
|
|
656
|
-
* @method
|
|
657
|
-
* @param chatId The chat
|
|
658
|
-
* @returns The sent dice.
|
|
814
|
+
* @method ch
|
|
815
|
+
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
659
816
|
*/
|
|
660
|
-
|
|
817
|
+
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
661
818
|
/**
|
|
662
|
-
*
|
|
819
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
663
820
|
*
|
|
664
|
-
* @method
|
|
665
|
-
* @param chatId The
|
|
666
|
-
* @param
|
|
667
|
-
* @param longitude The longitude of the venue.
|
|
668
|
-
* @param title The title of the venue.
|
|
669
|
-
* @param address The written address of the venue.
|
|
670
|
-
* @returns The sent venue.
|
|
821
|
+
* @method ch
|
|
822
|
+
* @param chatId The identifier of the chat.
|
|
823
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
671
824
|
*/
|
|
672
|
-
|
|
825
|
+
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
673
826
|
/**
|
|
674
|
-
*
|
|
827
|
+
* Create an invite link.
|
|
675
828
|
*
|
|
676
|
-
* @method
|
|
829
|
+
* @method ch
|
|
830
|
+
* @param chatId The identifier of the chat to create the invite link for.
|
|
831
|
+
* @returns The newly created invite link.
|
|
677
832
|
*/
|
|
678
|
-
|
|
833
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
834
|
+
/**
|
|
835
|
+
* Answer a callback query. Bot-only.
|
|
836
|
+
*
|
|
837
|
+
* @method cq
|
|
838
|
+
* @param id ID of the callback query to answer.
|
|
839
|
+
*/
|
|
840
|
+
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
841
|
+
/**
|
|
842
|
+
* Answer an inline query. Bot-only.
|
|
843
|
+
*
|
|
844
|
+
* @method iq
|
|
845
|
+
* @param id The ID of the inline query to answer.
|
|
846
|
+
* @param results The results to answer with.
|
|
847
|
+
*/
|
|
848
|
+
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
849
|
+
/**
|
|
850
|
+
* Set the bot's description in the given language. Bot-only.
|
|
851
|
+
*
|
|
852
|
+
* @method bs
|
|
853
|
+
*/
|
|
854
|
+
setMyDescription(params?: {
|
|
855
|
+
description?: string;
|
|
856
|
+
languageCode?: string;
|
|
857
|
+
}): Promise<void>;
|
|
858
|
+
/**
|
|
859
|
+
* Set the bot's name in the given language. Bot-only.
|
|
860
|
+
*
|
|
861
|
+
* @method bs
|
|
862
|
+
*/
|
|
863
|
+
setMyName(params?: {
|
|
864
|
+
name?: string;
|
|
865
|
+
languageCode?: string;
|
|
866
|
+
}): Promise<void>;
|
|
867
|
+
/**
|
|
868
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
869
|
+
*
|
|
870
|
+
* @method bs
|
|
871
|
+
*/
|
|
872
|
+
setMyShortDescription(params?: {
|
|
873
|
+
shortDescription?: string;
|
|
874
|
+
languageCode?: string;
|
|
875
|
+
}): Promise<void>;
|
|
679
876
|
/**
|
|
680
|
-
* Get
|
|
877
|
+
* Get the bot's description in the given language. Bot-only.
|
|
681
878
|
*
|
|
682
|
-
* @method
|
|
879
|
+
* @method bs
|
|
880
|
+
* @returns The current bot's description in the specified language.
|
|
683
881
|
*/
|
|
684
|
-
|
|
882
|
+
getMyDescription(params?: {
|
|
883
|
+
languageCode?: string;
|
|
884
|
+
}): Promise<string>;
|
|
685
885
|
/**
|
|
686
|
-
* Get
|
|
886
|
+
* Get the bot's name in the given language. Bot-only.
|
|
687
887
|
*
|
|
688
|
-
* @method
|
|
888
|
+
* @method bs
|
|
889
|
+
* @returns The current bot's name in the specified language.
|
|
689
890
|
*/
|
|
690
|
-
|
|
891
|
+
getMyName(params?: {
|
|
892
|
+
languageCode?: string;
|
|
893
|
+
}): Promise<string>;
|
|
691
894
|
/**
|
|
692
|
-
* Get
|
|
895
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
693
896
|
*
|
|
694
|
-
* @method
|
|
695
|
-
* @
|
|
897
|
+
* @method bs
|
|
898
|
+
* @returns The current bot's short description in the specified language.
|
|
696
899
|
*/
|
|
697
|
-
|
|
900
|
+
getMyShortDescription(params?: {
|
|
901
|
+
languageCode?: string;
|
|
902
|
+
}): Promise<string>;
|
|
698
903
|
/**
|
|
699
|
-
*
|
|
904
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
700
905
|
*
|
|
701
|
-
* @method
|
|
702
|
-
* @param
|
|
703
|
-
* @returns The custom emoji documents.
|
|
906
|
+
* @method bs
|
|
907
|
+
* @param commands The commands to set.
|
|
704
908
|
*/
|
|
705
|
-
|
|
909
|
+
setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
|
|
706
910
|
/**
|
|
707
|
-
*
|
|
911
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
708
912
|
*
|
|
709
|
-
* @method
|
|
710
|
-
* @
|
|
711
|
-
* @param availableReactions The new available reactions.
|
|
913
|
+
* @method bs
|
|
914
|
+
* @returns The current bot's commands in the specified language.
|
|
712
915
|
*/
|
|
713
|
-
|
|
916
|
+
getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
|
|
714
917
|
/**
|
|
715
918
|
* Change reactions made to a message.
|
|
716
919
|
*
|
|
@@ -738,92 +941,6 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
738
941
|
* @param reaction The reaction to remove.
|
|
739
942
|
*/
|
|
740
943
|
removeReaction(chatId: number, messageId: number, reaction: Reaction): Promise<void>;
|
|
741
|
-
/**
|
|
742
|
-
* Set a chat's photo.
|
|
743
|
-
*
|
|
744
|
-
* @method ch
|
|
745
|
-
* @param chatId The identifier of the chat.
|
|
746
|
-
* @param photo A photo to set as the chat's photo.
|
|
747
|
-
*/
|
|
748
|
-
setChatPhoto(chatId: number, photo: FileSource, params?: SetChatPhotoParams): Promise<void>;
|
|
749
|
-
/**
|
|
750
|
-
* Delete a chat's photo.
|
|
751
|
-
*
|
|
752
|
-
* @method ch
|
|
753
|
-
* @param chatId The identifier of the chat.
|
|
754
|
-
*/
|
|
755
|
-
deleteChatPhoto(chatId: number): Promise<void>;
|
|
756
|
-
/**
|
|
757
|
-
* Delete all messages sent by a specific member of a chat. User-only.
|
|
758
|
-
*
|
|
759
|
-
* @method ms
|
|
760
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
761
|
-
* @param memberId The identifier of the member.
|
|
762
|
-
*/
|
|
763
|
-
deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
|
|
764
|
-
/**
|
|
765
|
-
* Pin a message in a chat.
|
|
766
|
-
*
|
|
767
|
-
* @method ms
|
|
768
|
-
* @param chatId The identifier of the chat that contains the message.
|
|
769
|
-
* @param messageId The message's identifier.
|
|
770
|
-
*/
|
|
771
|
-
pinMessage(chatId: ID, messageId: number, params?: PinMessageParams): Promise<void>;
|
|
772
|
-
/**
|
|
773
|
-
* Unpin a pinned message.
|
|
774
|
-
*
|
|
775
|
-
* @method ms
|
|
776
|
-
* @param chatId The identifier of the chat that contains the message.
|
|
777
|
-
* @param messageId The message's identifier.
|
|
778
|
-
*/
|
|
779
|
-
unpinMessage(chatId: ID, messageId: number): Promise<void>;
|
|
780
|
-
/**
|
|
781
|
-
* Unpin all pinned messages.
|
|
782
|
-
*
|
|
783
|
-
* @method ms
|
|
784
|
-
* @param chatId The identifier of the chat.
|
|
785
|
-
*/
|
|
786
|
-
unpinMessages(chatId: ID): Promise<void>;
|
|
787
|
-
/**
|
|
788
|
-
* Ban a member from a chat.
|
|
789
|
-
*
|
|
790
|
-
* @method ch
|
|
791
|
-
* @param chatId The identifier of the chat.
|
|
792
|
-
* @param memberId The identifier of the member.
|
|
793
|
-
*/
|
|
794
|
-
banChatMember(chatId: ID, memberId: ID, params?: BanChatMemberParams): Promise<void>;
|
|
795
|
-
/**
|
|
796
|
-
* Unban a member from a chat.
|
|
797
|
-
*
|
|
798
|
-
* @method ch
|
|
799
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
800
|
-
* @param memberId The identifier of the member.
|
|
801
|
-
*/
|
|
802
|
-
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
803
|
-
/**
|
|
804
|
-
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
805
|
-
*
|
|
806
|
-
* @method ch
|
|
807
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
808
|
-
* @param memberId The identifier of the member.
|
|
809
|
-
*/
|
|
810
|
-
kickChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
811
|
-
/**
|
|
812
|
-
* Set the rights of a chat member.
|
|
813
|
-
*
|
|
814
|
-
* @method ch
|
|
815
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
816
|
-
* @param memberId The identifier of a member.
|
|
817
|
-
*/
|
|
818
|
-
setChatMemberRights(chatId: ID, memberId: ID, params?: SetChatMemberRightsParams): Promise<void>;
|
|
819
|
-
/**
|
|
820
|
-
* Get the administrators of a chat.
|
|
821
|
-
*
|
|
822
|
-
* @method ch
|
|
823
|
-
* @param chatId The identifier of the chat.
|
|
824
|
-
* @returns The chat's administrators.
|
|
825
|
-
*/
|
|
826
|
-
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
827
944
|
/**
|
|
828
945
|
* Create a story. User-only.
|
|
829
946
|
*
|
|
@@ -898,104 +1015,11 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
898
1015
|
*/
|
|
899
1016
|
removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
|
|
900
1017
|
/**
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
* @method ch
|
|
904
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
905
|
-
*/
|
|
906
|
-
enableJoinRequests(chatId: ID): Promise<void>;
|
|
907
|
-
/**
|
|
908
|
-
* Disable join requests in a chat. User-only.
|
|
909
|
-
*
|
|
910
|
-
* @method ch
|
|
911
|
-
* @param chatId The identifier of the chat. Must be a channel or a supergroup.
|
|
912
|
-
*/
|
|
913
|
-
disableJoinRequests(chatId: ID): Promise<void>;
|
|
914
|
-
/**
|
|
915
|
-
* Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
|
|
916
|
-
*
|
|
917
|
-
* @method ac
|
|
918
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
919
|
-
* @param username The username to show.
|
|
920
|
-
*/
|
|
921
|
-
showUsername(id: ID, username: string): Promise<void>;
|
|
922
|
-
/**
|
|
923
|
-
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
924
|
-
*
|
|
925
|
-
* @method ac
|
|
926
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
927
|
-
* @param username The username to hide.
|
|
928
|
-
*/
|
|
929
|
-
hideUsername(id: ID, username: string): Promise<void>;
|
|
930
|
-
/**
|
|
931
|
-
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
932
|
-
*
|
|
933
|
-
* @method ac
|
|
934
|
-
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
935
|
-
* @param order The new order to use.
|
|
936
|
-
* @returns Whether the order was changed.
|
|
937
|
-
*/
|
|
938
|
-
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
939
|
-
/**
|
|
940
|
-
* Hide all usernames from the a supergroup or a channel's profile. User-only.
|
|
941
|
-
*
|
|
942
|
-
* @method ac
|
|
943
|
-
* @param id A supergroup ID or a channel ID.
|
|
944
|
-
*/
|
|
945
|
-
hideUsernames(id: ID): Promise<boolean>;
|
|
946
|
-
/**
|
|
947
|
-
* Get inactive chats. User-only.
|
|
948
|
-
*
|
|
949
|
-
* @method ch
|
|
950
|
-
* @retuns A list of inactive chats the current user is member of.
|
|
951
|
-
*/
|
|
952
|
-
getInactiveChats(): Promise<InactiveChat[]>;
|
|
953
|
-
/**
|
|
954
|
-
* Search the messages of a chat. User-only.
|
|
955
|
-
*
|
|
956
|
-
* @method ms
|
|
957
|
-
* @param chatId The identifier of the chat to search the messages in.
|
|
958
|
-
* @param query The message search query.
|
|
959
|
-
*/
|
|
960
|
-
searchMessages(chatId: ID, query: string, params?: SearchMessagesParams): Promise<Message[]>;
|
|
961
|
-
/**
|
|
962
|
-
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
963
|
-
*
|
|
964
|
-
* @method ch
|
|
965
|
-
* @param chatId The identifier of the chat.
|
|
966
|
-
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
967
|
-
*/
|
|
968
|
-
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
969
|
-
/**
|
|
970
|
-
* Create an invite link.
|
|
971
|
-
*
|
|
972
|
-
* @method ch
|
|
973
|
-
* @param chatId The identifier of the chat to create the invite link for.
|
|
974
|
-
* @returns The newly created invite link.
|
|
975
|
-
*/
|
|
976
|
-
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
977
|
-
/**
|
|
978
|
-
* Get the invite links created for a chat. User-only.
|
|
979
|
-
*
|
|
980
|
-
* @method ch
|
|
981
|
-
* @param chatId The identifier of the chat.
|
|
982
|
-
* @returns The invite links created for the chat. This might be a subset of the results if they were less than `limit`. The parameters `afterDate` and `afterInviteLink` can be used for pagination.
|
|
983
|
-
*/
|
|
984
|
-
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
985
|
-
/**
|
|
986
|
-
* Join a chat. User-only.
|
|
987
|
-
*
|
|
988
|
-
* @method ch
|
|
989
|
-
* @param chatId The identifier of the chat to join.
|
|
990
|
-
*/
|
|
991
|
-
joinChat(chatId: ID): Promise<void>;
|
|
992
|
-
/**
|
|
993
|
-
* Leave a chat.
|
|
1018
|
+
* Get network statistics. This might not always be available.
|
|
994
1019
|
*
|
|
995
|
-
* @method
|
|
996
|
-
* @param chatId The identifier of the chat to leave.
|
|
1020
|
+
* @method mc
|
|
997
1021
|
*/
|
|
998
|
-
|
|
1022
|
+
getNetworkStatistics(): Promise<NetworkStatistics>;
|
|
999
1023
|
/**
|
|
1000
1024
|
* Block a user. User-only.
|
|
1001
1025
|
*
|
|
@@ -1010,28 +1034,5 @@ export declare class Client<C extends Context = Context> extends Composer<C> {
|
|
|
1010
1034
|
* @param userId The identifier of the user to unblock.
|
|
1011
1035
|
*/
|
|
1012
1036
|
unblockUser(userId: ID): Promise<void>;
|
|
1013
|
-
/**
|
|
1014
|
-
* Get information on a user's chat membership.
|
|
1015
|
-
*
|
|
1016
|
-
* @method ch
|
|
1017
|
-
* @param chatId The identifier of a chat that includes the user.
|
|
1018
|
-
* @param userId The identifier of the user.
|
|
1019
|
-
*/
|
|
1020
|
-
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
1021
|
-
/**
|
|
1022
|
-
* Set a chat's sticker set.
|
|
1023
|
-
*
|
|
1024
|
-
* @method ch
|
|
1025
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1026
|
-
* @param setName The name of the set.
|
|
1027
|
-
*/
|
|
1028
|
-
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
1029
|
-
/**
|
|
1030
|
-
* Delete a chat's sticker set.
|
|
1031
|
-
*
|
|
1032
|
-
* @method ch
|
|
1033
|
-
* @param chatId The identifier of the chat. Must be a supergroup.
|
|
1034
|
-
*/
|
|
1035
|
-
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
1036
1037
|
}
|
|
1037
1038
|
export {};
|