1 | /// <reference types="node" />
|
2 | import * as tg from './core/types/typegram';
|
3 | import * as tt from './telegram-types';
|
4 | import ApiClient from './core/network/client';
|
5 | import { URL } from 'url';
|
6 | export declare class Telegram extends ApiClient {
|
7 | /**
|
8 | * Get basic information about the bot
|
9 | */
|
10 | getMe(): Promise<tg.UserFromGetMe>;
|
11 | /**
|
12 | * Get basic info about a file and prepare it for downloading
|
13 | * @param fileId Id of file to get link to
|
14 | */
|
15 | getFile(fileId: string): Promise<tg.File>;
|
16 | /**
|
17 | * Get download link to a file
|
18 | */
|
19 | getFileLink(fileId: string | tg.File): Promise<URL>;
|
20 | /**
|
21 | * Directly request incoming updates.
|
22 | * You should probably use `Telegraf::launch` instead.
|
23 | */
|
24 | getUpdates(timeout: number, limit: number, offset: number, allowedUpdates: readonly tt.UpdateType[] | undefined): Promise<tg.Update[]>;
|
25 | getWebhookInfo(): Promise<tg.WebhookInfo>;
|
26 | getGameHighScores(userId: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined): Promise<tg.GameHighScore[]>;
|
27 | setGameScore(userId: number, score: number, inlineMessageId: string | undefined, chatId: number | undefined, messageId: number | undefined, editMessage?: boolean, force?: boolean): Promise<true | (tg.Update.Edited & tg.Message.GameMessage)>;
|
28 | /**
|
29 | * Specify a url to receive incoming updates via an outgoing webhook
|
30 | * @param url HTTPS url to send updates to. Use an empty string to remove webhook integration
|
31 | */
|
32 | setWebhook(url: string, extra?: tt.ExtraSetWebhook): Promise<true>;
|
33 | /**
|
34 | * Remove webhook integration
|
35 | */
|
36 | deleteWebhook(extra?: {
|
37 | drop_pending_updates?: boolean;
|
38 | }): Promise<true>;
|
39 | /**
|
40 | * Send a text message
|
41 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
42 | * @param text Text of the message to be sent
|
43 | */
|
44 | sendMessage(chatId: number | string, text: string, extra?: tt.ExtraReplyMessage): Promise<tg.Message.TextMessage>;
|
45 | /**
|
46 | * Forward existing message.
|
47 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
48 | * @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
|
49 | * @param messageId Message identifier in the chat specified in from_chat_id
|
50 | */
|
51 | forwardMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: {
|
52 | disable_notification?: boolean;
|
53 | }): Promise<tg.Message>;
|
54 | /**
|
55 | * Use this method when you need to tell the user that something is happening on the bot's side.
|
56 | * The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
|
57 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
58 | */
|
59 | sendChatAction(chatId: number | string, action: tt.ChatAction): Promise<true>;
|
60 | getUserProfilePhotos(userId: number, offset?: number, limit?: number): Promise<tg.UserProfilePhotos>;
|
61 | /**
|
62 | * Send point on the map
|
63 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
64 | */
|
65 | sendLocation(chatId: number | string, latitude: number, longitude: number, extra?: tt.ExtraLocation): Promise<tg.Message.LocationMessage>;
|
66 | sendVenue(chatId: number | string, latitude: number, longitude: number, title: string, address: string, extra?: tt.ExtraVenue): Promise<tg.Message.VenueMessage>;
|
67 | /**
|
68 | * @param chatId Unique identifier for the target private chat
|
69 | */
|
70 | sendInvoice(chatId: number | string, invoice: tt.NewInvoiceParameters, extra?: tt.ExtraInvoice): Promise<tg.Message.InvoiceMessage>;
|
71 | sendContact(chatId: number | string, phoneNumber: string, firstName: string, extra?: tt.ExtraContact): Promise<tg.Message.ContactMessage>;
|
72 | /**
|
73 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
74 | */
|
75 | sendPhoto(chatId: number | string, photo: tg.Opts<'sendPhoto'>['photo'], extra?: tt.ExtraPhoto): Promise<tg.Message.PhotoMessage>;
|
76 | /**
|
77 | * Send a dice, which will have a random value from 1 to 6.
|
78 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
79 | */
|
80 | sendDice(chatId: number | string, extra?: tt.ExtraDice): Promise<tg.Message.DiceMessage>;
|
81 | /**
|
82 | * Send general files. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
|
83 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
84 | */
|
85 | sendDocument(chatId: number | string, document: tg.Opts<'sendDocument'>['document'], extra?: tt.ExtraDocument): Promise<tg.Message.DocumentMessage>;
|
86 | /**
|
87 | * Send audio files, if you want Telegram clients to display them in the music player.
|
88 | * Your audio must be in the .mp3 format.
|
89 | * Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
90 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
91 | */
|
92 | sendAudio(chatId: number | string, audio: tg.Opts<'sendAudio'>['audio'], extra?: tt.ExtraAudio): Promise<tg.Message.AudioMessage>;
|
93 | /**
|
94 | * Send .webp stickers
|
95 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
96 | */
|
97 | sendSticker(chatId: number | string, sticker: tg.Opts<'sendSticker'>['sticker'], extra?: tt.ExtraSticker): Promise<tg.Message.StickerMessage>;
|
98 | /**
|
99 | * Send video files, Telegram clients support mp4 videos (other formats may be sent as Document)
|
100 | * Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
|
101 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
102 | */
|
103 | sendVideo(chatId: number | string, video: tg.Opts<'sendVideo'>['video'], extra?: tt.ExtraVideo): Promise<tg.Message.VideoMessage>;
|
104 | /**
|
105 | * Send .gif animations
|
106 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
107 | */
|
108 | sendAnimation(chatId: number | string, animation: tg.Opts<'sendAnimation'>['animation'], extra?: tt.ExtraAnimation): Promise<tg.Message.AnimationMessage>;
|
109 | /**
|
110 | * Send video messages
|
111 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
112 | */
|
113 | sendVideoNote(chatId: number | string, videoNote: string | tg.InputFileVideoNote, extra?: tt.ExtraVideoNote): Promise<tg.Message.VideoNoteMessage>;
|
114 | /**
|
115 | * Send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
|
116 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
117 | */
|
118 | sendVoice(chatId: number | string, voice: tg.Opts<'sendVoice'>['voice'], extra?: tt.ExtraVoice): Promise<tg.Message.VoiceMessage>;
|
119 | /**
|
120 | * @param chatId Unique identifier for the target chat
|
121 | * @param gameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
|
122 | */
|
123 | sendGame(chatId: number, gameName: string, extra?: tt.ExtraGame): Promise<tg.Message.GameMessage>;
|
124 | /**
|
125 | * Send a group of photos or videos as an album
|
126 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
127 | * @param media A JSON-serialized array describing photos and videos to be sent, must include 2–10 items
|
128 | */
|
129 | sendMediaGroup(chatId: number | string, media: ReadonlyArray<tg.InputMediaPhoto | tg.InputMediaVideo> | readonly tg.InputMediaAudio[] | readonly tg.InputMediaDocument[], extra?: tt.ExtraMediaGroup): Promise<(tg.Message.DocumentMessage | tg.Message.AudioMessage | tg.Message.PhotoMessage | tg.Message.VideoMessage)[]>;
|
130 | /**
|
131 | * Send a native poll.
|
132 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
133 | * @param question Poll question, 1-255 characters
|
134 | * @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
135 | */
|
136 | sendPoll(chatId: number | string, question: string, options: readonly string[], extra?: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
137 | /**
|
138 | * Send a native quiz.
|
139 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
140 | * @param question Poll question, 1-255 characters
|
141 | * @param options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each
|
142 | */
|
143 | sendQuiz(chatId: number | string, question: string, options: readonly string[], extra: tt.ExtraPoll): Promise<tg.Message.PollMessage>;
|
144 | /**
|
145 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
146 | * @param messageId Identifier of the original message with the poll
|
147 | */
|
148 | stopPoll(chatId: number | string, messageId: number, extra?: tt.ExtraStopPoll): Promise<tg.Poll>;
|
149 | /**
|
150 | * Get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.)
|
151 | * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
152 | */
|
153 | getChat(chatId: number | string): Promise<tg.ChatFromGetChat>;
|
154 | /**
|
155 | * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
156 | */
|
157 | getChatAdministrators(chatId: number | string): Promise<tg.ChatMember[]>;
|
158 | /**
|
159 | * Get information about a member of a chat.
|
160 | * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
161 | * @param userId Unique identifier of the target user
|
162 | */
|
163 | getChatMember(chatId: string | number, userId: number): Promise<tg.ChatMember>;
|
164 | /**
|
165 | * Get the number of members in a chat
|
166 | * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
167 | */
|
168 | getChatMembersCount(chatId: string | number): Promise<number>;
|
169 | /**
|
170 | * Send answers to an inline query.
|
171 | * No more than 50 results per query are allowed.
|
172 | */
|
173 | answerInlineQuery(inlineQueryId: string, results: readonly tg.InlineQueryResult[], extra?: tt.ExtraAnswerInlineQuery): Promise<true>;
|
174 | setChatPermissions(chatId: number | string, permissions: tg.ChatPermissions): Promise<true>;
|
175 | /**
|
176 | * Kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights
|
177 | * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
|
178 | * @param untilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever
|
179 | */
|
180 | kickChatMember(chatId: number | string, userId: number, untilDate?: number, extra?: tt.ExtraKickChatMember): Promise<true>;
|
181 | /**
|
182 | * Promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user.
|
183 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
184 | */
|
185 | promoteChatMember(chatId: number | string, userId: number, extra: tt.ExtraPromoteChatMember): Promise<true>;
|
186 | /**
|
187 | * Restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a user.
|
188 | * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
189 | */
|
190 | restrictChatMember(chatId: string | number, userId: number, extra: tt.ExtraRestrictChatMember): Promise<true>;
|
191 | setChatAdministratorCustomTitle(chatId: number | string, userId: number, title: string): Promise<true>;
|
192 | /**
|
193 | * Export an invite link to a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights.
|
194 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
195 | */
|
196 | exportChatInviteLink(chatId: number | string): Promise<string>;
|
197 | createChatInviteLink(chatId: number | string, extra?: tt.ExtraCreateChatInviteLink): Promise<tg.ChatInviteLink>;
|
198 | editChatInviteLink(chatId: number | string, inviteLink: string, extra?: tt.ExtraEditChatInviteLink): Promise<tg.ChatInviteLink>;
|
199 | revokeChatInviteLink(chatId: number | string, inviteLink: string): Promise<tg.ChatInviteLink>;
|
200 | setChatPhoto(chatId: number | string, photo: tg.Opts<'setChatPhoto'>['photo']): Promise<true>;
|
201 | deleteChatPhoto(chatId: number | string): Promise<true>;
|
202 | /**
|
203 | * Change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights
|
204 | * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format `@channelusername`)
|
205 | * @param title New chat title, 1-255 characters
|
206 | */
|
207 | setChatTitle(chatId: number | string, title: string): Promise<true>;
|
208 | setChatDescription(chatId: number | string, description?: string): Promise<true>;
|
209 | /**
|
210 | * Pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
|
211 | * @param chatId Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
|
212 | */
|
213 | pinChatMessage(chatId: number | string, messageId: number, extra?: {
|
214 | disable_notification?: boolean;
|
215 | }): Promise<true>;
|
216 | /**
|
217 | * Unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel.
|
218 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
219 | */
|
220 | unpinChatMessage(chatId: number | string, messageId?: number): Promise<true>;
|
221 | /**
|
222 | * Clear the list of pinned messages in a chat
|
223 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
224 | */
|
225 | unpinAllChatMessages(chatId: number | string): Promise<true>;
|
226 | /**
|
227 | * Use this method for your bot to leave a group, supergroup or channel
|
228 | * @param chatId Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
|
229 | */
|
230 | leaveChat(chatId: number | string): Promise<true>;
|
231 | /**
|
232 | * Unban a user from a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights
|
233 | * @param chatId Unique identifier for the target group or username of the target supergroup or channel (in the format @username)
|
234 | * @param userId Unique identifier of the target user
|
235 | */
|
236 | unbanChatMember(chatId: number | string, userId: number, extra?: {
|
237 | only_if_banned?: boolean;
|
238 | }): Promise<true>;
|
239 | answerCbQuery(callbackQueryId: string, text?: string, extra?: tt.ExtraAnswerCbQuery): Promise<true>;
|
240 | answerGameQuery(callbackQueryId: string, url: string): Promise<true>;
|
241 | /**
|
242 | * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
|
243 | * the Bot API will send an Update with a shipping_query field to the bot.
|
244 | * Reply to shipping queries.
|
245 | * @param ok Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
|
246 | * @param shippingOptions Required if ok is True. A JSON-serialized array of available shipping options.
|
247 | * @param errorMessage Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
|
248 | */
|
249 | answerShippingQuery(shippingQueryId: string, ok: boolean, shippingOptions: readonly tg.ShippingOption[] | undefined, errorMessage: string | undefined): Promise<true>;
|
250 | /**
|
251 | * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query.
|
252 | * Respond to such pre-checkout queries. On success, True is returned.
|
253 | * Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
|
254 | * @param ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
|
255 | * @param errorMessage Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
|
256 | */
|
257 | answerPreCheckoutQuery(preCheckoutQueryId: string, ok: boolean, errorMessage?: string): Promise<true>;
|
258 | /**
|
259 | * Edit text and game messages sent by the bot or via the bot (for inline bots).
|
260 | * On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
261 | * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
262 | * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
263 | * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
264 | * @param text New text of the message
|
265 | */
|
266 | editMessageText(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, text: string, extra?: tt.ExtraEditMessageText): Promise<true | (tg.Update.Edited & tg.Message.TextMessage)>;
|
267 | /**
|
268 | * Edit captions of messages sent by the bot or via the bot (for inline bots).
|
269 | * On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
270 | * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
271 | * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
272 | * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
273 | * @param caption New caption of the message
|
274 | * @param markup A JSON-serialized object for an inline keyboard.
|
275 | */
|
276 | editMessageCaption(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, caption: string | undefined, extra?: tt.ExtraEditMessageCaption): Promise<true | (tg.Update.Edited & tg.Message.CaptionableMessage)>;
|
277 | /**
|
278 | * Edit animation, audio, document, photo, or video messages.
|
279 | * If a message is a part of a message album, then it can be edited only to a photo or a video.
|
280 | * Otherwise, message type can be changed arbitrarily.
|
281 | * When inline message is edited, new file can't be uploaded.
|
282 | * Use previously uploaded file via its file_id or specify a URL.
|
283 | * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
284 | * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
285 | * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
286 | * @param media New media of message
|
287 | * @param markup Markup of inline keyboard
|
288 | */
|
289 | editMessageMedia(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, media: tg.InputMedia, extra?: tt.ExtraEditMessageMedia): Promise<true | (tg.Update.Edited & tg.Message.AnimationMessage) | (tg.Update.Edited & tg.Message.DocumentMessage) | (tg.Update.Edited & tg.Message.AudioMessage) | (tg.Update.Edited & tg.Message.PhotoMessage) | (tg.Update.Edited & tg.Message.VideoMessage)>;
|
290 | /**
|
291 | * Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
|
292 | * @param chatId Required if inlineMessageId is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
293 | * @param messageId Required if inlineMessageId is not specified. Identifier of the sent message
|
294 | * @param inlineMessageId Required if chatId and messageId are not specified. Identifier of the inline message
|
295 | * @param markup A JSON-serialized object for an inline keyboard.
|
296 | * @returns If edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
297 | */
|
298 | editMessageReplyMarkup(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup: tg.InlineKeyboardMarkup | undefined): Promise<true | (tg.Update.Edited & tg.Message)>;
|
299 | editMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, latitude: number, longitude: number, extra?: tt.ExtraEditMessageLiveLocation): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
300 | stopMessageLiveLocation(chatId: number | string | undefined, messageId: number | undefined, inlineMessageId: string | undefined, markup?: tg.InlineKeyboardMarkup): Promise<true | (tg.Update.Edited & tg.Message.LocationMessage)>;
|
301 | /**
|
302 | * Delete a message, including service messages, with the following limitations:
|
303 | * - A message can only be deleted if it was sent less than 48 hours ago.
|
304 | * - Bots can delete outgoing messages in groups and supergroups.
|
305 | * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
306 | * - If the bot is an administrator of a group, it can delete any message there.
|
307 | * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
|
308 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
309 | */
|
310 | deleteMessage(chatId: number | string, messageId: number): Promise<true>;
|
311 | setChatStickerSet(chatId: number | string, setName: string): Promise<true>;
|
312 | deleteChatStickerSet(chatId: number | string): Promise<true>;
|
313 | getStickerSet(name: string): Promise<tg.StickerSet>;
|
314 | /**
|
315 | * Upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times)
|
316 | * https://core.telegram.org/bots/api#sending-files
|
317 | * @param ownerId User identifier of sticker file owner
|
318 | * @param stickerFile Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px.
|
319 | */
|
320 | uploadStickerFile(ownerId: number, stickerFile: tg.Opts<'uploadStickerFile'>['png_sticker']): Promise<tg.File>;
|
321 | /**
|
322 | * Create new sticker set owned by a user. The bot will be able to edit the created sticker set
|
323 | * @param ownerId User identifier of created sticker set owner
|
324 | * @param name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
|
325 | * @param title Sticker set title, 1-64 characters
|
326 | */
|
327 | createNewStickerSet(ownerId: number, name: string, title: string, stickerData: tt.ExtraCreateNewStickerSet): Promise<true>;
|
328 | /**
|
329 | * Add a new sticker to a set created by the bot
|
330 | * @param ownerId User identifier of sticker set owner
|
331 | * @param name Sticker set name
|
332 | */
|
333 | addStickerToSet(ownerId: number, name: string, stickerData: tt.ExtraAddStickerToSet): Promise<true>;
|
334 | /**
|
335 | * Move a sticker in a set created by the bot to a specific position
|
336 | * @param sticker File identifier of the sticker
|
337 | * @param position New sticker position in the set, zero-based
|
338 | */
|
339 | setStickerPositionInSet(sticker: string, position: number): Promise<true>;
|
340 | setStickerSetThumb(name: string, userId: number, thumb: tg.Opts<'setStickerSetThumb'>['thumb']): Promise<true>;
|
341 | /**
|
342 | * Delete a sticker from a set created by the bot.
|
343 | * @param sticker File identifier of the sticker
|
344 | */
|
345 | deleteStickerFromSet(sticker: string): Promise<true>;
|
346 | /**
|
347 | * Get the current list of the bot's commands.
|
348 | */
|
349 | getMyCommands(extra?: tg.Opts<'getMyCommands'>): Promise<tg.BotCommand[]>;
|
350 | /**
|
351 | * Change the list of the bot's commands.
|
352 | * @param commands A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
|
353 | */
|
354 | setMyCommands(commands: readonly tg.BotCommand[], extra?: tt.ExtraSetMyCommands): Promise<true>;
|
355 | deleteMyCommands(extra?: tg.Opts<'deleteMyCommands'>): Promise<true>;
|
356 | setPassportDataErrors(userId: number, errors: readonly tg.PassportElementError[]): Promise<true>;
|
357 | /**
|
358 | * Send copy of existing message.
|
359 | * @deprecated use `copyMessage` instead
|
360 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
361 | * @param message Received message object
|
362 | */
|
363 | sendCopy(chatId: number | string, message: tg.Message, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
|
364 | /**
|
365 | * Send copy of existing message
|
366 | * @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername)
|
367 | * @param fromChatId Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
|
368 | * @param messageId Message identifier in the chat specified in from_chat_id
|
369 | */
|
370 | copyMessage(chatId: number | string, fromChatId: number | string, messageId: number, extra?: tt.ExtraCopyMessage): Promise<tg.MessageId>;
|
371 | /**
|
372 | * Log out from the cloud Bot API server before launching the bot locally
|
373 | */
|
374 | logOut(): Promise<true>;
|
375 | /**
|
376 | * Close the bot instance before moving it from one local server to another
|
377 | */
|
378 | close(): Promise<true>;
|
379 | }
|
380 | export default Telegram;
|
381 | //# sourceMappingURL=telegram.d.ts.map |
\ | No newline at end of file |