@mtkruto/node 0.77.2 → 0.78.1
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 +1 -0
- package/esm/0_errors.d.ts.map +1 -1
- package/esm/0_errors.js +5 -0
- package/esm/3_errors.d.ts +6 -0
- package/esm/3_errors.d.ts.map +1 -1
- package/esm/3_errors.js +6 -0
- package/esm/3_types.d.ts +3 -0
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +3 -0
- package/esm/4_constants.d.ts +1 -0
- package/esm/4_constants.d.ts.map +1 -1
- package/esm/4_constants.js +2 -0
- package/esm/5_client.d.ts +6 -1
- package/esm/5_client.d.ts.map +1 -1
- package/esm/5_client.js +6 -1
- package/esm/_dnt.polyfills.d.ts +13 -13
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/_dnt.polyfills.js +11 -11
- package/esm/client/0_worker_request.d.ts +26 -0
- package/esm/client/0_worker_request.d.ts.map +1 -0
- package/esm/client/0_worker_request.js +20 -0
- package/esm/client/0_worker_response.d.ts +39 -0
- package/esm/client/0_worker_response.d.ts.map +1 -0
- package/esm/client/0_worker_response.js +20 -0
- package/esm/client/1_client_generic.d.ts +1602 -0
- package/esm/client/1_client_generic.d.ts.map +1 -0
- package/esm/client/1_client_generic.js +24 -0
- package/esm/client/2_account_manager.d.ts +6 -1
- package/esm/client/2_account_manager.d.ts.map +1 -1
- package/esm/client/2_account_manager.js +84 -0
- package/esm/client/2_context.d.ts +114 -0
- package/esm/client/2_context.d.ts.map +1 -0
- package/esm/client/2_context.js +453 -0
- package/esm/client/2_file_manager.d.ts.map +1 -1
- package/esm/client/2_file_manager.js +13 -6
- package/esm/client/2_sign_in.d.ts +25 -0
- package/esm/client/2_sign_in.d.ts.map +1 -0
- package/esm/client/2_sign_in.js +114 -0
- package/esm/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
- package/esm/client/3_filters.d.ts.map +1 -0
- package/esm/client/3_filters_test.d.ts.map +1 -0
- package/esm/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
- package/esm/client/4_composer.d.ts.map +1 -0
- package/esm/client/{1_composer.js → 4_composer.js} +17 -7
- package/esm/client/4_composer_test.d.ts.map +1 -0
- package/esm/client/5_client.d.ts +43 -179
- package/esm/client/5_client.d.ts.map +1 -1
- package/esm/client/5_client.js +141 -595
- package/esm/client/5_client_dispatcher.d.ts +1660 -0
- package/esm/client/5_client_dispatcher.d.ts.map +1 -0
- package/esm/client/5_client_dispatcher.js +2141 -0
- package/esm/client/6_client_worker.d.ts +27 -0
- package/esm/client/6_client_worker.d.ts.map +1 -0
- package/esm/client/6_client_worker.js +51 -0
- package/esm/types/0_bot_token_check_result.d.ts +29 -0
- package/esm/types/0_bot_token_check_result.d.ts.map +1 -0
- package/esm/types/0_bot_token_check_result.js +20 -0
- package/esm/types/0_code_check_result.d.ts +37 -0
- package/esm/types/0_code_check_result.d.ts.map +1 -0
- package/esm/types/0_code_check_result.js +20 -0
- package/esm/types/0_password_check_result.d.ts +33 -0
- package/esm/types/0_password_check_result.d.ts.map +1 -0
- package/esm/types/0_password_check_result.js +20 -0
- package/esm/types/1_chat_p.d.ts.map +1 -1
- package/esm/types/1_chat_p.js +2 -2
- package/esm/types/2_chat.d.ts +3 -3
- package/esm/types/2_chat.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/0_errors.d.ts +1 -0
- package/script/0_errors.d.ts.map +1 -1
- package/script/0_errors.js +5 -0
- package/script/3_errors.d.ts +6 -0
- package/script/3_errors.d.ts.map +1 -1
- package/script/3_errors.js +11 -3
- package/script/3_types.d.ts +3 -0
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +3 -0
- package/script/4_constants.d.ts +1 -0
- package/script/4_constants.d.ts.map +1 -1
- package/script/4_constants.js +3 -1
- package/script/5_client.d.ts +6 -1
- package/script/5_client.d.ts.map +1 -1
- package/script/5_client.js +6 -1
- package/script/_dnt.polyfills.d.ts +13 -13
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/_dnt.polyfills.js +11 -11
- package/script/client/0_worker_request.d.ts +26 -0
- package/script/client/0_worker_request.d.ts.map +1 -0
- package/script/client/0_worker_request.js +21 -0
- package/script/client/0_worker_response.d.ts +39 -0
- package/script/client/0_worker_response.d.ts.map +1 -0
- package/script/client/0_worker_response.js +21 -0
- package/script/client/1_client_generic.d.ts +1602 -0
- package/script/client/1_client_generic.d.ts.map +1 -0
- package/script/client/1_client_generic.js +28 -0
- package/script/client/2_account_manager.d.ts +6 -1
- package/script/client/2_account_manager.d.ts.map +1 -1
- package/script/client/2_account_manager.js +84 -0
- package/script/client/2_context.d.ts +114 -0
- package/script/client/2_context.d.ts.map +1 -0
- package/script/client/2_context.js +457 -0
- package/script/client/2_file_manager.d.ts.map +1 -1
- package/script/client/2_file_manager.js +11 -4
- package/script/client/2_sign_in.d.ts +25 -0
- package/script/client/2_sign_in.d.ts.map +1 -0
- package/script/client/2_sign_in.js +118 -0
- package/script/client/{0_filters.d.ts → 3_filters.d.ts} +6 -3
- package/script/client/3_filters.d.ts.map +1 -0
- package/script/client/3_filters_test.d.ts.map +1 -0
- package/script/client/{1_composer.d.ts → 4_composer.d.ts} +12 -11
- package/script/client/4_composer.d.ts.map +1 -0
- package/script/client/{1_composer.js → 4_composer.js} +17 -7
- package/script/client/4_composer_test.d.ts.map +1 -0
- package/script/client/5_client.d.ts +43 -179
- package/script/client/5_client.d.ts.map +1 -1
- package/script/client/5_client.js +140 -594
- package/script/client/5_client_dispatcher.d.ts +1660 -0
- package/script/client/5_client_dispatcher.d.ts.map +1 -0
- package/script/client/5_client_dispatcher.js +2178 -0
- package/script/client/6_client_worker.d.ts +27 -0
- package/script/client/6_client_worker.d.ts.map +1 -0
- package/script/client/6_client_worker.js +55 -0
- package/script/types/0_bot_token_check_result.d.ts +29 -0
- package/script/types/0_bot_token_check_result.d.ts.map +1 -0
- package/script/types/0_bot_token_check_result.js +21 -0
- package/script/types/0_code_check_result.d.ts +37 -0
- package/script/types/0_code_check_result.d.ts.map +1 -0
- package/script/types/0_code_check_result.js +21 -0
- package/script/types/0_password_check_result.d.ts +33 -0
- package/script/types/0_password_check_result.d.ts.map +1 -0
- package/script/types/0_password_check_result.js +21 -0
- package/script/types/1_chat_p.d.ts.map +1 -1
- package/script/types/1_chat_p.js +2 -2
- package/script/types/2_chat.d.ts +3 -3
- package/script/types/2_chat.d.ts.map +1 -1
- package/esm/client/0_filters.d.ts.map +0 -1
- package/esm/client/0_filters_test.d.ts.map +0 -1
- package/esm/client/1_composer.d.ts.map +0 -1
- package/script/client/0_filters.d.ts.map +0 -1
- package/script/client/0_filters_test.d.ts.map +0 -1
- package/script/client/1_composer.d.ts.map +0 -1
- /package/esm/client/{0_filters.js → 3_filters.js} +0 -0
- /package/script/client/{0_filters.js → 3_filters.js} +0 -0
|
@@ -0,0 +1,1660 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MTKruto - Cross-runtime JavaScript library for building Telegram clients
|
|
3
|
+
* Copyright (C) 2023-2026 Roj <https://roj.im/>
|
|
4
|
+
*
|
|
5
|
+
* This file is part of MTKruto.
|
|
6
|
+
*
|
|
7
|
+
* This program is free software: you can redistribute it and/or modify
|
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
* (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
* GNU Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
|
+
*/
|
|
20
|
+
import type { ClientGeneric } from "./1_client_generic.js";
|
|
21
|
+
import type { Api } from "../2_tl.js";
|
|
22
|
+
import type { BotCommand, BotTokenCheckResult, BusinessConnection, CallbackQueryAnswer, CallbackQueryQuestion, Chat, ChatAction, ChatListItem, ChatMember, ChatP, ChatPChannel, ChatPGroup, ChatPSupergroup, ChatSettings, ClaimedGifts, CodeCheckResult, FailedInvitation, FileSource, Gift, ID, InactiveChat, InlineQueryAnswer, InlineQueryResult, InputMedia, InputStoryContent, InviteLink, JoinRequest, LinkPreview, LiveStreamChannel, Message, MessageAnimation, MessageAudio, MessageContact, MessageDice, MessageDocument, MessageInvoice, MessageLocation, MessagePhoto, MessagePoll, MessageReactionList, MessageSticker, MessageText, MessageVenue, MessageVideo, MessageVideoNote, MessageVoice, MiniAppInfo, NetworkStatistics, ParseMode, PasswordCheckResult, Poll, PriceTag, Reaction, SavedChats, SlowModeDuration, Sticker, StickerSet, Story, Topic, Translation, User, VideoChat, VideoChatActive, VideoChatScheduled, VoiceTranscription } from "../3_types.js";
|
|
23
|
+
import type { AddChatMemberParams, AddContactParams, AddReactionParams, AnswerCallbackQueryParams, AnswerInlineQueryParams, AnswerPreCheckoutQueryParams, ApproveJoinRequestsParams, BanChatMemberParams, CreateChannelParams, CreateGroupParams, CreateInviteLinkParams, CreateStoryParams, CreateSupergroupParams, CreateTopicParams, DeclineJoinRequestsParams, DeleteMessageParams, DeleteMessagesParams, DownloadLiveStreamSegmentParams, DownloadParams, EditInlineMessageCaptionParams, EditInlineMessageMediaParams, EditInlineMessageTextParams, EditMessageCaptionParams, EditMessageLiveLocationParams, EditMessageMediaParams, EditMessageReplyMarkupParams, EditMessageTextParams, EditTopicParams, ForwardMessagesParams, GetChatMembersParams, GetChatsParams, GetClaimedGiftsParams, GetCommonChatsParams, GetCreatedInviteLinksParams, GetHistoryParams, GetJoinRequestsParams, GetLinkPreviewParams, GetMessageReactionsParams, GetMyCommandsParams, GetSavedChatsParams, GetSavedMessagesParams, GetTranslationsParams, JoinVideoChatParams, OpenChatParams, OpenMiniAppParams, PinMessageParams, PromoteChatMemberParams, ScheduleVideoChatParams, SearchMessagesParams, SendAnimationParams, SendAudioParams, SendContactParams, SendDiceParams, SendDocumentParams, SendGiftParams, SendInlineQueryParams, SendInvoiceParams, SendLocationParams, SendMediaGroupParams, SendMessageParams, SendPhotoParams, SendPollParams, SendStickerParams, SendVenueParams, SendVideoNoteParams, SendVideoParams, SendVoiceParams, SetBirthdayParams, SetChatMemberRightsParams, SetChatPhotoParams, SetEmojiStatusParams, SetLocationParams, SetMyCommandsParams, SetNameColorParams, SetPersonalChannelParams, SetProfileColorParams, SetReactionsParams, SetSignaturesEnabledParams, SignInParams, StartBotParams, StartVideoChatParams, StopPollParams, UnpinMessageParams, UpdateProfileParams } from "./0_params.js";
|
|
24
|
+
import type { DC } from "../3_transport.js";
|
|
25
|
+
import type { WorkerResponse } from "./0_worker_response.js";
|
|
26
|
+
import { Composer } from "./4_composer.js";
|
|
27
|
+
import type { Context } from "./2_context.js";
|
|
28
|
+
export interface ClientDispatcherParams {
|
|
29
|
+
/** The storage provider to use. Defaults to memory storage. */
|
|
30
|
+
storage?: "memory" | "indexeddb" | "denokv";
|
|
31
|
+
/** App's API ID from [my.telegram.org/apps](https://my.telegram.org/apps). Required if no account was previously authorized. */
|
|
32
|
+
apiId?: number;
|
|
33
|
+
/** App's API hash from [my.telegram.org/apps](https://my.telegram.org/apps). Required if no account was previously authorized. */
|
|
34
|
+
apiHash?: string;
|
|
35
|
+
/** A parse mode to use when the `parseMode` parameter is not specified when sending or editing messages. Defaults to `ParseMode.None`. */
|
|
36
|
+
parseMode?: ParseMode;
|
|
37
|
+
/** The app_version parameter to be passed to initConnection. It is recommended that this parameter is changed if users are authorized. Defaults to _MTKruto_. */
|
|
38
|
+
appVersion?: string;
|
|
39
|
+
/** The device_version parameter to be passed to initConnection. The default varies by the current runtime. */
|
|
40
|
+
deviceModel?: string;
|
|
41
|
+
/** The client's language to be used for fetching translations. Defaults to the runtime's language or `"en"`. */
|
|
42
|
+
language?: string;
|
|
43
|
+
/** The client's platform to be used for fetching translations. Defaults to an empty string. */
|
|
44
|
+
platform?: string;
|
|
45
|
+
/** The system_lang_code parameter to be passed to initConnection. Defaults to the runtime's language or `"en"`. */
|
|
46
|
+
systemLangCode?: string;
|
|
47
|
+
/** The system_version parameter to be passed to initConnection. The default varies by the current runtime. */
|
|
48
|
+
systemVersion?: string;
|
|
49
|
+
/** Whether to use default handlers. Defaults to `true`. */
|
|
50
|
+
defaultHandlers?: boolean;
|
|
51
|
+
/** Whether outgoing messages should be sent as high-level updates. Outgoing bot business messages will never be sent. Defaults to `false`. */
|
|
52
|
+
outgoingMessages?: boolean;
|
|
53
|
+
/** Whether to guarantee that order-sensitive updates are delivered at least once before delivering next ones. Useful mainly for clients providing a user interface à la Telegram Desktop. Defaults to `false`. */
|
|
54
|
+
guaranteeUpdateDelivery?: boolean;
|
|
55
|
+
/** Whether to not handle updates received when the client was not running. Defaults to `true` for bots, and `false` for users. */
|
|
56
|
+
dropPendingUpdates?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to persist cache to the provided storage, and not memory. Defaults to `false`.
|
|
59
|
+
*
|
|
60
|
+
* Explicitly setting this option to `true` is highly recommended if:
|
|
61
|
+
*
|
|
62
|
+
* - User accounts are authorized.
|
|
63
|
+
* - Less memory usage is demanded.
|
|
64
|
+
* - The client does not usually have a large uptime.
|
|
65
|
+
*
|
|
66
|
+
* When the provided storage takes advantage of memory, nothing changes, even if set to `true`.
|
|
67
|
+
*/
|
|
68
|
+
persistCache?: boolean;
|
|
69
|
+
/** Whether to disable receiving updates. UpdateConnectionState and UpdatesAuthorizationState will always be received. Defaults to `false`. */
|
|
70
|
+
disableUpdates?: boolean;
|
|
71
|
+
/** An auth string to automatically import. Can be overriden by a later importAuthString call. */
|
|
72
|
+
authString?: string;
|
|
73
|
+
/**
|
|
74
|
+
* The first DC to connect to. This is commonly used to decide whether to connect to test or production servers. It is not necessarily the DC that the client will directly connect to or is currently connected to. Defaults to the default initial DC.
|
|
75
|
+
*/
|
|
76
|
+
initialDc?: DC;
|
|
77
|
+
}
|
|
78
|
+
export declare class ClientDispatcher<C extends Context = Context> extends Composer<C> implements ClientGeneric {
|
|
79
|
+
#private;
|
|
80
|
+
constructor(worker: Worker, id: number);
|
|
81
|
+
/** @internal */
|
|
82
|
+
handleResponse(response: WorkerResponse): Promise<void>;
|
|
83
|
+
get id(): number;
|
|
84
|
+
init(params?: ClientDispatcherParams): Promise<void>;
|
|
85
|
+
connect(): Promise<void>;
|
|
86
|
+
disconnect(): Promise<void>;
|
|
87
|
+
start(params?: SignInParams): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Send a user verification code.
|
|
90
|
+
*
|
|
91
|
+
* @param phoneNumber The phone number to send the code to.
|
|
92
|
+
* @method ac
|
|
93
|
+
*/
|
|
94
|
+
sendCode(phoneNumber: string): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Check if a code entered by the user was the same as the verification code.
|
|
97
|
+
*
|
|
98
|
+
* @param code A code entered by the user.
|
|
99
|
+
* @method ac
|
|
100
|
+
*/
|
|
101
|
+
checkCode(code: string): Promise<CodeCheckResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Get the user account password's hint.
|
|
104
|
+
*
|
|
105
|
+
* @method ac
|
|
106
|
+
*/
|
|
107
|
+
getPasswordHint(): Promise<string | null>;
|
|
108
|
+
/**
|
|
109
|
+
* Check whether a password entered by the user is the same as the account's one.
|
|
110
|
+
*
|
|
111
|
+
* @param password The password to check
|
|
112
|
+
* @returns The result of the check.
|
|
113
|
+
*/
|
|
114
|
+
checkPassword(password: string): Promise<PasswordCheckResult>;
|
|
115
|
+
/**
|
|
116
|
+
* Check whether a bot token is valid.
|
|
117
|
+
*
|
|
118
|
+
* @param password The password to check
|
|
119
|
+
* @returns The result of the check.
|
|
120
|
+
*/
|
|
121
|
+
checkBotToken(botToken: string): Promise<BotTokenCheckResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Signs in using the provided parameters if not already signed in.
|
|
124
|
+
* If no parameters are provided, the credentials will be prompted in runtime.
|
|
125
|
+
*
|
|
126
|
+
* Notes:
|
|
127
|
+
* 1. Requires the `apiId` and `apiHash` paramters to be passed when constructing the client.
|
|
128
|
+
* 3. Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
|
|
129
|
+
*/
|
|
130
|
+
signIn(params?: SignInParams): Promise<void>;
|
|
131
|
+
signOut(): Promise<void>;
|
|
132
|
+
exportAuthString(): Promise<string>;
|
|
133
|
+
importAuthString(authString: string): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Get a chat's inputPeer. Useful when calling API functions directly.
|
|
136
|
+
*
|
|
137
|
+
* @param id The identifier of a chat.
|
|
138
|
+
*/
|
|
139
|
+
getInputPeer(id: ID): Promise<Api.InputPeer>;
|
|
140
|
+
/**
|
|
141
|
+
* Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
|
|
142
|
+
*
|
|
143
|
+
* @param id The identifier of the channel or the supergroup.
|
|
144
|
+
*/
|
|
145
|
+
getInputChannel(id: ID): Promise<Api.inputChannel | Api.inputChannelFromMessage>;
|
|
146
|
+
/**
|
|
147
|
+
* Get a user's inputUser. Useful when calling API functions directly.
|
|
148
|
+
*
|
|
149
|
+
* @param id The identifier of the user.
|
|
150
|
+
*/
|
|
151
|
+
getInputUser(id: ID): Promise<Api.inputUserSelf | Api.inputUser | Api.inputUserFromMessage>;
|
|
152
|
+
/**
|
|
153
|
+
* Get information on the currently authorized user.
|
|
154
|
+
*
|
|
155
|
+
* @method ac
|
|
156
|
+
* @returns Information on the currently authorized user.
|
|
157
|
+
*/
|
|
158
|
+
getMe(): Promise<User>;
|
|
159
|
+
/**
|
|
160
|
+
* Show a username in the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
161
|
+
*
|
|
162
|
+
* @method ac
|
|
163
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
164
|
+
* @param username The username to show.
|
|
165
|
+
*/
|
|
166
|
+
showUsername(id: ID, username: string): Promise<void>;
|
|
167
|
+
/**
|
|
168
|
+
* Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
169
|
+
*
|
|
170
|
+
* @method ac
|
|
171
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
172
|
+
* @param username The username to hide.
|
|
173
|
+
*/
|
|
174
|
+
hideUsername(id: ID, username: string): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
|
|
177
|
+
*
|
|
178
|
+
* @method ac
|
|
179
|
+
* @param id `"me"`, a bot ID, a supergroup ID, or a channel ID.
|
|
180
|
+
* @param order The new order to use.
|
|
181
|
+
* @returns Whether the order was changed.
|
|
182
|
+
*/
|
|
183
|
+
reorderUsernames(id: ID, order: string[]): Promise<boolean>;
|
|
184
|
+
/**
|
|
185
|
+
* Hide all usernames from a supergroup or a channel's profile. User-only.
|
|
186
|
+
*
|
|
187
|
+
* @method ac
|
|
188
|
+
* @param id A supergroup ID or a channel ID.
|
|
189
|
+
* @returns Whether any username was hidden.
|
|
190
|
+
*/
|
|
191
|
+
hideUsernames(id: ID): Promise<boolean>;
|
|
192
|
+
/**
|
|
193
|
+
* Get a business connection. Bot-only.
|
|
194
|
+
*
|
|
195
|
+
* @method ac
|
|
196
|
+
* @param id The identifier of the business connection.
|
|
197
|
+
* @cache
|
|
198
|
+
*/
|
|
199
|
+
getBusinessConnection(id: string): Promise<BusinessConnection>;
|
|
200
|
+
/**
|
|
201
|
+
* Set the current account's online status. User-only.
|
|
202
|
+
*
|
|
203
|
+
* @method ac
|
|
204
|
+
* @param online The new online status.
|
|
205
|
+
*/
|
|
206
|
+
setOnline(online: boolean): Promise<void>;
|
|
207
|
+
/**
|
|
208
|
+
* Set the current account's emoji status. User-only.
|
|
209
|
+
*
|
|
210
|
+
* @method ac
|
|
211
|
+
* @param id The identifier of the emoji to be used as the new status.
|
|
212
|
+
*/
|
|
213
|
+
setEmojiStatus(id: string, params?: SetEmojiStatusParams): Promise<void>;
|
|
214
|
+
/**
|
|
215
|
+
* Set the emoji status of a bot's user. Bot-only.
|
|
216
|
+
*
|
|
217
|
+
* @method ac
|
|
218
|
+
* @param userId The identifier of a user of the bot.
|
|
219
|
+
* @param id The identifier of the emoji to be used as the new status.
|
|
220
|
+
*/
|
|
221
|
+
setUserEmojiStatus(userId: ID, id: string, params?: SetEmojiStatusParams): Promise<void>;
|
|
222
|
+
/**
|
|
223
|
+
* Update the profile of the current user. At least one parameter must be specified. User-only.
|
|
224
|
+
*
|
|
225
|
+
* @method ac
|
|
226
|
+
*/
|
|
227
|
+
updateProfile(params?: UpdateProfileParams): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Set the birthday of the current user. User-only.
|
|
230
|
+
*
|
|
231
|
+
* @method ac
|
|
232
|
+
*/
|
|
233
|
+
setBirthday(params?: SetBirthdayParams): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Set the personal channel of the current user. User-only.
|
|
236
|
+
*
|
|
237
|
+
* @method ac
|
|
238
|
+
*/
|
|
239
|
+
setPersonalChannel(params?: SetPersonalChannelParams): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Set the name color of the current user. User-only.
|
|
242
|
+
*
|
|
243
|
+
* @method ac
|
|
244
|
+
* @param color The identifier of the color to set.
|
|
245
|
+
*/
|
|
246
|
+
setNameColor(color: number, params?: SetNameColorParams): Promise<void>;
|
|
247
|
+
/**
|
|
248
|
+
* Set the profile color of the current user. User-only.
|
|
249
|
+
*
|
|
250
|
+
* @method ac
|
|
251
|
+
* @param color The identifier of the color to set.
|
|
252
|
+
*/
|
|
253
|
+
setProfileColor(color: number, params?: SetProfileColorParams): Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* Set the location of the current user. User-only.
|
|
256
|
+
*
|
|
257
|
+
* @method ac
|
|
258
|
+
*/
|
|
259
|
+
setLocation(params?: SetLocationParams): Promise<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Send a text message.
|
|
262
|
+
*
|
|
263
|
+
* @method ms
|
|
264
|
+
* @param chatId The identifier of a chat to send the message to.
|
|
265
|
+
* @param text The message's text.
|
|
266
|
+
* @returns The sent text message.
|
|
267
|
+
*/
|
|
268
|
+
sendMessage(chatId: ID, text: string, params: SendMessageParams): Promise<MessageText>;
|
|
269
|
+
/**
|
|
270
|
+
* Send a photo.
|
|
271
|
+
*
|
|
272
|
+
* @method ms
|
|
273
|
+
* @param chatId The identifier of a chat to send the photo to.
|
|
274
|
+
* @param photo The photo to send.
|
|
275
|
+
* @returns The sent photo.
|
|
276
|
+
*/
|
|
277
|
+
sendPhoto(chatId: ID, photo: FileSource, params: SendPhotoParams): Promise<MessagePhoto>;
|
|
278
|
+
/**
|
|
279
|
+
* Send a document.
|
|
280
|
+
*
|
|
281
|
+
* @method ms
|
|
282
|
+
* @param chatId The identifier of a chat to send the document to.
|
|
283
|
+
* @param document The document to send.
|
|
284
|
+
* @returns The sent document.
|
|
285
|
+
*/
|
|
286
|
+
sendDocument(chatId: ID, document: FileSource, params: SendDocumentParams): Promise<MessageDocument>;
|
|
287
|
+
/**
|
|
288
|
+
* Send a sticker.
|
|
289
|
+
*
|
|
290
|
+
* @method ms
|
|
291
|
+
* @param chatId The identifier of a chat to send the sticker to.
|
|
292
|
+
* @param document The sticker to send.
|
|
293
|
+
* @returns The sent sticker.
|
|
294
|
+
*/
|
|
295
|
+
sendSticker(chatId: ID, sticker: FileSource, params: SendStickerParams): Promise<MessageSticker>;
|
|
296
|
+
/**
|
|
297
|
+
* Send a video.
|
|
298
|
+
*
|
|
299
|
+
* @method ms
|
|
300
|
+
* @param chatId The identifier of a chat to send the video to.
|
|
301
|
+
* @param video The video to send.
|
|
302
|
+
* @returns The sent video.
|
|
303
|
+
*/
|
|
304
|
+
sendVideo(chatId: ID, video: FileSource, params: SendVideoParams): Promise<MessageVideo>;
|
|
305
|
+
/**
|
|
306
|
+
* Send an animation.
|
|
307
|
+
*
|
|
308
|
+
* @method ms
|
|
309
|
+
* @param chatId The identifier of a chat to send the animation to.
|
|
310
|
+
* @param animation The animation to send.
|
|
311
|
+
* @returns The sent animation.
|
|
312
|
+
*/
|
|
313
|
+
sendAnimation(chatId: ID, animation: FileSource, params: SendAnimationParams): Promise<MessageAnimation>;
|
|
314
|
+
/**
|
|
315
|
+
* Send a voice message.
|
|
316
|
+
*
|
|
317
|
+
* @method ms
|
|
318
|
+
* @param chatId The identifier of a chat to send the voice message to.
|
|
319
|
+
* @param voice The voice to send.
|
|
320
|
+
* @returns The sent voice message.
|
|
321
|
+
*/
|
|
322
|
+
sendVoice(chatId: ID, voice: FileSource, params: SendVoiceParams): Promise<MessageVoice>;
|
|
323
|
+
/**
|
|
324
|
+
* Send an audio file.
|
|
325
|
+
*
|
|
326
|
+
* @method ms
|
|
327
|
+
* @param chatId The identifier of a chat to send the audio file to.
|
|
328
|
+
* @param audio The audio to send.
|
|
329
|
+
* @returns The sent audio file.
|
|
330
|
+
*/
|
|
331
|
+
sendAudio(chatId: ID, audio: FileSource, params: SendAudioParams): Promise<MessageAudio>;
|
|
332
|
+
/**
|
|
333
|
+
* Send a media group.
|
|
334
|
+
*
|
|
335
|
+
* @method ms
|
|
336
|
+
* @param chatId The identifier of a chat to send the media group to.
|
|
337
|
+
* @param media The media to include in the media group. Animations are not allowed. All of them must be of the same media type, but an exception is that photos and videos can be mixed.
|
|
338
|
+
* @returns The sent messages.
|
|
339
|
+
*/
|
|
340
|
+
sendMediaGroup(chatId: ID, media: InputMedia[], params?: SendMediaGroupParams): Promise<Message[]>;
|
|
341
|
+
/**
|
|
342
|
+
* Send a video note.
|
|
343
|
+
*
|
|
344
|
+
* @method ms
|
|
345
|
+
* @param chatId The identifier of a chat to send the video note to.
|
|
346
|
+
* @param videoNote The video note to send.
|
|
347
|
+
* @returns The sent video note.
|
|
348
|
+
*/
|
|
349
|
+
sendVideoNote(chatId: ID, videoNote: FileSource, params: SendVideoNoteParams): Promise<MessageVideoNote>;
|
|
350
|
+
/**
|
|
351
|
+
* Send a location.
|
|
352
|
+
*
|
|
353
|
+
* @method ms
|
|
354
|
+
* @param chatId The identifier of a chat to send the location to.
|
|
355
|
+
* @param latitude The location's latitude.
|
|
356
|
+
* @param longitude The location's longitude.
|
|
357
|
+
* @returns The sent location.
|
|
358
|
+
*/
|
|
359
|
+
sendLocation(chatId: ID, latitude: number, longitude: number, params?: SendLocationParams): Promise<MessageLocation>;
|
|
360
|
+
/**
|
|
361
|
+
* Send a contact.
|
|
362
|
+
*
|
|
363
|
+
* @method ms
|
|
364
|
+
* @param chatId The identifier of a chat to send the contact to.
|
|
365
|
+
* @param firstName The contact's first name.
|
|
366
|
+
* @param number The contact's phone number.
|
|
367
|
+
* @returns The sent contact.
|
|
368
|
+
*/
|
|
369
|
+
sendContact(chatId: ID, firstName: string, number: string, params?: SendContactParams): Promise<MessageContact>;
|
|
370
|
+
/**
|
|
371
|
+
* Send a dice.
|
|
372
|
+
*
|
|
373
|
+
* @method ms
|
|
374
|
+
* @param chatId The identifier of a chat to send the dice to.
|
|
375
|
+
* @returns The sent dice.
|
|
376
|
+
*/
|
|
377
|
+
sendDice(chatId: ID, params?: SendDiceParams): Promise<MessageDice>;
|
|
378
|
+
/**
|
|
379
|
+
* Send a venue.
|
|
380
|
+
*
|
|
381
|
+
* @method ms
|
|
382
|
+
* @param chatId The identifier of a chat to send the venue to.
|
|
383
|
+
* @param latitude The latitude of the venue.
|
|
384
|
+
* @param longitude The longitude of the venue.
|
|
385
|
+
* @param title The title of the venue.
|
|
386
|
+
* @param address The written address of the venue.
|
|
387
|
+
* @returns The sent venue.
|
|
388
|
+
*/
|
|
389
|
+
sendVenue(chatId: ID, latitude: number, longitude: number, title: string, address: string, params?: SendVenueParams): Promise<MessageVenue>;
|
|
390
|
+
/**
|
|
391
|
+
* Send a poll.
|
|
392
|
+
*
|
|
393
|
+
* @method ms
|
|
394
|
+
* @param chatId The identifier of a chat to send the poll to.
|
|
395
|
+
* @param question The poll's question.
|
|
396
|
+
* @param options The poll's options.
|
|
397
|
+
* @returns The sent poll.
|
|
398
|
+
*/
|
|
399
|
+
sendPoll(chatId: ID, question: string, options: string[], params?: SendPollParams): Promise<MessagePoll>;
|
|
400
|
+
/**
|
|
401
|
+
* Send an invoice. Bot-only.
|
|
402
|
+
*
|
|
403
|
+
* @method ms
|
|
404
|
+
* @param chatId The identifier of a chat to send the invoice to.
|
|
405
|
+
* @param title The invoice's title.
|
|
406
|
+
* @param description The invoice's description.
|
|
407
|
+
* @param payload The invoice's payload.
|
|
408
|
+
* @param currency The invoice's currency.
|
|
409
|
+
* @param prices The invoice's price tags.
|
|
410
|
+
* @returns The sent invoice.
|
|
411
|
+
*/
|
|
412
|
+
sendInvoice(chatId: ID, title: string, description: string, payload: string, currency: string, prices: PriceTag[], params?: SendInvoiceParams): Promise<MessageInvoice>;
|
|
413
|
+
/**
|
|
414
|
+
* Edit a message's text.
|
|
415
|
+
*
|
|
416
|
+
* @method ms
|
|
417
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
418
|
+
* @param messageId The identifier of the message.
|
|
419
|
+
* @param text The new text of the message.
|
|
420
|
+
* @returns The edited text message.
|
|
421
|
+
*/
|
|
422
|
+
editMessageText(chatId: ID, messageId: number, text: string, params?: EditMessageTextParams): Promise<MessageText>;
|
|
423
|
+
/**
|
|
424
|
+
* Edit a message's caption.
|
|
425
|
+
*
|
|
426
|
+
* @method ms
|
|
427
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
428
|
+
* @param messageId The identifier of the message.
|
|
429
|
+
* @param text The new caption of the message.
|
|
430
|
+
* @returns The edited message.
|
|
431
|
+
*/
|
|
432
|
+
editMessageCaption(chatId: ID, messageId: number, params: EditMessageCaptionParams): Promise<Message>;
|
|
433
|
+
/**
|
|
434
|
+
* Edit a message's media.
|
|
435
|
+
*
|
|
436
|
+
* @method ms
|
|
437
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
438
|
+
* @param messageId The identifier of the message.
|
|
439
|
+
* @param media The new media of the message.
|
|
440
|
+
* @returns The edited message.
|
|
441
|
+
*/
|
|
442
|
+
editMessageMedia(chatId: ID, messageId: number, media: InputMedia, params?: EditMessageMediaParams): Promise<Message>;
|
|
443
|
+
/**
|
|
444
|
+
* Edit an inline message's media.
|
|
445
|
+
*
|
|
446
|
+
* @method ms
|
|
447
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
448
|
+
* @param media The new media of the message.
|
|
449
|
+
*/
|
|
450
|
+
editInlineMessageMedia(inlineMessageId: string, media: InputMedia, params: EditInlineMessageMediaParams): Promise<void>;
|
|
451
|
+
/**
|
|
452
|
+
* Edit an inline message's text. Bot-only.
|
|
453
|
+
*
|
|
454
|
+
* @method ms
|
|
455
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
456
|
+
* @param text The new text of the message.
|
|
457
|
+
*/
|
|
458
|
+
editInlineMessageText(inlineMessageId: string, text: string, params: EditInlineMessageTextParams): Promise<void>;
|
|
459
|
+
/**
|
|
460
|
+
* Edit an inline message's caption. Bot-only.
|
|
461
|
+
*
|
|
462
|
+
* @method ms
|
|
463
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
464
|
+
*/
|
|
465
|
+
editInlineMessageCaption(inlineMessageId: string, params?: EditInlineMessageCaptionParams): Promise<void>;
|
|
466
|
+
/**
|
|
467
|
+
* Edit a message's reply markup.
|
|
468
|
+
*
|
|
469
|
+
* @method ms
|
|
470
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
471
|
+
* @param messageId The identifier of the message.
|
|
472
|
+
* @returns The edited message.
|
|
473
|
+
*/
|
|
474
|
+
editMessageReplyMarkup(chatId: ID, messageId: number, params?: EditMessageReplyMarkupParams): Promise<Message>;
|
|
475
|
+
/**
|
|
476
|
+
* Edit an inline message's reply markup. Bot-only.
|
|
477
|
+
*
|
|
478
|
+
* @method ms
|
|
479
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
480
|
+
*/
|
|
481
|
+
editInlineMessageReplyMarkup(inlineMessageId: string, params?: EditMessageReplyMarkupParams): Promise<void>;
|
|
482
|
+
/**
|
|
483
|
+
* Edit a message's live location.
|
|
484
|
+
*
|
|
485
|
+
* @method ms
|
|
486
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
487
|
+
* @param messageId The identifier of the message.
|
|
488
|
+
* @param latitude The new latitude.
|
|
489
|
+
* @param longitude The new longitude.
|
|
490
|
+
* @returns The edited location message.
|
|
491
|
+
*/
|
|
492
|
+
editMessageLiveLocation(chatId: ID, messageId: number, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<MessageLocation>;
|
|
493
|
+
/**
|
|
494
|
+
* Edit an inline message's live location. Bot-only.
|
|
495
|
+
*
|
|
496
|
+
* @method ms
|
|
497
|
+
* @param inlineMessageId The identifier of the inline message.
|
|
498
|
+
* @param latitude The new latitude.
|
|
499
|
+
* @param longitude The new longitude.
|
|
500
|
+
* @returns The edited location message.
|
|
501
|
+
*/
|
|
502
|
+
editInlineMessageLiveLocation(inlineMessageId: string, latitude: number, longitude: number, params?: EditMessageLiveLocationParams): Promise<void>;
|
|
503
|
+
/**
|
|
504
|
+
* Retrieve multiple messages.
|
|
505
|
+
*
|
|
506
|
+
* @method ms
|
|
507
|
+
* @param chatId The identifier of a chat to retrieve the messages from.
|
|
508
|
+
* @param messageIds The identifiers of the messages to retrieve.
|
|
509
|
+
* @example ```ts
|
|
510
|
+
* const message = await client.getMessages("@MTKruto", [210, 212]): Promise<void>;
|
|
511
|
+
* ```
|
|
512
|
+
* @returns The retrieved messages.
|
|
513
|
+
* @cache
|
|
514
|
+
*/
|
|
515
|
+
getMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
|
|
516
|
+
/**
|
|
517
|
+
* Retrieve a single message.
|
|
518
|
+
*
|
|
519
|
+
* @method ms
|
|
520
|
+
* @param chatId The identifier of a chat.
|
|
521
|
+
* @param messageId The identifier of the message to retrieve.
|
|
522
|
+
* @example ```ts
|
|
523
|
+
* const message = await client.getMessage("@MTKruto", 212): Promise<void>;
|
|
524
|
+
* ```
|
|
525
|
+
* @returns The retrieved message.
|
|
526
|
+
* @cache
|
|
527
|
+
*/
|
|
528
|
+
getMessage(chatId: ID, messageId: number): Promise<Message | null>;
|
|
529
|
+
/**
|
|
530
|
+
* Retrieve a message using its link.
|
|
531
|
+
*
|
|
532
|
+
* @method ms
|
|
533
|
+
* @param link A message link.
|
|
534
|
+
* @example ```ts
|
|
535
|
+
* const message = await client.resolveMessageLink("https://t.me/MTKruto/212"): Promise<void>;
|
|
536
|
+
* ```
|
|
537
|
+
* @returns The message that was linked to.
|
|
538
|
+
*/
|
|
539
|
+
resolveMessageLink(link: string): Promise<Message | null>;
|
|
540
|
+
/**
|
|
541
|
+
* Delete multiple messages.
|
|
542
|
+
*
|
|
543
|
+
* @method ms
|
|
544
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
545
|
+
* @param messageIds The identifiers of the messages to delete.
|
|
546
|
+
*/
|
|
547
|
+
deleteMessages(chatId: ID, messageIds: number[], params?: DeleteMessagesParams): Promise<void>;
|
|
548
|
+
/**
|
|
549
|
+
* Delete a single message.
|
|
550
|
+
*
|
|
551
|
+
* @method ms
|
|
552
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
553
|
+
* @param messageId The identifier of the message to delete.
|
|
554
|
+
*/
|
|
555
|
+
deleteMessage(chatId: ID, messageId: number, params: DeleteMessageParams): Promise<void>;
|
|
556
|
+
/**
|
|
557
|
+
* Delete all messages sent by a specific member of a chat. User-only.
|
|
558
|
+
*
|
|
559
|
+
* @method ms
|
|
560
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
561
|
+
* @param memberId The identifier of the member.
|
|
562
|
+
*/
|
|
563
|
+
deleteChatMemberMessages(chatId: ID, memberId: ID): Promise<void>;
|
|
564
|
+
/**
|
|
565
|
+
* Delete multiple scheduled messages.
|
|
566
|
+
*
|
|
567
|
+
* @method ms
|
|
568
|
+
* @param chatId The identifier of a chat.
|
|
569
|
+
* @param messageIds The identifiers of the scheduled messages to delete.
|
|
570
|
+
*/
|
|
571
|
+
deleteScheduledMessages(chatId: ID, messageIds: number[]): Promise<void>;
|
|
572
|
+
/**
|
|
573
|
+
* Delete a scheduled message.
|
|
574
|
+
*
|
|
575
|
+
* @method ms
|
|
576
|
+
* @param chatId The identifier of a chat.
|
|
577
|
+
* @param messageId The identifier of the scheduled message to delete.
|
|
578
|
+
*/
|
|
579
|
+
deleteScheduledMessage(chatId: ID, messageId: number): Promise<void>;
|
|
580
|
+
/**
|
|
581
|
+
* Send multiple scheduled messages before their schedule.
|
|
582
|
+
*
|
|
583
|
+
* @method ms
|
|
584
|
+
* @param chatId The identifier of a chat.
|
|
585
|
+
* @param messageIds The identifiers of the scheduled messages to send.
|
|
586
|
+
*/
|
|
587
|
+
sendScheduledMessages(chatId: ID, messageIds: number[]): Promise<Message[]>;
|
|
588
|
+
/**
|
|
589
|
+
* Send a scheduled message before its schedule.
|
|
590
|
+
*
|
|
591
|
+
* @method ms
|
|
592
|
+
* @param chatId The identifier of a chat.
|
|
593
|
+
* @param messageId The identifier of the scheduled message to send.
|
|
594
|
+
*/
|
|
595
|
+
sendScheduledMessage(chatId: ID, messageId: number): Promise<Message>;
|
|
596
|
+
/**
|
|
597
|
+
* Pin a message in a chat.
|
|
598
|
+
*
|
|
599
|
+
* @method ms
|
|
600
|
+
* @param chatId The identifier of a chat.
|
|
601
|
+
* @param messageId The identifier of the message.
|
|
602
|
+
*/
|
|
603
|
+
pinMessage(chatId: ID, messageId: number, params: PinMessageParams): Promise<void>;
|
|
604
|
+
/**
|
|
605
|
+
* Unpin a pinned message.
|
|
606
|
+
*
|
|
607
|
+
* @method ms
|
|
608
|
+
* @param chatId The identifier of a chat.
|
|
609
|
+
* @param messageId The identifier of the message.
|
|
610
|
+
*/
|
|
611
|
+
unpinMessage(chatId: ID, messageId: number, params: UnpinMessageParams): Promise<void>;
|
|
612
|
+
/**
|
|
613
|
+
* Unpin all pinned messages.
|
|
614
|
+
*
|
|
615
|
+
* @method ms
|
|
616
|
+
* @param chatId The identifier of a chat.
|
|
617
|
+
*/
|
|
618
|
+
unpinMessages(chatId: ID): Promise<void>;
|
|
619
|
+
/**
|
|
620
|
+
* Forward multiple messages.
|
|
621
|
+
*
|
|
622
|
+
* @method ms
|
|
623
|
+
* @param from The identifier of a chat to forward the messages from.
|
|
624
|
+
* @param to The identifier of a chat to forward the messages to.
|
|
625
|
+
* @param messageIds The identifiers of the messages to forward.
|
|
626
|
+
* @returns The forwarded messages.
|
|
627
|
+
*/
|
|
628
|
+
forwardMessages(from: ID, to: ID, messageIds: number[], params?: ForwardMessagesParams): Promise<Message[]>;
|
|
629
|
+
/**
|
|
630
|
+
* Forward a single message.
|
|
631
|
+
*
|
|
632
|
+
* @method ms
|
|
633
|
+
* @param from The identifier of a chat to forward the message from.
|
|
634
|
+
* @param to The identifier of a chat to forward the message to.
|
|
635
|
+
* @param messageId The identifier of the message to forward.
|
|
636
|
+
* @returns The forwarded message.
|
|
637
|
+
*/
|
|
638
|
+
forwardMessage(from: ID, to: ID, messageId: number, params?: ForwardMessagesParams): Promise<Message>;
|
|
639
|
+
/**
|
|
640
|
+
* Stop a poll.
|
|
641
|
+
*
|
|
642
|
+
* @method ms
|
|
643
|
+
* @param chatId The chat that includes the poll.
|
|
644
|
+
* @param messageId The idenfifier of the poll's message.
|
|
645
|
+
* @returns The new state of the poll.
|
|
646
|
+
*/
|
|
647
|
+
stopPoll(chatId: ID, messageId: number, params: StopPollParams): Promise<Poll>;
|
|
648
|
+
/**
|
|
649
|
+
* Send a chat action.
|
|
650
|
+
*
|
|
651
|
+
* @method ms
|
|
652
|
+
* @param chatId The identifier of a chat to send the chat action to.
|
|
653
|
+
* @param action The chat action.
|
|
654
|
+
* @param messageThreadId The thread to send the chat action to.
|
|
655
|
+
*/
|
|
656
|
+
sendChatAction(chatId: ID, action: ChatAction, params?: {
|
|
657
|
+
messageThreadId?: number;
|
|
658
|
+
}): Promise<void>;
|
|
659
|
+
/**
|
|
660
|
+
* Search for messages. User-only.
|
|
661
|
+
*
|
|
662
|
+
* @method ms
|
|
663
|
+
*/
|
|
664
|
+
searchMessages(params?: SearchMessagesParams): Promise<Message[]>;
|
|
665
|
+
/**
|
|
666
|
+
* Mark messages as read. User-only.
|
|
667
|
+
*
|
|
668
|
+
* @method ms
|
|
669
|
+
* @param chatId The identifier of the chat which the messages belong to.
|
|
670
|
+
* @param untilMessageId The identifier of the message that will be marked as read, along with any other unread messages before it.
|
|
671
|
+
*/
|
|
672
|
+
readMessages(chatId: ID, untilMessageId: number): Promise<void>;
|
|
673
|
+
/**
|
|
674
|
+
* Start a bot. User-only.
|
|
675
|
+
*
|
|
676
|
+
* @method ms
|
|
677
|
+
* @param botId The identifier of the bot to start.
|
|
678
|
+
* @returns The start message.
|
|
679
|
+
*/
|
|
680
|
+
startBot(botId: number, params?: StartBotParams): Promise<Message>;
|
|
681
|
+
/**
|
|
682
|
+
* Transcribe a voice message. User-only.
|
|
683
|
+
*
|
|
684
|
+
* @method ms
|
|
685
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
686
|
+
* @param messageId The identifier of the message.
|
|
687
|
+
* @cache
|
|
688
|
+
*/
|
|
689
|
+
transcribeVoice(chatId: ID, messageId: number): Promise<VoiceTranscription>;
|
|
690
|
+
/**
|
|
691
|
+
* Get a sticker set.
|
|
692
|
+
*
|
|
693
|
+
* @method ms
|
|
694
|
+
* @param name The name of the sticker set or its link.
|
|
695
|
+
*/
|
|
696
|
+
getStickerSet(name: string): Promise<StickerSet>;
|
|
697
|
+
getLinkPreview(text: string, params?: GetLinkPreviewParams): Promise<LinkPreview | null>;
|
|
698
|
+
/**
|
|
699
|
+
* Open a mini app. User-only.
|
|
700
|
+
*
|
|
701
|
+
* @method ms
|
|
702
|
+
* @param botId The identifier of a bot with the mini app.
|
|
703
|
+
* @param chatId The identifier of the chat from which the mini app is opened.
|
|
704
|
+
* @cache
|
|
705
|
+
*/
|
|
706
|
+
openMiniApp(botId: ID, chatId: ID, params: OpenMiniAppParams): Promise<MiniAppInfo>;
|
|
707
|
+
/**
|
|
708
|
+
* Get a progress ID that can be passed to relevant send* methods to receive upload progress updates for them.
|
|
709
|
+
*
|
|
710
|
+
* @method ms
|
|
711
|
+
* @cache
|
|
712
|
+
*/
|
|
713
|
+
getProgressId(): Promise<string>;
|
|
714
|
+
/**
|
|
715
|
+
* Get messages saved from a specific chat.
|
|
716
|
+
*
|
|
717
|
+
* @method ms
|
|
718
|
+
* @param chatId The identifier of a chat.
|
|
719
|
+
*/
|
|
720
|
+
getSavedMessages(chatId: ID, params?: GetSavedMessagesParams): Promise<Message[]>;
|
|
721
|
+
/**
|
|
722
|
+
* Get a list of saved chats.
|
|
723
|
+
*
|
|
724
|
+
* @method ms
|
|
725
|
+
*/
|
|
726
|
+
getSavedChats(params?: GetSavedChatsParams): Promise<SavedChats>;
|
|
727
|
+
/**
|
|
728
|
+
* Get a list of reactions made to a message. User-only.
|
|
729
|
+
*
|
|
730
|
+
* @param chatId The identifier of a chat.
|
|
731
|
+
* @param messageId The identifier of the message.
|
|
732
|
+
* @method ms
|
|
733
|
+
*/
|
|
734
|
+
getMessageReactions(chatId: ID, messageId: number, params: GetMessageReactionsParams): Promise<MessageReactionList>;
|
|
735
|
+
/**
|
|
736
|
+
* Cast a vote. User-only.
|
|
737
|
+
*
|
|
738
|
+
* @method pl
|
|
739
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
740
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
741
|
+
* @param optionIndexes The indexes of the options to cast for.
|
|
742
|
+
*/
|
|
743
|
+
vote(chatId: ID, messageId: number, optionIndexes: number[]): Promise<void>;
|
|
744
|
+
/**
|
|
745
|
+
* Retract a vote. User-only.
|
|
746
|
+
*
|
|
747
|
+
* @method pl
|
|
748
|
+
* @param chatId The identifier of the chat that includes the poll.
|
|
749
|
+
* @param messageId The identifier of the message that includes the poll.
|
|
750
|
+
*/
|
|
751
|
+
retractVote(chatId: ID, messageId: number): Promise<void>;
|
|
752
|
+
/**
|
|
753
|
+
* Download a chunk of a file.
|
|
754
|
+
*
|
|
755
|
+
* @method fs
|
|
756
|
+
* @param fileId The identifier of a file.
|
|
757
|
+
* @example ```ts
|
|
758
|
+
* const chunk = await client.downloadChunk(fileId, { chunkSize: 256 * 1024 });
|
|
759
|
+
* ```
|
|
760
|
+
* @returns The downloaded chunk.
|
|
761
|
+
* @cache file
|
|
762
|
+
*/
|
|
763
|
+
downloadChunk(fileId: string, params?: DownloadParams): Promise<Uint8Array>;
|
|
764
|
+
/**
|
|
765
|
+
* Download a file.
|
|
766
|
+
*
|
|
767
|
+
* @method fs
|
|
768
|
+
* @param fileId The identifier of the file to download.
|
|
769
|
+
* @example ```ts
|
|
770
|
+
* for await (const chunk of client.download(fileId, { chunkSize: 256 * 1024 })) {
|
|
771
|
+
* await outFile.write(chunk): Promise<void>;
|
|
772
|
+
* }
|
|
773
|
+
* ```
|
|
774
|
+
* @returns A generator yielding the contents of the file.
|
|
775
|
+
* @cache file
|
|
776
|
+
*/
|
|
777
|
+
download(fileId: string, params?: DownloadParams): AsyncGenerator<Uint8Array, void, unknown>;
|
|
778
|
+
/**
|
|
779
|
+
* Get custom emoji documents for download.
|
|
780
|
+
*
|
|
781
|
+
* @method fs
|
|
782
|
+
* @param id Identifier of one or more of custom emojis.
|
|
783
|
+
* @returns The custom emoji documents.
|
|
784
|
+
* @cache
|
|
785
|
+
*/
|
|
786
|
+
getCustomEmojiStickers(id: string | string[]): Promise<Sticker[]>;
|
|
787
|
+
/**
|
|
788
|
+
* Get chats from a chat list. User-only.
|
|
789
|
+
*
|
|
790
|
+
* @method ch
|
|
791
|
+
*/
|
|
792
|
+
getChats(params?: GetChatsParams): Promise<ChatListItem[]>;
|
|
793
|
+
/**
|
|
794
|
+
* Get a chat.
|
|
795
|
+
*
|
|
796
|
+
* @method ch
|
|
797
|
+
* @cache
|
|
798
|
+
*/
|
|
799
|
+
getChat(chatId: ID): Promise<Chat>;
|
|
800
|
+
/**
|
|
801
|
+
* Get chat history. User-only.
|
|
802
|
+
*
|
|
803
|
+
* @method ch
|
|
804
|
+
* @param chatId The identifier of a chat.
|
|
805
|
+
*/
|
|
806
|
+
getHistory(chatId: ID, params?: GetHistoryParams): Promise<Message[]>;
|
|
807
|
+
/**
|
|
808
|
+
* Set a chat's available reactions. User-only.
|
|
809
|
+
*
|
|
810
|
+
* @method ch
|
|
811
|
+
* @param chatId The identifier of a chat.
|
|
812
|
+
* @param availableReactions The new available reactions.
|
|
813
|
+
*/
|
|
814
|
+
setAvailableReactions(chatId: ID, availableReactions: "none" | "all" | Reaction[]): Promise<void>;
|
|
815
|
+
/**
|
|
816
|
+
* Set a chat's photo.
|
|
817
|
+
*
|
|
818
|
+
* @method ch
|
|
819
|
+
* @param chatId The identifier of a chat.
|
|
820
|
+
* @param photo A photo to set as the chat's photo.
|
|
821
|
+
*/
|
|
822
|
+
setChatPhoto(chatId: ID, photo: FileSource, params: SetChatPhotoParams): Promise<void>;
|
|
823
|
+
/**
|
|
824
|
+
* Delete a chat's photo.
|
|
825
|
+
*
|
|
826
|
+
* @method ch
|
|
827
|
+
* @param chatId The identifier of a chat.
|
|
828
|
+
*/
|
|
829
|
+
deleteChatPhoto(chatId: ID): Promise<void>;
|
|
830
|
+
/**
|
|
831
|
+
* Ban a member from a chat.
|
|
832
|
+
*
|
|
833
|
+
* @method ch
|
|
834
|
+
* @param chatId The identifier of a chat.
|
|
835
|
+
* @param memberId The identifier of the member.
|
|
836
|
+
*/
|
|
837
|
+
banChatMember(chatId: ID, memberId: ID, params: BanChatMemberParams): Promise<void>;
|
|
838
|
+
/**
|
|
839
|
+
* Unban a member from a chat.
|
|
840
|
+
*
|
|
841
|
+
* @method ch
|
|
842
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
843
|
+
* @param memberId The identifier of the member.
|
|
844
|
+
*/
|
|
845
|
+
unbanChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
846
|
+
/**
|
|
847
|
+
* Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
|
|
848
|
+
*
|
|
849
|
+
* @method ch
|
|
850
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
851
|
+
* @param memberId The identifier of the member.
|
|
852
|
+
*/
|
|
853
|
+
kickChatMember(chatId: ID, memberId: ID): Promise<void>;
|
|
854
|
+
/**
|
|
855
|
+
* Set the rights of a chat member.
|
|
856
|
+
*
|
|
857
|
+
* @method ch
|
|
858
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
859
|
+
* @param memberId The identifier of the member.
|
|
860
|
+
*/
|
|
861
|
+
setChatMemberRights(chatId: ID, memberId: ID, params: SetChatMemberRightsParams): Promise<void>;
|
|
862
|
+
/**
|
|
863
|
+
* Get the administrators of a chat.
|
|
864
|
+
*
|
|
865
|
+
* @method ch
|
|
866
|
+
* @param chatId The identifier of a chat.
|
|
867
|
+
* @returns The chat's administrators.
|
|
868
|
+
*/
|
|
869
|
+
getChatAdministrators(chatId: ID): Promise<ChatMember[]>;
|
|
870
|
+
/**
|
|
871
|
+
* Enable join requests in a chat. User-only.
|
|
872
|
+
*
|
|
873
|
+
* @method ch
|
|
874
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
875
|
+
*/
|
|
876
|
+
enableJoinRequests(chatId: ID): Promise<void>;
|
|
877
|
+
/**
|
|
878
|
+
* Disable join requests in a chat. User-only.
|
|
879
|
+
*
|
|
880
|
+
* @method ch
|
|
881
|
+
* @param chatId The identifier of a chat. Must be a channel or a supergroup.
|
|
882
|
+
*/
|
|
883
|
+
disableJoinRequests(chatId: ID): Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Get inactive chats. User-only.
|
|
886
|
+
*
|
|
887
|
+
* @method ch
|
|
888
|
+
* @retuns A list of inactive chats the current user is member of.
|
|
889
|
+
*/
|
|
890
|
+
getInactiveChats(): Promise<InactiveChat[]>;
|
|
891
|
+
/**
|
|
892
|
+
* Get the invite links created for a chat. User-only.
|
|
893
|
+
*
|
|
894
|
+
* @method ch
|
|
895
|
+
* @param chatId The identifier of a chat.
|
|
896
|
+
* @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.
|
|
897
|
+
*/
|
|
898
|
+
getCreatedInviteLinks(chatId: ID, params?: GetCreatedInviteLinksParams): Promise<InviteLink[]>;
|
|
899
|
+
/**
|
|
900
|
+
* Join a chat. User-only.
|
|
901
|
+
*
|
|
902
|
+
* @method ch
|
|
903
|
+
* @param chatId The identifier of a chat.
|
|
904
|
+
*/
|
|
905
|
+
joinChat(chatId: ID): Promise<void>;
|
|
906
|
+
/**
|
|
907
|
+
* Leave a chat.
|
|
908
|
+
*
|
|
909
|
+
* @method ch
|
|
910
|
+
* @param chatId The identifier of a chat.
|
|
911
|
+
*/
|
|
912
|
+
leaveChat(chatId: ID): Promise<void>;
|
|
913
|
+
/**
|
|
914
|
+
* Get information on a user's chat membership.
|
|
915
|
+
*
|
|
916
|
+
* @method ch
|
|
917
|
+
* @param chatId The identifier of a chat.
|
|
918
|
+
* @param userId The identifier of the user.
|
|
919
|
+
*/
|
|
920
|
+
getChatMember(chatId: ID, userId: ID): Promise<ChatMember>;
|
|
921
|
+
/**
|
|
922
|
+
* Get the members of a chat.
|
|
923
|
+
*
|
|
924
|
+
* @method ch
|
|
925
|
+
* @param chatId The identifier of a chat.
|
|
926
|
+
*/
|
|
927
|
+
getChatMembers(chatId: ID, params?: GetChatMembersParams): Promise<ChatMember[]>;
|
|
928
|
+
/**
|
|
929
|
+
* Set a chat's sticker set.
|
|
930
|
+
*
|
|
931
|
+
* @method ch
|
|
932
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
933
|
+
* @param setName The name of the set.
|
|
934
|
+
*/
|
|
935
|
+
setChatStickerSet(chatId: ID, setName: string): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Delete a chat's sticker set.
|
|
938
|
+
*
|
|
939
|
+
* @method ch
|
|
940
|
+
* @param chatId The identifier of a chat. Must be a supergroup.
|
|
941
|
+
*/
|
|
942
|
+
deleteChatStickerSet(chatId: ID): Promise<void>;
|
|
943
|
+
/**
|
|
944
|
+
* Set the number of boosts required to circument a chat's default restrictions. User-only.
|
|
945
|
+
*
|
|
946
|
+
* @method ch
|
|
947
|
+
* @param chatId The identifier of a chat.
|
|
948
|
+
* @param boosts The number of boosts required to circumvent its restrictions.
|
|
949
|
+
*/
|
|
950
|
+
setBoostsRequiredToCircumventRestrictions(chatId: ID, boosts: number): Promise<void>;
|
|
951
|
+
/**
|
|
952
|
+
* Create an invite link.
|
|
953
|
+
*
|
|
954
|
+
* @method ch
|
|
955
|
+
* @param chatId The identifier of a chat to create the invite link for.
|
|
956
|
+
* @returns The newly created invite link.
|
|
957
|
+
*/
|
|
958
|
+
createInviteLink(chatId: ID, params?: CreateInviteLinkParams): Promise<InviteLink>;
|
|
959
|
+
/**
|
|
960
|
+
* Approve a join request.
|
|
961
|
+
*
|
|
962
|
+
* @method ch
|
|
963
|
+
* @param chatId The identifier of a chat with the join request.
|
|
964
|
+
* @param userId The user who made the join request.
|
|
965
|
+
*/
|
|
966
|
+
approveJoinRequest(chatId: ID, userId: ID): Promise<void>;
|
|
967
|
+
/**
|
|
968
|
+
* Decline a join request.
|
|
969
|
+
*
|
|
970
|
+
* @method ch
|
|
971
|
+
* @param chatId The identifier of a chat with the join request.
|
|
972
|
+
* @param userId The user who made the join request.
|
|
973
|
+
*/
|
|
974
|
+
declineJoinRequest(chatId: ID, userId: ID): Promise<void>;
|
|
975
|
+
/**
|
|
976
|
+
* Approve all join requests. User-only.
|
|
977
|
+
*
|
|
978
|
+
* @method ch
|
|
979
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
980
|
+
*/
|
|
981
|
+
approveJoinRequests(chatId: ID, params?: ApproveJoinRequestsParams): Promise<void>;
|
|
982
|
+
/**
|
|
983
|
+
* Decline all join requests. User-only.
|
|
984
|
+
*
|
|
985
|
+
* @method ch
|
|
986
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
987
|
+
*/
|
|
988
|
+
declineJoinRequests(chatId: ID, params?: DeclineJoinRequestsParams): Promise<void>;
|
|
989
|
+
/**
|
|
990
|
+
* Get pending join requests in a chat. User-only.
|
|
991
|
+
*
|
|
992
|
+
* @method ch
|
|
993
|
+
* @param chatId The identifier of a chat with the join requests.
|
|
994
|
+
*/
|
|
995
|
+
getJoinRequests(chatId: ID, params?: GetJoinRequestsParams): Promise<JoinRequest[]>;
|
|
996
|
+
/**
|
|
997
|
+
* Add a single user to a chat.
|
|
998
|
+
*
|
|
999
|
+
* @method ch
|
|
1000
|
+
* @param chatId The identifier of a chat to add the user to.
|
|
1001
|
+
* @param userId The identifier of the user to add to the chat.
|
|
1002
|
+
* @returns An array of FailedInvitation that has at most a length of 1. If empty, it means that the user was added.
|
|
1003
|
+
*/
|
|
1004
|
+
addChatMember(chatId: ID, userId: ID, params?: AddChatMemberParams): Promise<FailedInvitation[]>;
|
|
1005
|
+
/**
|
|
1006
|
+
* Add multiple users at once to a channel or a supergroup.
|
|
1007
|
+
*
|
|
1008
|
+
* @method ch
|
|
1009
|
+
* @param chatId The identifier of the channel or supergroup to add the users to.
|
|
1010
|
+
* @param userId The identifiers of the users to add to the channel or supergroup.
|
|
1011
|
+
* @returns An array of FailedInvitation that has at most a length that is the same as that of the parameter userIds. If empty, it means that all the provided users were added.
|
|
1012
|
+
*/
|
|
1013
|
+
addChatMembers(chatId: ID, userIds: ID[]): Promise<FailedInvitation[]>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Open a chat.
|
|
1016
|
+
*
|
|
1017
|
+
* @method ch
|
|
1018
|
+
* @param chatId The identifier of a chat to open.
|
|
1019
|
+
*/
|
|
1020
|
+
openChat(chatId: ID, params?: OpenChatParams): Promise<void>;
|
|
1021
|
+
/**
|
|
1022
|
+
* Close a chat previously opened by openChat.
|
|
1023
|
+
*
|
|
1024
|
+
* @method ch
|
|
1025
|
+
* @param chatId The identifier of a chat to close.
|
|
1026
|
+
*/
|
|
1027
|
+
closeChat(chatId: ID): Promise<void>;
|
|
1028
|
+
/**
|
|
1029
|
+
* Create a group. User-only.
|
|
1030
|
+
*
|
|
1031
|
+
* @method ch
|
|
1032
|
+
* @param title The title of the group.
|
|
1033
|
+
* @returns The created group.
|
|
1034
|
+
*/
|
|
1035
|
+
createGroup(title: string, params?: CreateGroupParams): Promise<ChatPGroup>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Create a supergroup. User-only.
|
|
1038
|
+
*
|
|
1039
|
+
* @method ch
|
|
1040
|
+
* @param title The title of the supergroup.
|
|
1041
|
+
* @returns The created supergroup.
|
|
1042
|
+
*/
|
|
1043
|
+
createSupergroup(title: string, params?: CreateSupergroupParams): Promise<ChatPSupergroup>;
|
|
1044
|
+
/**
|
|
1045
|
+
* Create a channel. User-only.
|
|
1046
|
+
*
|
|
1047
|
+
* @method ch
|
|
1048
|
+
* @param title The title of the channel.
|
|
1049
|
+
* @returns The created channel.
|
|
1050
|
+
*/
|
|
1051
|
+
createChannel(title: string, params?: CreateChannelParams): Promise<ChatPChannel>;
|
|
1052
|
+
/**
|
|
1053
|
+
* Set the time to live of the messages of a chat. User-only.
|
|
1054
|
+
*
|
|
1055
|
+
* @method ch
|
|
1056
|
+
* @param chatId The identifier of a chat.
|
|
1057
|
+
* @param messageTtl The time to live of the messages in seconds.
|
|
1058
|
+
*/
|
|
1059
|
+
setMessageTtl(chatId: ID, messageTtl: number): Promise<void>;
|
|
1060
|
+
/**
|
|
1061
|
+
* Archive multiple chats. User-only.
|
|
1062
|
+
*
|
|
1063
|
+
* @method ch
|
|
1064
|
+
* @param chatIds The identifiers of the chats to archive.
|
|
1065
|
+
*/
|
|
1066
|
+
archiveChats(chatIds: ID[]): Promise<void>;
|
|
1067
|
+
/**
|
|
1068
|
+
* Archive a single chat. User-only.
|
|
1069
|
+
*
|
|
1070
|
+
* @method ch
|
|
1071
|
+
* @param chatId The identifier of a chat.
|
|
1072
|
+
*/
|
|
1073
|
+
archiveChat(chatId: ID): Promise<void>;
|
|
1074
|
+
/**
|
|
1075
|
+
* Unarchive multiple chats. User-only.
|
|
1076
|
+
*
|
|
1077
|
+
* @method ch
|
|
1078
|
+
* @param chatIds The identifiers of the chats to unarchive.
|
|
1079
|
+
*/
|
|
1080
|
+
unarchiveChats(chatIds: ID[]): Promise<void>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Unarchive a single chat. User-only.
|
|
1083
|
+
*
|
|
1084
|
+
* @method ch
|
|
1085
|
+
* @param chatId The identifier of a chat.
|
|
1086
|
+
*/
|
|
1087
|
+
unarchiveChat(chatId: ID): Promise<void>;
|
|
1088
|
+
/**
|
|
1089
|
+
* Get common chats between a user and the current one. User-only.
|
|
1090
|
+
*
|
|
1091
|
+
* @method ch
|
|
1092
|
+
* @param userId The identifier of the user to get the common chats with them.
|
|
1093
|
+
*/
|
|
1094
|
+
getCommonChats(userId: ID, params?: GetCommonChatsParams): Promise<ChatP[]>;
|
|
1095
|
+
/**
|
|
1096
|
+
* Get the settings of a chat. User-only.
|
|
1097
|
+
*
|
|
1098
|
+
* @method ch
|
|
1099
|
+
* @param chatId The identifier of a chat.
|
|
1100
|
+
*/
|
|
1101
|
+
getChatSettings(chatId: ID): Promise<ChatSettings>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Disable business bots in a private chat. User-only.
|
|
1104
|
+
*
|
|
1105
|
+
* @method ch
|
|
1106
|
+
* @param chatId The identifier of the private chat to disable business bots in.
|
|
1107
|
+
*/
|
|
1108
|
+
disableBusinessBots(chatId: ID): Promise<void>;
|
|
1109
|
+
/**
|
|
1110
|
+
* Enable business bots in a private chat. User-only.
|
|
1111
|
+
*
|
|
1112
|
+
* @method ch
|
|
1113
|
+
* @param chatId The identifier of the private chat to enable business bots in.
|
|
1114
|
+
*/
|
|
1115
|
+
enableBusinessBots(chatId: ID): Promise<void>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Disable slow mode in a group. User-only.
|
|
1118
|
+
*
|
|
1119
|
+
* @method ch
|
|
1120
|
+
* @param chatId The identifier of the group to disable slow mode in.
|
|
1121
|
+
*/
|
|
1122
|
+
disableSlowMode(chatId: ID): Promise<void>;
|
|
1123
|
+
/**
|
|
1124
|
+
* Change slow mode in a group. User-only.
|
|
1125
|
+
*
|
|
1126
|
+
* @method ch
|
|
1127
|
+
* @param chatId The identifier of the group to change slow mode in.
|
|
1128
|
+
* @param duration New slow mode duration.
|
|
1129
|
+
*/
|
|
1130
|
+
setSlowMode(chatId: ID, duration: SlowModeDuration): Promise<void>;
|
|
1131
|
+
/**
|
|
1132
|
+
* Change the title of a chat.
|
|
1133
|
+
*
|
|
1134
|
+
* @method ch
|
|
1135
|
+
* @param chatId The identifier of a chat.
|
|
1136
|
+
* @param title The new title.
|
|
1137
|
+
*/
|
|
1138
|
+
setChatTitle(chatId: ID, title: string): Promise<void>;
|
|
1139
|
+
/**
|
|
1140
|
+
* Change the description of a chat.
|
|
1141
|
+
*
|
|
1142
|
+
* @method ch
|
|
1143
|
+
* @param chatId The identifier of a chat.
|
|
1144
|
+
* @param description The new description.
|
|
1145
|
+
*/
|
|
1146
|
+
setChatDescription(chatId: ID, description: string): Promise<void>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Hide or show the member list of a group to non-admins. User-only.
|
|
1149
|
+
*
|
|
1150
|
+
* @method ch
|
|
1151
|
+
* @param chatId The identifier of the group.
|
|
1152
|
+
* @param visible Whether the member list of the group should be visible.
|
|
1153
|
+
*/
|
|
1154
|
+
setMemberListVisibility(chatId: ID, visible: boolean): Promise<void>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Enable or disable topics in a group. User-only.
|
|
1157
|
+
*
|
|
1158
|
+
* @method ch
|
|
1159
|
+
* @param chatId The identifier of the group.
|
|
1160
|
+
* @param enabled Whether topics should be enabled in the group.
|
|
1161
|
+
* @param tabs Whether topics should be displayed as tabs.
|
|
1162
|
+
*/
|
|
1163
|
+
setTopicsEnabled(chatId: ID, enabled: boolean, tabs: boolean): Promise<void>;
|
|
1164
|
+
/**
|
|
1165
|
+
* Enable or disable automatic anti-spam in a group. User-only.
|
|
1166
|
+
*
|
|
1167
|
+
* @method ch
|
|
1168
|
+
* @param chatId The identifier of the group.
|
|
1169
|
+
* @param enabled Whether automatic anti-spam should be enabled in the group.
|
|
1170
|
+
*/
|
|
1171
|
+
setAntispamEnabled(chatId: ID, enabled: boolean): Promise<void>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Enable or disable post signatures in a channel. User-only.
|
|
1174
|
+
*
|
|
1175
|
+
* @method ch
|
|
1176
|
+
* @param chatId The identifier of the channel.
|
|
1177
|
+
* @param enabled Whether post signatures should be enabled in the channel.
|
|
1178
|
+
*/
|
|
1179
|
+
setSignaturesEnabled(chatId: ID, enabled: boolean, params: SetSignaturesEnabledParams): Promise<void>;
|
|
1180
|
+
/**
|
|
1181
|
+
* Delete a chat. User-only.
|
|
1182
|
+
*
|
|
1183
|
+
* @method ch
|
|
1184
|
+
* @param chatId The identifier of a chat.
|
|
1185
|
+
*/
|
|
1186
|
+
deleteChat(chatId: ID): Promise<void>;
|
|
1187
|
+
/**
|
|
1188
|
+
* Get discussion chat suggestions. User-only.
|
|
1189
|
+
*
|
|
1190
|
+
* @method ch
|
|
1191
|
+
*/
|
|
1192
|
+
getDiscussionChatSuggestions(): Promise<ChatP[]>;
|
|
1193
|
+
/**
|
|
1194
|
+
* Set a channel's discussion chat. User-only.
|
|
1195
|
+
*
|
|
1196
|
+
* @method ch
|
|
1197
|
+
* @param chatId The identifier of a channel.
|
|
1198
|
+
* @param discussionChatId The identifier of a chat to use as discussion for the channel.
|
|
1199
|
+
*/
|
|
1200
|
+
setDiscussionChat(chatId: ID, discussionChatId: ID): Promise<void>;
|
|
1201
|
+
/**
|
|
1202
|
+
* Transfer the ownership of a chat. User-only.
|
|
1203
|
+
*
|
|
1204
|
+
* @method ch
|
|
1205
|
+
* @param chatId The identifier of a chat.
|
|
1206
|
+
* @param userId The identifier of the new owner.
|
|
1207
|
+
* @param password The password of the current account.
|
|
1208
|
+
*/
|
|
1209
|
+
transferChatOwnership(chatId: ID, userId: ID, password: string): Promise<void>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Create a forum topic.
|
|
1212
|
+
*
|
|
1213
|
+
* @method ch
|
|
1214
|
+
* @param chatId The identifier of a chat.
|
|
1215
|
+
* @param title The title of the topic.
|
|
1216
|
+
* @returns The created topic.
|
|
1217
|
+
*/
|
|
1218
|
+
createTopic(chatId: ID, title: string, params: CreateTopicParams): Promise<Topic>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Edit a forum topic.
|
|
1221
|
+
*
|
|
1222
|
+
* @method ch
|
|
1223
|
+
* @param chatId The identifier of a chat.
|
|
1224
|
+
* @param topicId The identifier of the topic.
|
|
1225
|
+
* @param title The new title of the topic.
|
|
1226
|
+
* @returns The new topic.
|
|
1227
|
+
*/
|
|
1228
|
+
editTopic(chatId: ID, topicId: number, title: string, params?: EditTopicParams): Promise<Topic>;
|
|
1229
|
+
/**
|
|
1230
|
+
* Hide the general forum topic.
|
|
1231
|
+
*
|
|
1232
|
+
* @method ch
|
|
1233
|
+
* @param chatId The identifier of a chat.
|
|
1234
|
+
*/
|
|
1235
|
+
hideGeneralTopic(chatId: ID): Promise<void>;
|
|
1236
|
+
/**
|
|
1237
|
+
* Show the general forum topic.
|
|
1238
|
+
*
|
|
1239
|
+
* @method ch
|
|
1240
|
+
* @param chatId The identifier of a chat.
|
|
1241
|
+
*/
|
|
1242
|
+
showGeneralTopic(chatId: ID): Promise<void>;
|
|
1243
|
+
/**
|
|
1244
|
+
* Close a forum topic.
|
|
1245
|
+
*
|
|
1246
|
+
* @method ch
|
|
1247
|
+
* @param chatId The identifier of a chat.
|
|
1248
|
+
* @param topicId The identifier of the topic.
|
|
1249
|
+
*/
|
|
1250
|
+
closeTopic(chatId: ID, topicId: number): Promise<void>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Reopen a forum topic.
|
|
1253
|
+
*
|
|
1254
|
+
* @method ch
|
|
1255
|
+
* @param chatId The identifier of a chat.
|
|
1256
|
+
* @param topicId The identifier of the topic.
|
|
1257
|
+
*/
|
|
1258
|
+
reopenTopic(chatId: ID, topicId: number): Promise<void>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Pin a forum topic.
|
|
1261
|
+
*
|
|
1262
|
+
* @method ch
|
|
1263
|
+
* @param chatId The identifier of a chat.
|
|
1264
|
+
* @param topicId The identifier of the topic.
|
|
1265
|
+
*/
|
|
1266
|
+
pinTopic(chatId: ID, topicId: number): Promise<void>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Unpin a forum topic.
|
|
1269
|
+
*
|
|
1270
|
+
* @method ch
|
|
1271
|
+
* @param chatId The identifier of a chat.
|
|
1272
|
+
* @param topicId The identifier of the topic.
|
|
1273
|
+
*/
|
|
1274
|
+
unpinTopic(chatId: ID, topicId: number): Promise<void>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Promote a chat member.
|
|
1277
|
+
*
|
|
1278
|
+
* @method ch
|
|
1279
|
+
* @param chatId The identifier of a chat.
|
|
1280
|
+
* @param userId The identifier of the user to promote.
|
|
1281
|
+
*/
|
|
1282
|
+
promoteChatMember(chatId: ID, userId: ID, params: PromoteChatMemberParams): Promise<void>;
|
|
1283
|
+
/**
|
|
1284
|
+
* Send a callback query. User-only.
|
|
1285
|
+
*
|
|
1286
|
+
* @method cq
|
|
1287
|
+
* @param botId The identifier of the bot to send the callback query to.
|
|
1288
|
+
* @param messageId The identifier of the message that includes at a button responsible for the callback query question.
|
|
1289
|
+
* @param question The callback query's question.
|
|
1290
|
+
* @returns The bot's answer to the callback query.
|
|
1291
|
+
* @cache
|
|
1292
|
+
*/
|
|
1293
|
+
sendCallbackQuery(botId: ID, messageId: number, question: CallbackQueryQuestion): Promise<CallbackQueryAnswer>;
|
|
1294
|
+
/**
|
|
1295
|
+
* Answer a callback query. Bot-only.
|
|
1296
|
+
*
|
|
1297
|
+
* @method cq
|
|
1298
|
+
* @param id ID of the callback query to answer.
|
|
1299
|
+
*/
|
|
1300
|
+
answerCallbackQuery(id: string, params?: AnswerCallbackQueryParams): Promise<void>;
|
|
1301
|
+
/**
|
|
1302
|
+
* Send an inline query. User-only.
|
|
1303
|
+
*
|
|
1304
|
+
* @method iq
|
|
1305
|
+
* @param botId The identifier of a bot to send the inline query to.
|
|
1306
|
+
* @param chatId The identifier of the chat from which the inline query is sent.
|
|
1307
|
+
* @returns The bot's answer to the inline query.
|
|
1308
|
+
* @cache
|
|
1309
|
+
*/
|
|
1310
|
+
sendInlineQuery(botId: ID, chatId: ID, params: SendInlineQueryParams): Promise<InlineQueryAnswer>;
|
|
1311
|
+
/**
|
|
1312
|
+
* Answer an inline query. Bot-only.
|
|
1313
|
+
*
|
|
1314
|
+
* @method iq
|
|
1315
|
+
* @param id The identifier of the inline query to answer.
|
|
1316
|
+
* @param results The results to answer with.
|
|
1317
|
+
*/
|
|
1318
|
+
answerInlineQuery(id: string, results: InlineQueryResult[], params?: AnswerInlineQueryParams): Promise<void>;
|
|
1319
|
+
/**
|
|
1320
|
+
* Set the bot's description in the given language. Bot-only.
|
|
1321
|
+
*
|
|
1322
|
+
* @method bs
|
|
1323
|
+
*/
|
|
1324
|
+
setMyDescription(params?: {
|
|
1325
|
+
description?: string;
|
|
1326
|
+
languageCode?: string;
|
|
1327
|
+
}): Promise<void>;
|
|
1328
|
+
/**
|
|
1329
|
+
* Set the bot's name in the given language. Bot-only.
|
|
1330
|
+
*
|
|
1331
|
+
* @method bs
|
|
1332
|
+
*/
|
|
1333
|
+
setMyName(params?: {
|
|
1334
|
+
name?: string;
|
|
1335
|
+
languageCode?: string;
|
|
1336
|
+
}): Promise<void>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Set the bot's short description in the given language. Bot-only.
|
|
1339
|
+
*
|
|
1340
|
+
* @method bs
|
|
1341
|
+
*/
|
|
1342
|
+
setMyShortDescription(params?: {
|
|
1343
|
+
shortDescription?: string;
|
|
1344
|
+
languageCode?: string;
|
|
1345
|
+
}): Promise<void>;
|
|
1346
|
+
/**
|
|
1347
|
+
* Get the bot's description in the given language. Bot-only.
|
|
1348
|
+
*
|
|
1349
|
+
* @method bs
|
|
1350
|
+
* @returns The current bot's description in the specified language.
|
|
1351
|
+
*/
|
|
1352
|
+
getMyDescription(params?: {
|
|
1353
|
+
languageCode?: string;
|
|
1354
|
+
}): Promise<string>;
|
|
1355
|
+
/**
|
|
1356
|
+
* Get the bot's name in the given language. Bot-only.
|
|
1357
|
+
*
|
|
1358
|
+
* @method bs
|
|
1359
|
+
* @returns The current bot's name in the specified language.
|
|
1360
|
+
*/
|
|
1361
|
+
getMyName(params?: {
|
|
1362
|
+
languageCode?: string;
|
|
1363
|
+
}): Promise<string>;
|
|
1364
|
+
/**
|
|
1365
|
+
* Get the bot's short description in the given language. Bot-only.
|
|
1366
|
+
*
|
|
1367
|
+
* @method bs
|
|
1368
|
+
* @returns The current bot's short description in the specified language.
|
|
1369
|
+
*/
|
|
1370
|
+
getMyShortDescription(params?: {
|
|
1371
|
+
languageCode?: string;
|
|
1372
|
+
}): Promise<string>;
|
|
1373
|
+
/**
|
|
1374
|
+
* Set the bot's commands in the given scope and/or language. Bot-only.
|
|
1375
|
+
*
|
|
1376
|
+
* @method bs
|
|
1377
|
+
* @param commands The commands to set.
|
|
1378
|
+
*/
|
|
1379
|
+
setMyCommands(commands: BotCommand[], params?: SetMyCommandsParams): Promise<void>;
|
|
1380
|
+
/**
|
|
1381
|
+
* Get the bot's commands in the given scope and/or language. Bot-only.
|
|
1382
|
+
*
|
|
1383
|
+
* @method bs
|
|
1384
|
+
* @returns The current bot's commands in the specified language.
|
|
1385
|
+
*/
|
|
1386
|
+
getMyCommands(params?: GetMyCommandsParams): Promise<BotCommand[]>;
|
|
1387
|
+
/**
|
|
1388
|
+
* Change reactions made to a message.
|
|
1389
|
+
*
|
|
1390
|
+
* @method re
|
|
1391
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1392
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
1393
|
+
* @param reactions The new reactions.
|
|
1394
|
+
*/
|
|
1395
|
+
setReactions(chatId: ID, messageId: number, reactions: Reaction[], params?: SetReactionsParams): Promise<void>;
|
|
1396
|
+
/**
|
|
1397
|
+
* Make a reaction to a message.
|
|
1398
|
+
*
|
|
1399
|
+
* @method re
|
|
1400
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1401
|
+
* @param messageId The identifier of the message to add the reaction to.
|
|
1402
|
+
* @param reaction The reaction to add.
|
|
1403
|
+
*/
|
|
1404
|
+
addReaction(chatId: ID, messageId: number, reaction: Reaction, params?: AddReactionParams): Promise<void>;
|
|
1405
|
+
/**
|
|
1406
|
+
* Undo a reaction made to a message.
|
|
1407
|
+
*
|
|
1408
|
+
* @method re
|
|
1409
|
+
* @param chatId The identifier of the chat which the message belongs to.
|
|
1410
|
+
* @param messageId The identifier of the message which the reaction was made to.
|
|
1411
|
+
* @param reaction The reaction to remove.
|
|
1412
|
+
*/
|
|
1413
|
+
removeReaction(chatId: ID, messageId: number, reaction: Reaction): Promise<void>;
|
|
1414
|
+
/**
|
|
1415
|
+
* Create a story. User-only.
|
|
1416
|
+
*
|
|
1417
|
+
* @method st
|
|
1418
|
+
* @param content The content of the story.
|
|
1419
|
+
* @returns The created story.
|
|
1420
|
+
*/
|
|
1421
|
+
createStory(chatId: ID, content: InputStoryContent, params: CreateStoryParams): Promise<Story>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Retrieve multiple stories. User-only.
|
|
1424
|
+
*
|
|
1425
|
+
* @method st
|
|
1426
|
+
* @param chatId The identifier of a chat.
|
|
1427
|
+
* @param storyIds The identifiers of the stories to retrieve.
|
|
1428
|
+
* @returns The retrieved stories.
|
|
1429
|
+
*/
|
|
1430
|
+
getStories(chatId: ID, storyIds: number[]): Promise<Story[]>;
|
|
1431
|
+
/**
|
|
1432
|
+
* Retrieve a single story. User-only.
|
|
1433
|
+
*
|
|
1434
|
+
* @method st
|
|
1435
|
+
* @param chatId The identifier of a chat.
|
|
1436
|
+
* @param storyId The identifier of the story to retrieve.
|
|
1437
|
+
* @returns The retrieved story.
|
|
1438
|
+
*/
|
|
1439
|
+
getStory(chatId: ID, storyId: number): Promise<Story | null>;
|
|
1440
|
+
/**
|
|
1441
|
+
* Delete multiple stories. User-only.
|
|
1442
|
+
*
|
|
1443
|
+
* @method st
|
|
1444
|
+
* @param chatId The identifier of a chat.
|
|
1445
|
+
* @param storyIds The identifiers of the stories to delete.
|
|
1446
|
+
*/
|
|
1447
|
+
deleteStories(chatId: ID, storyIds: number[]): Promise<void>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Delete a single story. User-only.
|
|
1450
|
+
*
|
|
1451
|
+
* @method st
|
|
1452
|
+
* @param chatId The identifier of a chat.
|
|
1453
|
+
* @param storyId The identifier of the story to delete.
|
|
1454
|
+
*/
|
|
1455
|
+
deleteStory(chatId: ID, storyId: number): Promise<void>;
|
|
1456
|
+
/**
|
|
1457
|
+
* Add multiple stories to highlights. User-only.
|
|
1458
|
+
*
|
|
1459
|
+
* @method st
|
|
1460
|
+
* @param chatId The identifier of a chat.
|
|
1461
|
+
* @param storyIds The identifiers of the stories to add to highlights.
|
|
1462
|
+
*/
|
|
1463
|
+
addStoriesToHighlights(chatId: ID, storyIds: number[]): Promise<void>;
|
|
1464
|
+
/**
|
|
1465
|
+
* Add a single story to highlights. User-only.
|
|
1466
|
+
*
|
|
1467
|
+
* @method st
|
|
1468
|
+
* @param chatId The identifier of a chat.
|
|
1469
|
+
* @param storyId The identifier of the story to add to highlights.
|
|
1470
|
+
*/
|
|
1471
|
+
addStoryToHighlights(chatId: ID, storyId: number): Promise<void>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Remove multiple stories from highlights. User-only.
|
|
1474
|
+
*
|
|
1475
|
+
* @method st
|
|
1476
|
+
* @param chatId The identifier of a chat.
|
|
1477
|
+
* @param storyIds The identifiers of the stories to remove from highlights.
|
|
1478
|
+
*/
|
|
1479
|
+
removeStoriesFromHighlights(chatId: ID, storyIds: number[]): Promise<void>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Remove a single story from highlights. User-only.
|
|
1482
|
+
*
|
|
1483
|
+
* @method st
|
|
1484
|
+
* @param chatId The identifier of a chat.
|
|
1485
|
+
* @param storyId The identifier of the story to remove from highlights.
|
|
1486
|
+
*/
|
|
1487
|
+
removeStoryFromHighlights(chatId: ID, storyId: number): Promise<void>;
|
|
1488
|
+
/**
|
|
1489
|
+
* Get network statistics. This might not always be available.
|
|
1490
|
+
*
|
|
1491
|
+
* @method mc
|
|
1492
|
+
*/
|
|
1493
|
+
getNetworkStatistics(): Promise<NetworkStatistics>;
|
|
1494
|
+
/**
|
|
1495
|
+
* Block a user. User-only.
|
|
1496
|
+
*
|
|
1497
|
+
* @method mc
|
|
1498
|
+
* @param userId The identifier of the user to block.
|
|
1499
|
+
*/
|
|
1500
|
+
blockUser(userId: ID): Promise<void>;
|
|
1501
|
+
/**
|
|
1502
|
+
* Unblock a user. User-only.
|
|
1503
|
+
*
|
|
1504
|
+
* @method mc
|
|
1505
|
+
* @param userId The identifier of the user to unblock.
|
|
1506
|
+
*/
|
|
1507
|
+
unblockUser(userId: ID): Promise<void>;
|
|
1508
|
+
/**
|
|
1509
|
+
* Start a video chat. User-only.
|
|
1510
|
+
*
|
|
1511
|
+
* @method vc
|
|
1512
|
+
* @param chatId The identifier of a chat to start the video chat in.
|
|
1513
|
+
* @returns The started video chat.
|
|
1514
|
+
*/
|
|
1515
|
+
startVideoChat(chatId: ID, params?: StartVideoChatParams): Promise<VideoChatActive>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Schedule a video chat. User-only.
|
|
1518
|
+
*
|
|
1519
|
+
* @method vc
|
|
1520
|
+
* @param chatId The identifier of a chat to schedule the video chat in.
|
|
1521
|
+
* @param startAt A point in time within the future in which the video chat will be started.
|
|
1522
|
+
* @returns The scheduled video chat.
|
|
1523
|
+
*/
|
|
1524
|
+
scheduleVideoChat(chatId: ID, startAt: number, params: ScheduleVideoChatParams): Promise<VideoChatScheduled>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Join a video chat. User-only.
|
|
1527
|
+
*
|
|
1528
|
+
* @method vc
|
|
1529
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1530
|
+
* @param params_ WebRTC connection parameters.
|
|
1531
|
+
* @returns Parameters to be passed to the used WebRTC library.
|
|
1532
|
+
*/
|
|
1533
|
+
joinVideoChat(id: string, params_: string, params: JoinVideoChatParams): Promise<string>;
|
|
1534
|
+
/**
|
|
1535
|
+
* Leave a video chat. User-only.
|
|
1536
|
+
*
|
|
1537
|
+
* @method vc
|
|
1538
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1539
|
+
*/
|
|
1540
|
+
leaveVideoChat(id: string): Promise<void>;
|
|
1541
|
+
/**
|
|
1542
|
+
* Join a live stream. User-only.
|
|
1543
|
+
*
|
|
1544
|
+
* @method vc
|
|
1545
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1546
|
+
*/
|
|
1547
|
+
joinLiveStream(id: string): Promise<void>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Get a video chat. User-only.
|
|
1550
|
+
*
|
|
1551
|
+
* @method vc
|
|
1552
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1553
|
+
* @cache
|
|
1554
|
+
*/
|
|
1555
|
+
getVideoChat(id: string): Promise<VideoChat>;
|
|
1556
|
+
/**
|
|
1557
|
+
* Get live stream channels. User-only.
|
|
1558
|
+
*
|
|
1559
|
+
* @method vc
|
|
1560
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1561
|
+
*/
|
|
1562
|
+
getLiveStreamChannels(id: string): Promise<LiveStreamChannel[]>;
|
|
1563
|
+
/**
|
|
1564
|
+
* Download a live stream segment. User-only.
|
|
1565
|
+
*
|
|
1566
|
+
* @method vc
|
|
1567
|
+
* @param id The identifier of a video chat retrieved from getChat, startVideoChat, or scheduleVideoChat.
|
|
1568
|
+
* @param channelId Stream channel ID.
|
|
1569
|
+
* @param scale Stream channel scale.
|
|
1570
|
+
* @param timestamp Millisecond timestamp of the chunk to download.
|
|
1571
|
+
*/
|
|
1572
|
+
downloadLiveStreamSegment(id: string, channelId: number, scale: number, timestamp: number, params?: DownloadLiveStreamSegmentParams): Promise<Uint8Array>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Answer a pre-checkout query. Bot-only.
|
|
1575
|
+
*
|
|
1576
|
+
* @method pa
|
|
1577
|
+
* @param preCheckoutQueryId The identifier of the pre-checkout query.
|
|
1578
|
+
* @param ok Whether the checkout is going to be processed.
|
|
1579
|
+
*/
|
|
1580
|
+
answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, params: AnswerPreCheckoutQueryParams): Promise<void>;
|
|
1581
|
+
/**
|
|
1582
|
+
* Refund a star payment. Bot-only.
|
|
1583
|
+
*
|
|
1584
|
+
* @method pa
|
|
1585
|
+
* @param userId The identifier of the user that was charged.
|
|
1586
|
+
* @param telegramPaymentChargeId The identifier of the charge.
|
|
1587
|
+
*/
|
|
1588
|
+
refundStarPayment(userId: ID, telegramPaymentChargeId: string): Promise<void>;
|
|
1589
|
+
/**
|
|
1590
|
+
* Get contacts. User-only.
|
|
1591
|
+
*
|
|
1592
|
+
* @method co
|
|
1593
|
+
*/
|
|
1594
|
+
getContacts(): Promise<User[]>;
|
|
1595
|
+
/**
|
|
1596
|
+
* Delete multiple contacts. User-only.
|
|
1597
|
+
*
|
|
1598
|
+
* @method co
|
|
1599
|
+
* @param userIds The identifiers of contacts to delete.
|
|
1600
|
+
*/
|
|
1601
|
+
deleteContacts(userIds: ID[]): Promise<void>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Delete a single contact. User-only.
|
|
1604
|
+
*
|
|
1605
|
+
* @method co
|
|
1606
|
+
* @param userId The identifier of the contact to delete.
|
|
1607
|
+
*/
|
|
1608
|
+
deleteContact(userId: ID): Promise<void>;
|
|
1609
|
+
/**
|
|
1610
|
+
* Add a contact. User-only.
|
|
1611
|
+
*
|
|
1612
|
+
* @method co
|
|
1613
|
+
* @param userId The identifier of the user to add as contact.
|
|
1614
|
+
*/
|
|
1615
|
+
addContact(userId: ID, params?: AddContactParams): Promise<void>;
|
|
1616
|
+
/**
|
|
1617
|
+
* Get translations. User-only.
|
|
1618
|
+
*
|
|
1619
|
+
* @method ta
|
|
1620
|
+
* @cache
|
|
1621
|
+
*/
|
|
1622
|
+
getTranslations(params?: GetTranslationsParams): Promise<Translation[]>;
|
|
1623
|
+
/**
|
|
1624
|
+
* Get available gifts.
|
|
1625
|
+
*
|
|
1626
|
+
* @method gf
|
|
1627
|
+
*/
|
|
1628
|
+
getGifts(): Promise<Gift[]>;
|
|
1629
|
+
/**
|
|
1630
|
+
* Get gifts claimed by a user or a channel. User-only.
|
|
1631
|
+
*
|
|
1632
|
+
* @method gf
|
|
1633
|
+
* @param chatId The identifier of a user or a channel to get gifts for.
|
|
1634
|
+
*/
|
|
1635
|
+
getClaimedGifts(chatId: ID, params?: GetClaimedGiftsParams): Promise<ClaimedGifts>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Send a gift.
|
|
1638
|
+
*
|
|
1639
|
+
* @method gf
|
|
1640
|
+
* @param chatId The identifier of a user or a channel to send the gift to.
|
|
1641
|
+
* @param giftId The identifier of the gift to send.
|
|
1642
|
+
*/
|
|
1643
|
+
sendGift(chatId: ID, giftId: string, params: SendGiftParams): Promise<void>;
|
|
1644
|
+
/**
|
|
1645
|
+
* Sell a gift.
|
|
1646
|
+
*
|
|
1647
|
+
* @method gf
|
|
1648
|
+
* @param userId The identifier of the user that sent the gift.
|
|
1649
|
+
* @param messageId The identifier of the service message announcing the receival of the gift.
|
|
1650
|
+
*/
|
|
1651
|
+
sellGift(userId: ID, messageId: number): Promise<void>;
|
|
1652
|
+
/**
|
|
1653
|
+
* Get a gift using its slug.
|
|
1654
|
+
*
|
|
1655
|
+
* @method gf
|
|
1656
|
+
* @param slug The slug of a gift.
|
|
1657
|
+
*/
|
|
1658
|
+
getGift(slug: string): Promise<Gift>;
|
|
1659
|
+
}
|
|
1660
|
+
//# sourceMappingURL=5_client_dispatcher.d.ts.map
|