@grammyjs/types 2.6.0 → 2.7.0
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/index.d.ts +2 -1
- package/inline.d.ts +7 -84
- package/manage.d.ts +44 -12
- package/{callback.d.ts → markup.d.ts} +118 -24
- package/{bot-command-scope.d.ts → menu-button.d.ts} +35 -0
- package/message.d.ts +77 -75
- package/package.json +1 -1
- package/passport.d.ts +17 -17
- package/proxied.d.ts +67 -27
- package/update.d.ts +1 -1
package/index.d.ts
CHANGED
package/inline.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Chat, User } from "./manage";
|
|
2
|
+
import { InlineKeyboardMarkup } from "./markup";
|
|
2
3
|
import { Location, MessageEntity, ParseMode } from "./message";
|
|
3
4
|
import { LabeledPrice } from "./payment";
|
|
4
5
|
|
|
@@ -12,90 +13,12 @@ export interface InlineQuery {
|
|
|
12
13
|
query: string;
|
|
13
14
|
/** Offset of the results to be returned, can be controlled by the bot */
|
|
14
15
|
offset: string;
|
|
15
|
-
/** Type of the chat, from which the inline query was sent. Can be either
|
|
16
|
+
/** Type of the chat, from which the inline query was sent. Can be either "sender" for a private chat with the inline query sender, "private", "group", "supergroup", or "channel". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
|
|
16
17
|
chat_type?: "sender" | Chat["type"];
|
|
17
18
|
/** Sender location, only for bots that request user location */
|
|
18
19
|
location?: Location;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
22
|
-
export interface InlineKeyboardMarkup {
|
|
23
|
-
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
24
|
-
inline_keyboard: InlineKeyboardButton[][];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export namespace InlineKeyboardButton {
|
|
28
|
-
interface AbstractInlineKeyboardButton {
|
|
29
|
-
/** Label text on the button */
|
|
30
|
-
text: string;
|
|
31
|
-
}
|
|
32
|
-
export interface UrlButton extends AbstractInlineKeyboardButton {
|
|
33
|
-
/** HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */
|
|
34
|
-
url: string;
|
|
35
|
-
}
|
|
36
|
-
export interface LoginButton extends AbstractInlineKeyboardButton {
|
|
37
|
-
/** An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
|
|
38
|
-
login_url: LoginUrl;
|
|
39
|
-
}
|
|
40
|
-
export interface CallbackButton extends AbstractInlineKeyboardButton {
|
|
41
|
-
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
|
|
42
|
-
callback_data: string;
|
|
43
|
-
}
|
|
44
|
-
export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
|
|
45
|
-
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
|
|
46
|
-
|
|
47
|
-
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
|
|
48
|
-
switch_inline_query: string;
|
|
49
|
-
}
|
|
50
|
-
export interface SwitchInlineCurrentChatButton
|
|
51
|
-
extends AbstractInlineKeyboardButton {
|
|
52
|
-
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
|
|
53
|
-
|
|
54
|
-
This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
|
|
55
|
-
switch_inline_query_current_chat: string;
|
|
56
|
-
}
|
|
57
|
-
export interface GameButton extends AbstractInlineKeyboardButton {
|
|
58
|
-
/** Description of the game that will be launched when the user presses the button.
|
|
59
|
-
|
|
60
|
-
NOTE: This type of button must always be the first button in the first row. */
|
|
61
|
-
callback_game: CallbackGame;
|
|
62
|
-
}
|
|
63
|
-
export interface PayButton extends AbstractInlineKeyboardButton {
|
|
64
|
-
/** Specify True, to send a Pay button.
|
|
65
|
-
|
|
66
|
-
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
|
|
67
|
-
pay: boolean;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
|
|
72
|
-
export type InlineKeyboardButton =
|
|
73
|
-
| InlineKeyboardButton.CallbackButton
|
|
74
|
-
| InlineKeyboardButton.GameButton
|
|
75
|
-
| InlineKeyboardButton.LoginButton
|
|
76
|
-
| InlineKeyboardButton.PayButton
|
|
77
|
-
| InlineKeyboardButton.SwitchInlineButton
|
|
78
|
-
| InlineKeyboardButton.SwitchInlineCurrentChatButton
|
|
79
|
-
| InlineKeyboardButton.UrlButton;
|
|
80
|
-
|
|
81
|
-
/** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
|
|
82
|
-
Telegram apps support these buttons as of version 5.7. */
|
|
83
|
-
export interface LoginUrl {
|
|
84
|
-
/** An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
|
|
85
|
-
|
|
86
|
-
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */
|
|
87
|
-
url: string;
|
|
88
|
-
/** New text of the button in forwarded messages. */
|
|
89
|
-
forward_text?: string;
|
|
90
|
-
/** Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */
|
|
91
|
-
bot_username?: string;
|
|
92
|
-
/** Pass True to request the permission for your bot to send messages to the user. */
|
|
93
|
-
request_write_access?: boolean;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** A placeholder, currently holds no information. Use BotFather to set up your game. */
|
|
97
|
-
export interface CallbackGame {}
|
|
98
|
-
|
|
99
22
|
/** This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
|
|
100
23
|
- InlineQueryResultCachedAudio
|
|
101
24
|
- InlineQueryResultCachedDocument
|
|
@@ -213,7 +136,7 @@ export interface InlineQueryResultGif {
|
|
|
213
136
|
gif_duration?: number;
|
|
214
137
|
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
215
138
|
thumb_url: string;
|
|
216
|
-
/** MIME type of the thumbnail, must be one of
|
|
139
|
+
/** MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" */
|
|
217
140
|
thumb_mime_type?: "image/jpeg" | "image/gif" | "video/mp4";
|
|
218
141
|
/** Title for the result */
|
|
219
142
|
title?: string;
|
|
@@ -243,7 +166,7 @@ export interface InlineQueryResultMpeg4Gif {
|
|
|
243
166
|
mpeg4_duration?: number;
|
|
244
167
|
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
245
168
|
thumb_url: string;
|
|
246
|
-
/** MIME type of the thumbnail, must be one of
|
|
169
|
+
/** MIME type of the thumbnail, must be one of "image/jpeg", "image/gif", or "video/mp4". Defaults to "image/jpeg" */
|
|
247
170
|
thumb_mime_type?: "image/jpeg" | "image/gif" | "video/mp4";
|
|
248
171
|
/** Title for the result */
|
|
249
172
|
title?: string;
|
|
@@ -267,7 +190,7 @@ export interface InlineQueryResultVideo {
|
|
|
267
190
|
id: string;
|
|
268
191
|
/** A valid URL for the embedded video player or video file */
|
|
269
192
|
video_url: string;
|
|
270
|
-
/** Mime type of the content of video url,
|
|
193
|
+
/** Mime type of the content of video url, "text/html" or "video/mp4" */
|
|
271
194
|
mime_type: "text/html" | "video/mp4";
|
|
272
195
|
/** URL of the thumbnail (JPEG only) for the video */
|
|
273
196
|
thumb_url: string;
|
|
@@ -431,7 +354,7 @@ export interface InlineQueryResultVenue {
|
|
|
431
354
|
address: string;
|
|
432
355
|
/** Foursquare identifier of the venue if known */
|
|
433
356
|
foursquare_id?: string;
|
|
434
|
-
/** Foursquare type of the venue, if known. (For example,
|
|
357
|
+
/** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
|
|
435
358
|
foursquare_type?: string;
|
|
436
359
|
/** Google Places identifier of the venue */
|
|
437
360
|
google_place_id?: string;
|
|
@@ -720,7 +643,7 @@ export interface InputVenueMessageContent {
|
|
|
720
643
|
address: string;
|
|
721
644
|
/** Foursquare identifier of the venue, if known */
|
|
722
645
|
foursquare_id?: string;
|
|
723
|
-
/** Foursquare type of the venue, if known. (For example,
|
|
646
|
+
/** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
|
|
724
647
|
foursquare_type?: string;
|
|
725
648
|
/** Google Places identifier of the venue */
|
|
726
649
|
google_place_id?: string;
|
package/manage.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface WebhookInfo {
|
|
|
15
15
|
last_error_date: number;
|
|
16
16
|
/** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
|
|
17
17
|
last_error_message: string;
|
|
18
|
+
/** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
|
|
19
|
+
last_synchronization_error_date?: number;
|
|
18
20
|
/** Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
|
|
19
21
|
max_connections: number;
|
|
20
22
|
/** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
|
|
@@ -53,7 +55,7 @@ export namespace Chat {
|
|
|
53
55
|
// ABSTRACT
|
|
54
56
|
/** Internal type holding properties that all kinds of chats share. */
|
|
55
57
|
interface AbstractChat {
|
|
56
|
-
/** Type of chat, can be either
|
|
58
|
+
/** Type of chat, can be either "private", "group", "supergroup" or "channel" */
|
|
57
59
|
type: string;
|
|
58
60
|
/** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
|
|
59
61
|
id: number;
|
|
@@ -86,7 +88,9 @@ export namespace Chat {
|
|
|
86
88
|
}
|
|
87
89
|
/** Internal type representing super group chats. */
|
|
88
90
|
export interface SupergroupChat
|
|
89
|
-
extends AbstractChat,
|
|
91
|
+
extends AbstractChat,
|
|
92
|
+
UserNameChat,
|
|
93
|
+
TitleChat {
|
|
90
94
|
type: "supergroup";
|
|
91
95
|
}
|
|
92
96
|
/** Internal type representing channel chats. */
|
|
@@ -138,7 +142,9 @@ export namespace Chat {
|
|
|
138
142
|
export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
|
|
139
143
|
/** Internal type representing supergroup chats returned from `getChat`. */
|
|
140
144
|
export interface SupergroupGetChat
|
|
141
|
-
extends SupergroupChat,
|
|
145
|
+
extends SupergroupChat,
|
|
146
|
+
MultiUserGetChat,
|
|
147
|
+
LargeGetChat {
|
|
142
148
|
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
|
|
143
149
|
slow_mode_delay?: number;
|
|
144
150
|
/** For supergroups, name of group sticker set. Returned only in getChat. */
|
|
@@ -186,7 +192,7 @@ export interface ChatPhoto {
|
|
|
186
192
|
|
|
187
193
|
/** Represents an invite link for a chat. */
|
|
188
194
|
export interface ChatInviteLink {
|
|
189
|
-
/**
|
|
195
|
+
/** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
|
|
190
196
|
invite_link: string;
|
|
191
197
|
/** Creator of the link */
|
|
192
198
|
creator: User;
|
|
@@ -206,6 +212,32 @@ export interface ChatInviteLink {
|
|
|
206
212
|
pending_join_request_count?: number;
|
|
207
213
|
}
|
|
208
214
|
|
|
215
|
+
/** Represents the rights of an administrator in a chat. */
|
|
216
|
+
export interface ChatAdministratorRights {
|
|
217
|
+
/** True, if the user's presence in the chat is hidden */
|
|
218
|
+
is_anonymous: boolean;
|
|
219
|
+
/** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
|
|
220
|
+
can_manage_chat: boolean;
|
|
221
|
+
/** True, if the administrator can delete messages of other users */
|
|
222
|
+
can_delete_messages: boolean;
|
|
223
|
+
/** True, if the administrator can manage video chats */
|
|
224
|
+
can_manage_video_chats: boolean;
|
|
225
|
+
/** True, if the administrator can restrict, ban or unban chat members */
|
|
226
|
+
can_restrict_members: boolean;
|
|
227
|
+
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
|
|
228
|
+
can_promote_members: boolean;
|
|
229
|
+
/** True, if the user is allowed to change the chat title, photo and other settings */
|
|
230
|
+
can_change_info: boolean;
|
|
231
|
+
/** True, if the user is allowed to invite new users to the chat */
|
|
232
|
+
can_invite_users: boolean;
|
|
233
|
+
/** True, if the administrator can post in the channel; channels only */
|
|
234
|
+
can_post_messages?: boolean;
|
|
235
|
+
/** True, if the administrator can edit messages of other users and can pin messages; channels only */
|
|
236
|
+
can_edit_messages?: boolean;
|
|
237
|
+
/** True, if the user is allowed to pin messages; groups and supergroups only */
|
|
238
|
+
can_pin_messages?: boolean;
|
|
239
|
+
}
|
|
240
|
+
|
|
209
241
|
/** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
|
|
210
242
|
- ChatMemberOwner
|
|
211
243
|
- ChatMemberAdministrator
|
|
@@ -223,7 +255,7 @@ export type ChatMember =
|
|
|
223
255
|
|
|
224
256
|
/** Represents a chat member that owns the chat and has all administrator privileges. */
|
|
225
257
|
export interface ChatMemberOwner {
|
|
226
|
-
/** The member's status in the chat, always
|
|
258
|
+
/** The member's status in the chat, always "creator" */
|
|
227
259
|
status: "creator";
|
|
228
260
|
/** Information about the user */
|
|
229
261
|
user: User;
|
|
@@ -235,7 +267,7 @@ export interface ChatMemberOwner {
|
|
|
235
267
|
|
|
236
268
|
/** Represents a chat member that has some additional privileges. */
|
|
237
269
|
export interface ChatMemberAdministrator {
|
|
238
|
-
/** The member's status in the chat, always
|
|
270
|
+
/** The member's status in the chat, always "administrator" */
|
|
239
271
|
status: "administrator";
|
|
240
272
|
/** Information about the user */
|
|
241
273
|
user: User;
|
|
@@ -247,8 +279,8 @@ export interface ChatMemberAdministrator {
|
|
|
247
279
|
can_manage_chat: boolean;
|
|
248
280
|
/** True, if the administrator can delete messages of other users */
|
|
249
281
|
can_delete_messages: boolean;
|
|
250
|
-
/** True, if the administrator can manage
|
|
251
|
-
|
|
282
|
+
/** True, if the administrator can manage video chats */
|
|
283
|
+
can_manage_video_chats: boolean;
|
|
252
284
|
/** True, if the administrator can restrict, ban or unban chat members */
|
|
253
285
|
can_restrict_members: boolean;
|
|
254
286
|
/** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
|
|
@@ -269,7 +301,7 @@ export interface ChatMemberAdministrator {
|
|
|
269
301
|
|
|
270
302
|
/** Represents a chat member that has no additional privileges or restrictions. */
|
|
271
303
|
export interface ChatMemberMember {
|
|
272
|
-
/** The member's status in the chat, always
|
|
304
|
+
/** The member's status in the chat, always "member" */
|
|
273
305
|
status: "member";
|
|
274
306
|
/** Information about the user */
|
|
275
307
|
user: User;
|
|
@@ -277,7 +309,7 @@ export interface ChatMemberMember {
|
|
|
277
309
|
|
|
278
310
|
/** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
|
|
279
311
|
export interface ChatMemberRestricted {
|
|
280
|
-
/** The member's status in the chat, always
|
|
312
|
+
/** The member's status in the chat, always "restricted" */
|
|
281
313
|
status: "restricted";
|
|
282
314
|
/** Information about the user */
|
|
283
315
|
user: User;
|
|
@@ -305,7 +337,7 @@ export interface ChatMemberRestricted {
|
|
|
305
337
|
|
|
306
338
|
/** Represents a chat member that isn't currently a member of the chat, but may join it themselves. */
|
|
307
339
|
export interface ChatMemberLeft {
|
|
308
|
-
/** The member's status in the chat, always
|
|
340
|
+
/** The member's status in the chat, always "left" */
|
|
309
341
|
status: "left";
|
|
310
342
|
/** Information about the user */
|
|
311
343
|
user: User;
|
|
@@ -313,7 +345,7 @@ export interface ChatMemberLeft {
|
|
|
313
345
|
|
|
314
346
|
/** Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. */
|
|
315
347
|
export interface ChatMemberBanned {
|
|
316
|
-
/** The member's status in the chat, always
|
|
348
|
+
/** The member's status in the chat, always "kicked" */
|
|
317
349
|
status: "kicked";
|
|
318
350
|
/** Information about the user */
|
|
319
351
|
user: User;
|
|
@@ -1,6 +1,109 @@
|
|
|
1
1
|
import { User } from "./manage";
|
|
2
2
|
import { Message } from "./message";
|
|
3
3
|
|
|
4
|
+
/** This object represents an inline keyboard that appears right next to the message it belongs to. */
|
|
5
|
+
export interface InlineKeyboardMarkup {
|
|
6
|
+
/** Array of button rows, each represented by an Array of InlineKeyboardButton objects */
|
|
7
|
+
inline_keyboard: InlineKeyboardButton[][];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export namespace InlineKeyboardButton {
|
|
11
|
+
interface AbstractInlineKeyboardButton {
|
|
12
|
+
/** Label text on the button */
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UrlButton extends AbstractInlineKeyboardButton {
|
|
16
|
+
/** HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */
|
|
17
|
+
url: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CallbackButton extends AbstractInlineKeyboardButton {
|
|
20
|
+
/** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
|
|
21
|
+
callback_data: string;
|
|
22
|
+
}
|
|
23
|
+
export interface WebAppButton extends AbstractInlineKeyboardButton {
|
|
24
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
|
|
25
|
+
web_app: WebAppInfo;
|
|
26
|
+
}
|
|
27
|
+
export interface LoginButton extends AbstractInlineKeyboardButton {
|
|
28
|
+
/** An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
|
|
29
|
+
login_url: LoginUrl;
|
|
30
|
+
}
|
|
31
|
+
export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
|
|
32
|
+
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.
|
|
33
|
+
|
|
34
|
+
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */
|
|
35
|
+
switch_inline_query: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SwitchInlineCurrentChatButton
|
|
38
|
+
extends AbstractInlineKeyboardButton {
|
|
39
|
+
/** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
|
|
40
|
+
|
|
41
|
+
This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
|
|
42
|
+
switch_inline_query_current_chat: string;
|
|
43
|
+
}
|
|
44
|
+
export interface GameButton extends AbstractInlineKeyboardButton {
|
|
45
|
+
/** Description of the game that will be launched when the user presses the button.
|
|
46
|
+
|
|
47
|
+
NOTE: This type of button must always be the first button in the first row. */
|
|
48
|
+
callback_game: CallbackGame;
|
|
49
|
+
}
|
|
50
|
+
export interface PayButton extends AbstractInlineKeyboardButton {
|
|
51
|
+
/** Specify True, to send a Pay button.
|
|
52
|
+
|
|
53
|
+
NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */
|
|
54
|
+
pay: boolean;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** This object represents one button of an inline keyboard. You must use exactly one of the optional fields. */
|
|
59
|
+
export type InlineKeyboardButton =
|
|
60
|
+
| InlineKeyboardButton.CallbackButton
|
|
61
|
+
| InlineKeyboardButton.GameButton
|
|
62
|
+
| InlineKeyboardButton.LoginButton
|
|
63
|
+
| InlineKeyboardButton.PayButton
|
|
64
|
+
| InlineKeyboardButton.SwitchInlineButton
|
|
65
|
+
| InlineKeyboardButton.SwitchInlineCurrentChatButton
|
|
66
|
+
| InlineKeyboardButton.UrlButton
|
|
67
|
+
| InlineKeyboardButton.WebAppButton;
|
|
68
|
+
|
|
69
|
+
/** This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in.
|
|
70
|
+
Telegram apps support these buttons as of version 5.7. */
|
|
71
|
+
export interface LoginUrl {
|
|
72
|
+
/** An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
|
|
73
|
+
|
|
74
|
+
NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */
|
|
75
|
+
url: string;
|
|
76
|
+
/** New text of the button in forwarded messages. */
|
|
77
|
+
forward_text?: string;
|
|
78
|
+
/** Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */
|
|
79
|
+
bot_username?: string;
|
|
80
|
+
/** Pass True to request the permission for your bot to send messages to the user. */
|
|
81
|
+
request_write_access?: boolean;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** A placeholder, currently holds no information. Use BotFather to set up your game. */
|
|
85
|
+
export interface CallbackGame {}
|
|
86
|
+
|
|
87
|
+
/** This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
|
|
88
|
+
|
|
89
|
+
NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters). */
|
|
90
|
+
export interface CallbackQuery {
|
|
91
|
+
/** Unique identifier for this query */
|
|
92
|
+
id: string;
|
|
93
|
+
/** Sender */
|
|
94
|
+
from: User;
|
|
95
|
+
/** Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
|
|
96
|
+
message?: Message;
|
|
97
|
+
/** Identifier of the message sent via the bot in inline mode, that originated the query. */
|
|
98
|
+
inline_message_id?: string;
|
|
99
|
+
/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
|
|
100
|
+
chat_instance: string;
|
|
101
|
+
/** Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */
|
|
102
|
+
data?: string;
|
|
103
|
+
/** Short name of a Game to be returned, serves as the unique identifier for the game */
|
|
104
|
+
game_short_name?: string;
|
|
105
|
+
}
|
|
106
|
+
|
|
4
107
|
/** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). */
|
|
5
108
|
export interface ReplyKeyboardMarkup {
|
|
6
109
|
/** Array of button rows, each represented by an Array of KeyboardButton objects */
|
|
@@ -23,25 +126,30 @@ export namespace KeyboardButton {
|
|
|
23
126
|
text: string;
|
|
24
127
|
}
|
|
25
128
|
export interface RequestContactButton extends CommonButton {
|
|
26
|
-
/** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only */
|
|
129
|
+
/** If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
|
|
27
130
|
request_contact: boolean;
|
|
28
131
|
}
|
|
29
132
|
export interface RequestLocationButton extends CommonButton {
|
|
30
|
-
/** If True, the user's current location will be sent when the button is pressed. Available in private chats only */
|
|
133
|
+
/** If True, the user's current location will be sent when the button is pressed. Available in private chats only. */
|
|
31
134
|
request_location: boolean;
|
|
32
135
|
}
|
|
33
136
|
export interface RequestPollButton extends CommonButton {
|
|
34
|
-
/** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only */
|
|
137
|
+
/** If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */
|
|
35
138
|
request_poll: KeyboardButtonPollType;
|
|
36
139
|
}
|
|
140
|
+
export interface WebAppButton extends CommonButton {
|
|
141
|
+
/** If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
|
|
142
|
+
web_app: WebAppInfo;
|
|
143
|
+
}
|
|
37
144
|
}
|
|
38
145
|
|
|
39
|
-
/** This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive. */
|
|
146
|
+
/** This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive. */
|
|
40
147
|
export type KeyboardButton =
|
|
41
148
|
| KeyboardButton.CommonButton
|
|
42
149
|
| KeyboardButton.RequestContactButton
|
|
43
150
|
| KeyboardButton.RequestLocationButton
|
|
44
151
|
| KeyboardButton.RequestPollButton
|
|
152
|
+
| KeyboardButton.WebAppButton
|
|
45
153
|
| string;
|
|
46
154
|
|
|
47
155
|
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
@@ -60,26 +168,6 @@ export interface ReplyKeyboardRemove {
|
|
|
60
168
|
selective?: boolean;
|
|
61
169
|
}
|
|
62
170
|
|
|
63
|
-
/** This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
|
|
64
|
-
|
|
65
|
-
NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters). */
|
|
66
|
-
export interface CallbackQuery {
|
|
67
|
-
/** Unique identifier for this query */
|
|
68
|
-
id: string;
|
|
69
|
-
/** Sender */
|
|
70
|
-
from: User;
|
|
71
|
-
/** Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
|
|
72
|
-
message?: Message;
|
|
73
|
-
/** Identifier of the message sent via the bot in inline mode, that originated the query. */
|
|
74
|
-
inline_message_id?: string;
|
|
75
|
-
/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
|
|
76
|
-
chat_instance: string;
|
|
77
|
-
/** Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */
|
|
78
|
-
data?: string;
|
|
79
|
-
/** Short name of a Game to be returned, serves as the unique identifier for the game */
|
|
80
|
-
game_short_name?: string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
171
|
/** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
|
|
84
172
|
|
|
85
173
|
Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
|
|
@@ -97,3 +185,9 @@ export interface ForceReply {
|
|
|
97
185
|
/** Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
|
|
98
186
|
selective?: boolean;
|
|
99
187
|
}
|
|
188
|
+
|
|
189
|
+
/** Contains information about a Web App. */
|
|
190
|
+
export interface WebAppInfo {
|
|
191
|
+
/** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
|
|
192
|
+
url: string;
|
|
193
|
+
}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
import { WebAppInfo } from "./markup";
|
|
2
|
+
|
|
3
|
+
/** This object describes the bot's menu button in a private chat. It should be one of
|
|
4
|
+
- MenuButtonCommands
|
|
5
|
+
- MenuButtonWebApp
|
|
6
|
+
- MenuButtonDefault
|
|
7
|
+
|
|
8
|
+
If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands. */
|
|
9
|
+
export type MenuButton =
|
|
10
|
+
| MenuButtonCommands
|
|
11
|
+
| MenuButtonWebApp
|
|
12
|
+
| MenuButtonDefault;
|
|
13
|
+
|
|
14
|
+
/** Represents a menu button, which opens the bot's list of commands. */
|
|
15
|
+
export interface MenuButtonCommands {
|
|
16
|
+
/** Type of the button, must be commands */
|
|
17
|
+
type: "commands";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Represents a menu button, which launches a Web App. */
|
|
21
|
+
export interface MenuButtonWebApp {
|
|
22
|
+
/** Button type, must be web_app */
|
|
23
|
+
type: "web_app";
|
|
24
|
+
/** Text on the button */
|
|
25
|
+
text: string;
|
|
26
|
+
/** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. */
|
|
27
|
+
web_app: WebAppInfo;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Describes that no specific value for the menu button was set. */
|
|
31
|
+
export interface MenuButtonDefault {
|
|
32
|
+
/** Type of the button, must be default */
|
|
33
|
+
type: "default";
|
|
34
|
+
}
|
|
35
|
+
|
|
1
36
|
/** This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
|
|
2
37
|
- BotCommandScopeDefault
|
|
3
38
|
- BotCommandScopeAllPrivateChats
|
package/message.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InlineKeyboardMarkup } from "./
|
|
1
|
+
import { InlineKeyboardMarkup } from "./markup";
|
|
2
2
|
import { Chat, User } from "./manage";
|
|
3
3
|
import { PassportData } from "./passport";
|
|
4
4
|
import { Invoice, SuccessfulPayment } from "./payment";
|
|
@@ -72,59 +72,44 @@ export namespace Message {
|
|
|
72
72
|
export type PollMessage = CommonMessage & MsgWith<"poll">;
|
|
73
73
|
export type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
74
74
|
export type VenueMessage = LocationMessage & MsgWith<"venue">;
|
|
75
|
-
export type NewChatMembersMessage =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
& ServiceMessage
|
|
80
|
-
& MsgWith<"left_chat_member">;
|
|
75
|
+
export type NewChatMembersMessage = ServiceMessage &
|
|
76
|
+
MsgWith<"new_chat_members">;
|
|
77
|
+
export type LeftChatMemberMessage = ServiceMessage &
|
|
78
|
+
MsgWith<"left_chat_member">;
|
|
81
79
|
export type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
82
80
|
export type NewChatPhotoMessage = ServiceMessage & MsgWith<"new_chat_photo">;
|
|
83
|
-
export type DeleteChatPhotoMessage =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
export type
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
export type
|
|
96
|
-
|
|
97
|
-
& MsgWith<"message_auto_delete_timer_changed">;
|
|
98
|
-
export type MigrateToChatIdMessage =
|
|
99
|
-
& ServiceMessage
|
|
100
|
-
& MsgWith<"migrate_to_chat_id">;
|
|
101
|
-
export type MigrateFromChatIdMessage =
|
|
102
|
-
& ServiceMessage
|
|
103
|
-
& MsgWith<"migrate_from_chat_id">;
|
|
81
|
+
export type DeleteChatPhotoMessage = ServiceMessage &
|
|
82
|
+
MsgWith<"delete_chat_photo">;
|
|
83
|
+
export type GroupChatCreatedMessage = ServiceMessage &
|
|
84
|
+
MsgWith<"group_chat_created">;
|
|
85
|
+
export type SupergroupChatCreated = ServiceMessage &
|
|
86
|
+
MsgWith<"supergroup_chat_created">;
|
|
87
|
+
export type ChannelChatCreatedMessage = ServiceMessage &
|
|
88
|
+
MsgWith<"channel_chat_created">;
|
|
89
|
+
export type MessageAutoDeleteTimerChangedMessage = ServiceMessage &
|
|
90
|
+
MsgWith<"message_auto_delete_timer_changed">;
|
|
91
|
+
export type MigrateToChatIdMessage = ServiceMessage &
|
|
92
|
+
MsgWith<"migrate_to_chat_id">;
|
|
93
|
+
export type MigrateFromChatIdMessage = ServiceMessage &
|
|
94
|
+
MsgWith<"migrate_from_chat_id">;
|
|
104
95
|
export type PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">;
|
|
105
96
|
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
|
|
106
|
-
export type SuccessfulPaymentMessage =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
& ServiceMessage
|
|
111
|
-
& MsgWith<"connected_website">;
|
|
97
|
+
export type SuccessfulPaymentMessage = ServiceMessage &
|
|
98
|
+
MsgWith<"successful_payment">;
|
|
99
|
+
export type ConnectedWebsiteMessage = ServiceMessage &
|
|
100
|
+
MsgWith<"connected_website">;
|
|
112
101
|
export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
|
|
113
|
-
export type ProximityAlertTriggeredMessage =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export type
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
& MsgWith<"voice_chat_ended">;
|
|
125
|
-
export type VoiceChatParticipantsInvitedMessage =
|
|
126
|
-
& ServiceMessage
|
|
127
|
-
& MsgWith<"voice_chat_participants_invited">;
|
|
102
|
+
export type ProximityAlertTriggeredMessage = ServiceMessage &
|
|
103
|
+
MsgWith<"proximity_alert_triggered">;
|
|
104
|
+
export type VideoChatScheduledMessage = ServiceMessage &
|
|
105
|
+
MsgWith<"video_chat_scheduled">;
|
|
106
|
+
export type VideoChatStartedMessage = ServiceMessage &
|
|
107
|
+
MsgWith<"video_chat_started">;
|
|
108
|
+
export type VideoChatEndedMessage = ServiceMessage &
|
|
109
|
+
MsgWith<"video_chat_ended">;
|
|
110
|
+
export type VideoChatParticipantsInvitedMessage = ServiceMessage &
|
|
111
|
+
MsgWith<"video_chat_participants_invited">;
|
|
112
|
+
export type WebAppDataMessage = ServiceMessage & MsgWith<"web_app_data">;
|
|
128
113
|
}
|
|
129
114
|
|
|
130
115
|
type ReplyMessage = Message & { reply_to_message: undefined };
|
|
@@ -197,13 +182,16 @@ export interface Message extends Message.MediaMessage {
|
|
|
197
182
|
/** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
|
|
198
183
|
proximity_alert_triggered?: ProximityAlertTriggered;
|
|
199
184
|
/** Service message: voice chat scheduled */
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
185
|
+
/** Service message: video chat scheduled */
|
|
186
|
+
video_chat_scheduled?: VideoChatScheduled;
|
|
187
|
+
/** Service message: video chat started */
|
|
188
|
+
video_chat_started?: VideoChatStarted;
|
|
189
|
+
/** Service message: video chat ended */
|
|
190
|
+
video_chat_ended?: VideoChatEnded;
|
|
191
|
+
/** Service message: new participants invited to a video chat */
|
|
192
|
+
video_chat_participants_invited?: VideoChatParticipantsInvited;
|
|
193
|
+
/** Service message: data sent by a Web App */
|
|
194
|
+
web_app_data?: WebAppData;
|
|
207
195
|
}
|
|
208
196
|
|
|
209
197
|
/** This object represents a unique message identifier. */
|
|
@@ -212,6 +200,12 @@ export interface MessageId {
|
|
|
212
200
|
message_id: number;
|
|
213
201
|
}
|
|
214
202
|
|
|
203
|
+
/** Contains information about an inline message sent by a Web App on behalf of a user. */
|
|
204
|
+
export interface SentWebAppMessage {
|
|
205
|
+
/** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */
|
|
206
|
+
inline_message_id: string;
|
|
207
|
+
}
|
|
208
|
+
|
|
215
209
|
/** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, and spoiler text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.
|
|
216
210
|
|
|
217
211
|
Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).
|
|
@@ -305,7 +299,7 @@ export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
|
|
|
305
299
|
|
|
306
300
|
export namespace MessageEntity {
|
|
307
301
|
interface AbstractMessageEntity {
|
|
308
|
-
/** Type of the entity. Currently, can be
|
|
302
|
+
/** Type of the entity. Currently, can be "mention" (@username), "hashtag" (#hashtag), "cashtag" ($USD), "bot_command" (/start@jobs_bot), "url" (https://telegram.org), "email" (do-not-reply@telegram.org), "phone_number" (+1-212-555-0123), "bold" (bold text), "italic" (italic text), "underline" (underlined text), "strikethrough" (strikethrough text), "spoiler" (spoiler message), "code" (monowidth string), "pre" (monowidth block), "text_link" (for clickable text URLs), "text_mention" (for users without usernames) */
|
|
309
303
|
type: string;
|
|
310
304
|
/** Offset in UTF-16 code units to the start of the entity */
|
|
311
305
|
offset: number;
|
|
@@ -330,17 +324,17 @@ export namespace MessageEntity {
|
|
|
330
324
|
}
|
|
331
325
|
export interface TextLinkMessageEntity extends AbstractMessageEntity {
|
|
332
326
|
type: "text_link";
|
|
333
|
-
/** For
|
|
327
|
+
/** For "text_link" only, url that will be opened after user taps on the text */
|
|
334
328
|
url: string;
|
|
335
329
|
}
|
|
336
330
|
export interface TextMentionMessageEntity extends AbstractMessageEntity {
|
|
337
331
|
type: "text_mention";
|
|
338
|
-
/** For
|
|
332
|
+
/** For "text_mention" only, the mentioned user */
|
|
339
333
|
user: User;
|
|
340
334
|
}
|
|
341
335
|
export interface PreMessageEntity extends AbstractMessageEntity {
|
|
342
336
|
type: "pre";
|
|
343
|
-
/** For
|
|
337
|
+
/** For "pre" only, the programming language of the entity text */
|
|
344
338
|
language?: string;
|
|
345
339
|
}
|
|
346
340
|
}
|
|
@@ -496,7 +490,7 @@ export interface Contact {
|
|
|
496
490
|
export interface Dice {
|
|
497
491
|
/** Emoji on which the dice throw animation is based */
|
|
498
492
|
emoji: string;
|
|
499
|
-
/** Value of the dice, 1-6 for
|
|
493
|
+
/** Value of the dice, 1-6 for "🎲", "🎯" and "🎳" base emoji, 1-5 for "🏀" and "⚽" base emoji, 1-64 for "🎰" base emoji */
|
|
500
494
|
value: number;
|
|
501
495
|
}
|
|
502
496
|
|
|
@@ -532,7 +526,7 @@ export interface Poll {
|
|
|
532
526
|
is_closed: boolean;
|
|
533
527
|
/** True, if the poll is anonymous */
|
|
534
528
|
is_anonymous: boolean;
|
|
535
|
-
/** Poll type, currently can be
|
|
529
|
+
/** Poll type, currently can be "regular" or "quiz" */
|
|
536
530
|
type: "regular" | "quiz";
|
|
537
531
|
/** True, if the poll allows multiple answers */
|
|
538
532
|
allows_multiple_answers: boolean;
|
|
@@ -574,7 +568,7 @@ export interface Venue {
|
|
|
574
568
|
address: string;
|
|
575
569
|
/** Foursquare identifier of the venue */
|
|
576
570
|
foursquare_id?: string;
|
|
577
|
-
/** Foursquare type of the venue. (For example,
|
|
571
|
+
/** Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
|
|
578
572
|
foursquare_type?: string;
|
|
579
573
|
/** Google Places identifier of the venue */
|
|
580
574
|
google_place_id?: string;
|
|
@@ -598,27 +592,35 @@ export interface MessageAutoDeleteTimerChanged {
|
|
|
598
592
|
message_auto_delete_time: number;
|
|
599
593
|
}
|
|
600
594
|
|
|
601
|
-
/** This object represents a service message about a
|
|
602
|
-
export interface
|
|
603
|
-
/** Point in time (Unix timestamp) when the
|
|
595
|
+
/** This object represents a service message about a video chat scheduled in the chat. */
|
|
596
|
+
export interface VideoChatScheduled {
|
|
597
|
+
/** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
|
|
604
598
|
start_date: number;
|
|
605
599
|
}
|
|
606
600
|
|
|
607
|
-
/** This object represents a service message about a
|
|
608
|
-
export interface
|
|
601
|
+
/** This object represents a service message about a video chat started in the chat. Currently holds no information. */
|
|
602
|
+
export interface VideoChatStarted {}
|
|
609
603
|
|
|
610
|
-
/** This object represents a service message about a
|
|
611
|
-
export interface
|
|
612
|
-
/**
|
|
604
|
+
/** This object represents a service message about a video chat ended in the chat. */
|
|
605
|
+
export interface VideoChatEnded {
|
|
606
|
+
/** Video chat duration in seconds */
|
|
613
607
|
duration: number;
|
|
614
608
|
}
|
|
615
609
|
|
|
616
|
-
/** This object represents a service message about new members invited to a
|
|
617
|
-
export interface
|
|
618
|
-
/** New members that were invited to the
|
|
610
|
+
/** This object represents a service message about new members invited to a video chat. */
|
|
611
|
+
export interface VideoChatParticipantsInvited {
|
|
612
|
+
/** New members that were invited to the video chat */
|
|
619
613
|
users: User[];
|
|
620
614
|
}
|
|
621
615
|
|
|
616
|
+
/** Contains data sent from a Web App to the bot. */
|
|
617
|
+
export interface WebAppData {
|
|
618
|
+
/** The data. Be aware that a bad client can send arbitrary data in this field. */
|
|
619
|
+
data: string;
|
|
620
|
+
/** Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */
|
|
621
|
+
button_text: string;
|
|
622
|
+
}
|
|
623
|
+
|
|
622
624
|
/** This object represents a sticker. */
|
|
623
625
|
export interface Sticker {
|
|
624
626
|
/** Identifier for this file, which can be used to download or reuse the file */
|
|
@@ -665,7 +667,7 @@ export interface StickerSet {
|
|
|
665
667
|
|
|
666
668
|
/** This object describes the position on faces where a mask should be placed by default. */
|
|
667
669
|
export interface MaskPosition {
|
|
668
|
-
/** The part of the face relative to which the mask should be placed. One of
|
|
670
|
+
/** The part of the face relative to which the mask should be placed. One of "forehead", "eyes", "mouth", or "chin". */
|
|
669
671
|
point: "forehead" | "eyes" | "mouth" | "chin";
|
|
670
672
|
/** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
|
|
671
673
|
x_shift: number;
|
package/package.json
CHANGED
package/passport.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface PassportFile {
|
|
|
20
20
|
|
|
21
21
|
/** Contains information about documents or other Telegram Passport elements shared with the bot by the user. */
|
|
22
22
|
export interface EncryptedPassportElement {
|
|
23
|
-
/** Element type. One of
|
|
23
|
+
/** Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email". */
|
|
24
24
|
type:
|
|
25
25
|
| "personal_details"
|
|
26
26
|
| "passport"
|
|
@@ -35,21 +35,21 @@ export interface EncryptedPassportElement {
|
|
|
35
35
|
| "temporary_registration"
|
|
36
36
|
| "phone_number"
|
|
37
37
|
| "email";
|
|
38
|
-
/** Base64-encoded encrypted Telegram Passport element data provided by the user, available for
|
|
38
|
+
/** Base64-encoded encrypted Telegram Passport element data provided by the user, available for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
39
39
|
data?: string;
|
|
40
|
-
/** User's verified phone number, available only for
|
|
40
|
+
/** User's verified phone number, available only for "phone_number" type */
|
|
41
41
|
phone_number?: string;
|
|
42
|
-
/** User's verified email address, available only for
|
|
42
|
+
/** User's verified email address, available only for "email" type */
|
|
43
43
|
email?: string;
|
|
44
|
-
/** Array of encrypted files with documents provided by the user, available for
|
|
44
|
+
/** Array of encrypted files with documents provided by the user, available for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
45
45
|
files?: PassportFile[];
|
|
46
|
-
/** Encrypted file with the front side of the document, provided by the user. Available for
|
|
46
|
+
/** Encrypted file with the front side of the document, provided by the user. Available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
47
47
|
front_side?: PassportFile;
|
|
48
|
-
/** Encrypted file with the reverse side of the document, provided by the user. Available for
|
|
48
|
+
/** Encrypted file with the reverse side of the document, provided by the user. Available for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
49
49
|
reverse_side?: PassportFile;
|
|
50
|
-
/** Encrypted file with the selfie of the user holding a document, provided by the user; available for
|
|
50
|
+
/** Encrypted file with the selfie of the user holding a document, provided by the user; available for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
51
51
|
selfie?: PassportFile;
|
|
52
|
-
/** Array of encrypted files with translated versions of documents provided by the user. Available if requested for
|
|
52
|
+
/** Array of encrypted files with translated versions of documents provided by the user. Available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
|
|
53
53
|
translation?: PassportFile[];
|
|
54
54
|
/** Base64-encoded element hash for using in PassportElementErrorUnspecified */
|
|
55
55
|
hash: string;
|
|
@@ -91,7 +91,7 @@ export type PassportElementError =
|
|
|
91
91
|
export interface PassportElementErrorDataField {
|
|
92
92
|
/** Error source, must be data */
|
|
93
93
|
source: "data";
|
|
94
|
-
/** The section of the user's Telegram Passport which has the error, one of
|
|
94
|
+
/** The section of the user's Telegram Passport which has the error, one of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address" */
|
|
95
95
|
type:
|
|
96
96
|
| "personal_details"
|
|
97
97
|
| "passport"
|
|
@@ -111,7 +111,7 @@ export interface PassportElementErrorDataField {
|
|
|
111
111
|
export interface PassportElementErrorFrontSide {
|
|
112
112
|
/** Error source, must be front_side */
|
|
113
113
|
source: "front_side";
|
|
114
|
-
/** The section of the user's Telegram Passport which has the issue, one of
|
|
114
|
+
/** The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" */
|
|
115
115
|
type: "passport" | "driver_license" | "identity_card" | "internal_passport";
|
|
116
116
|
/** Base64-encoded hash of the file with the front side of the document */
|
|
117
117
|
file_hash: string;
|
|
@@ -123,7 +123,7 @@ export interface PassportElementErrorFrontSide {
|
|
|
123
123
|
export interface PassportElementErrorReverseSide {
|
|
124
124
|
/** Error source, must be reverse_side */
|
|
125
125
|
source: "reverse_side";
|
|
126
|
-
/** The section of the user's Telegram Passport which has the issue, one of
|
|
126
|
+
/** The section of the user's Telegram Passport which has the issue, one of "driver_license", "identity_card" */
|
|
127
127
|
type: "driver_license" | "identity_card";
|
|
128
128
|
/** Base64-encoded hash of the file with the reverse side of the document */
|
|
129
129
|
file_hash: string;
|
|
@@ -135,7 +135,7 @@ export interface PassportElementErrorReverseSide {
|
|
|
135
135
|
export interface PassportElementErrorSelfie {
|
|
136
136
|
/** Error source, must be selfie */
|
|
137
137
|
source: "selfie";
|
|
138
|
-
/** The section of the user's Telegram Passport which has the issue, one of
|
|
138
|
+
/** The section of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport" */
|
|
139
139
|
type: "passport" | "driver_license" | "identity_card" | "internal_passport";
|
|
140
140
|
/** Base64-encoded hash of the file with the selfie */
|
|
141
141
|
file_hash: string;
|
|
@@ -147,7 +147,7 @@ export interface PassportElementErrorSelfie {
|
|
|
147
147
|
export interface PassportElementErrorFile {
|
|
148
148
|
/** Error source, must be file */
|
|
149
149
|
source: "file";
|
|
150
|
-
/** The section of the user's Telegram Passport which has the issue, one of
|
|
150
|
+
/** The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */
|
|
151
151
|
type:
|
|
152
152
|
| "utility_bill"
|
|
153
153
|
| "bank_statement"
|
|
@@ -164,7 +164,7 @@ export interface PassportElementErrorFile {
|
|
|
164
164
|
export interface PassportElementErrorFiles {
|
|
165
165
|
/** Error source, must be files */
|
|
166
166
|
source: "files";
|
|
167
|
-
/** The section of the user's Telegram Passport which has the issue, one of
|
|
167
|
+
/** The section of the user's Telegram Passport which has the issue, one of "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */
|
|
168
168
|
type:
|
|
169
169
|
| "utility_bill"
|
|
170
170
|
| "bank_statement"
|
|
@@ -181,7 +181,7 @@ export interface PassportElementErrorFiles {
|
|
|
181
181
|
export interface PassportElementErrorTranslationFile {
|
|
182
182
|
/** Error source, must be translation_file */
|
|
183
183
|
source: "translation_file";
|
|
184
|
-
/** Type of element of the user's Telegram Passport which has the issue, one of
|
|
184
|
+
/** Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */
|
|
185
185
|
type:
|
|
186
186
|
| "passport"
|
|
187
187
|
| "driver_license"
|
|
@@ -202,7 +202,7 @@ export interface PassportElementErrorTranslationFile {
|
|
|
202
202
|
export interface PassportElementErrorTranslationFiles {
|
|
203
203
|
/** Error source, must be translation_files */
|
|
204
204
|
source: "translation_files";
|
|
205
|
-
/** Type of element of the user's Telegram Passport which has the issue, one of
|
|
205
|
+
/** Type of element of the user's Telegram Passport which has the issue, one of "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration" */
|
|
206
206
|
type:
|
|
207
207
|
| "passport"
|
|
208
208
|
| "driver_license"
|
package/proxied.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { BotCommandScope } from "./
|
|
1
|
+
import { BotCommandScope, MenuButton } from "./menu-button";
|
|
2
2
|
import {
|
|
3
3
|
ForceReply,
|
|
4
|
+
InlineKeyboardMarkup,
|
|
4
5
|
ReplyKeyboardMarkup,
|
|
5
6
|
ReplyKeyboardRemove,
|
|
6
|
-
} from "./
|
|
7
|
-
import {
|
|
7
|
+
} from "./markup";
|
|
8
|
+
import { InlineQueryResult } from "./inline";
|
|
8
9
|
import {
|
|
9
10
|
BotCommand,
|
|
11
|
+
ChatAdministratorRights,
|
|
10
12
|
ChatFromGetChat,
|
|
11
13
|
ChatInviteLink,
|
|
12
14
|
ChatMember,
|
|
@@ -24,6 +26,7 @@ import {
|
|
|
24
26
|
MessageId,
|
|
25
27
|
ParseMode,
|
|
26
28
|
Poll,
|
|
29
|
+
SentWebAppMessage,
|
|
27
30
|
StickerSet,
|
|
28
31
|
} from "./message";
|
|
29
32
|
import { PassportElementError } from "./passport";
|
|
@@ -42,7 +45,8 @@ export interface InputFileProxy<F> {
|
|
|
42
45
|
[M in keyof InputFileProxy<F>["Telegram"]]: Params<
|
|
43
46
|
M,
|
|
44
47
|
F
|
|
45
|
-
>[0] extends undefined
|
|
48
|
+
>[0] extends undefined
|
|
49
|
+
? {}
|
|
46
50
|
: NonNullable<Params<M, F>[0]>;
|
|
47
51
|
};
|
|
48
52
|
|
|
@@ -60,7 +64,7 @@ export interface InputFileProxy<F> {
|
|
|
60
64
|
limit?: number;
|
|
61
65
|
/** Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. */
|
|
62
66
|
timeout?: number;
|
|
63
|
-
/** A list of the update types you want your bot to receive. For example, specify [
|
|
67
|
+
/** A list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
|
|
64
68
|
|
|
65
69
|
Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time. */
|
|
66
70
|
allowed_updates?: readonly string[];
|
|
@@ -85,7 +89,7 @@ export interface InputFileProxy<F> {
|
|
|
85
89
|
ip_address?: string;
|
|
86
90
|
/** Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. */
|
|
87
91
|
max_connections?: number;
|
|
88
|
-
/** A list of the update types you want your bot to receive. For example, specify [
|
|
92
|
+
/** A list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.
|
|
89
93
|
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time. */
|
|
90
94
|
allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
|
|
91
95
|
/** Pass True to drop all pending updates */
|
|
@@ -230,7 +234,7 @@ export interface InputFileProxy<F> {
|
|
|
230
234
|
performer?: string;
|
|
231
235
|
/** Track name */
|
|
232
236
|
title?: string;
|
|
233
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
237
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
234
238
|
thumb?: F;
|
|
235
239
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
236
240
|
disable_notification?: boolean;
|
|
@@ -254,7 +258,7 @@ export interface InputFileProxy<F> {
|
|
|
254
258
|
chat_id: number | string;
|
|
255
259
|
/** File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. */
|
|
256
260
|
document: F | string;
|
|
257
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
261
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
258
262
|
thumb?: F;
|
|
259
263
|
/** Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing */
|
|
260
264
|
caption?: string;
|
|
@@ -292,7 +296,7 @@ export interface InputFileProxy<F> {
|
|
|
292
296
|
width?: number;
|
|
293
297
|
/** Video height */
|
|
294
298
|
height?: number;
|
|
295
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
299
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
296
300
|
thumb?: F;
|
|
297
301
|
/** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
|
|
298
302
|
caption?: string;
|
|
@@ -330,7 +334,7 @@ export interface InputFileProxy<F> {
|
|
|
330
334
|
width?: number;
|
|
331
335
|
/** Animation height */
|
|
332
336
|
height?: number;
|
|
333
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
337
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
334
338
|
thumb?: F;
|
|
335
339
|
/** Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing */
|
|
336
340
|
caption?: string;
|
|
@@ -395,7 +399,7 @@ export interface InputFileProxy<F> {
|
|
|
395
399
|
duration?: number;
|
|
396
400
|
/** Video width and height, i.e. diameter of the video message */
|
|
397
401
|
length?: number;
|
|
398
|
-
/**
|
|
402
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
399
403
|
thumb?: F;
|
|
400
404
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
401
405
|
disable_notification?: boolean;
|
|
@@ -519,7 +523,7 @@ export interface InputFileProxy<F> {
|
|
|
519
523
|
address: string;
|
|
520
524
|
/** Foursquare identifier of the venue */
|
|
521
525
|
foursquare_id?: string;
|
|
522
|
-
/** Foursquare type of the venue, if known. (For example,
|
|
526
|
+
/** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
|
|
523
527
|
foursquare_type?: string;
|
|
524
528
|
/** Google Places identifier of the venue */
|
|
525
529
|
google_place_id?: string;
|
|
@@ -579,7 +583,7 @@ export interface InputFileProxy<F> {
|
|
|
579
583
|
options: readonly string[];
|
|
580
584
|
/** True, if the poll needs to be anonymous, defaults to True */
|
|
581
585
|
is_anonymous?: boolean;
|
|
582
|
-
/** Poll type,
|
|
586
|
+
/** Poll type, "quiz" or "regular", defaults to "regular" */
|
|
583
587
|
type?: "quiz" | "regular";
|
|
584
588
|
/** True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False */
|
|
585
589
|
allows_multiple_answers?: boolean;
|
|
@@ -617,7 +621,7 @@ export interface InputFileProxy<F> {
|
|
|
617
621
|
sendDice(args: {
|
|
618
622
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
619
623
|
chat_id: number | string;
|
|
620
|
-
/** Emoji on which the dice throw animation is based. Currently, must be one of
|
|
624
|
+
/** Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲" */
|
|
621
625
|
emoji?: string;
|
|
622
626
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
623
627
|
disable_notification?: boolean;
|
|
@@ -637,7 +641,7 @@ export interface InputFileProxy<F> {
|
|
|
637
641
|
|
|
638
642
|
/** Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
|
|
639
643
|
|
|
640
|
-
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of
|
|
644
|
+
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait...", the bot may use sendChatAction with action = upload_photo. The user will see a "sending photo" status for the bot.
|
|
641
645
|
|
|
642
646
|
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
|
|
643
647
|
sendChatAction(args: {
|
|
@@ -730,8 +734,8 @@ export interface InputFileProxy<F> {
|
|
|
730
734
|
can_edit_messages?: boolean;
|
|
731
735
|
/** Pass True, if the administrator can delete messages of other users */
|
|
732
736
|
can_delete_messages?: boolean;
|
|
733
|
-
/** Pass True, if the administrator can manage
|
|
734
|
-
|
|
737
|
+
/** Pass True, if the administrator can manage video chats */
|
|
738
|
+
can_manage_video_chats?: boolean;
|
|
735
739
|
/** Pass True, if the administrator can restrict, ban or unban chat members */
|
|
736
740
|
can_restrict_members?: boolean;
|
|
737
741
|
/** Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) */
|
|
@@ -988,6 +992,34 @@ export interface InputFileProxy<F> {
|
|
|
988
992
|
language_code?: string;
|
|
989
993
|
}): BotCommand[];
|
|
990
994
|
|
|
995
|
+
/** Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success. */
|
|
996
|
+
setChatMenuButton(args: {
|
|
997
|
+
/** Unique identifier for the target private chat. If not specified, default bot's menu button will be changed */
|
|
998
|
+
chat_id?: number;
|
|
999
|
+
/** An object for the new bot's menu button. Defaults to MenuButtonDefault */
|
|
1000
|
+
menu_button?: MenuButton;
|
|
1001
|
+
}): true;
|
|
1002
|
+
|
|
1003
|
+
/** Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success. */
|
|
1004
|
+
getChatMenuButton(args: {
|
|
1005
|
+
/** Unique identifier for the target private chat. If not specified, default bot's menu button will be returned */
|
|
1006
|
+
chat_id?: number;
|
|
1007
|
+
}): MenuButton;
|
|
1008
|
+
|
|
1009
|
+
/** Use this method to the change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success. */
|
|
1010
|
+
setMyDefaultAdministratorRights(args: {
|
|
1011
|
+
/** An object describing new default administrator rights. If not specified, the default administrator rights will be cleared. */
|
|
1012
|
+
rights?: ChatAdministratorRights;
|
|
1013
|
+
/** Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed. */
|
|
1014
|
+
for_channels?: boolean;
|
|
1015
|
+
}): true;
|
|
1016
|
+
|
|
1017
|
+
/** Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success. */
|
|
1018
|
+
getMyDefaultAdministratorRights(args: {
|
|
1019
|
+
/** Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. */
|
|
1020
|
+
for_channels?: boolean;
|
|
1021
|
+
}): ChatAdministratorRights;
|
|
1022
|
+
|
|
991
1023
|
/** Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. */
|
|
992
1024
|
editMessageText(args: {
|
|
993
1025
|
/** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1124,7 +1156,7 @@ export interface InputFileProxy<F> {
|
|
|
1124
1156
|
createNewStickerSet(args: {
|
|
1125
1157
|
/** User identifier of created sticker set owner */
|
|
1126
1158
|
user_id: number;
|
|
1127
|
-
/** 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
|
|
1159
|
+
/** 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. */
|
|
1128
1160
|
name: string;
|
|
1129
1161
|
/** Sticker set title, 1-64 characters */
|
|
1130
1162
|
title: string;
|
|
@@ -1205,6 +1237,14 @@ export interface InputFileProxy<F> {
|
|
|
1205
1237
|
switch_pm_parameter?: string;
|
|
1206
1238
|
}): true;
|
|
1207
1239
|
|
|
1240
|
+
/** Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned. */
|
|
1241
|
+
answerWebAppQuery(args: {
|
|
1242
|
+
/** Unique identifier for the query to be answered */
|
|
1243
|
+
web_app_query_id: string;
|
|
1244
|
+
/** An object describing the message to be sent */
|
|
1245
|
+
result: InlineQueryResult;
|
|
1246
|
+
}): SentWebAppMessage;
|
|
1247
|
+
|
|
1208
1248
|
/** Use this method to send invoices. On success, the sent Message is returned. */
|
|
1209
1249
|
sendInvoice(args: {
|
|
1210
1250
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
@@ -1363,7 +1403,7 @@ export interface InputFileProxy<F> {
|
|
|
1363
1403
|
InputMediaPhoto: {
|
|
1364
1404
|
/** Type of the result, must be photo */
|
|
1365
1405
|
type: "photo";
|
|
1366
|
-
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
|
1406
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
1367
1407
|
media: F | string;
|
|
1368
1408
|
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
1369
1409
|
caption?: string;
|
|
@@ -1377,9 +1417,9 @@ export interface InputFileProxy<F> {
|
|
|
1377
1417
|
InputMediaVideo: {
|
|
1378
1418
|
/** Type of the result, must be video */
|
|
1379
1419
|
type: "video";
|
|
1380
|
-
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
|
1420
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
1381
1421
|
media: F | string;
|
|
1382
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
1422
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
1383
1423
|
thumb?: F;
|
|
1384
1424
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
1385
1425
|
caption?: string;
|
|
@@ -1401,9 +1441,9 @@ export interface InputFileProxy<F> {
|
|
|
1401
1441
|
InputMediaAnimation: {
|
|
1402
1442
|
/** Type of the result, must be animation */
|
|
1403
1443
|
type: "animation";
|
|
1404
|
-
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
|
1444
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
1405
1445
|
media: F | string;
|
|
1406
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
1446
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
1407
1447
|
thumb?: F;
|
|
1408
1448
|
/** Caption of the animation to be sent, 0-1024 characters after entities parsing */
|
|
1409
1449
|
caption?: string;
|
|
@@ -1423,9 +1463,9 @@ export interface InputFileProxy<F> {
|
|
|
1423
1463
|
InputMediaAudio: {
|
|
1424
1464
|
/** Type of the result, must be audio */
|
|
1425
1465
|
type: "audio";
|
|
1426
|
-
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
|
1466
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
1427
1467
|
media: F | string;
|
|
1428
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
1468
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
1429
1469
|
thumb?: F;
|
|
1430
1470
|
/** Caption of the audio to be sent, 0-1024 characters after entities parsing */
|
|
1431
1471
|
caption?: string;
|
|
@@ -1445,9 +1485,9 @@ export interface InputFileProxy<F> {
|
|
|
1445
1485
|
InputMediaDocument: {
|
|
1446
1486
|
/** Type of the result, must be document */
|
|
1447
1487
|
type: "document";
|
|
1448
|
-
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
|
1488
|
+
/** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. */
|
|
1449
1489
|
media: F | string;
|
|
1450
|
-
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass
|
|
1490
|
+
/** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. */
|
|
1451
1491
|
thumb?: F;
|
|
1452
1492
|
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
|
|
1453
1493
|
caption?: string;
|
package/update.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallbackQuery } from "./
|
|
1
|
+
import { CallbackQuery } from "./markup";
|
|
2
2
|
import { ChosenInlineResult, InlineQuery } from "./inline";
|
|
3
3
|
import { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage";
|
|
4
4
|
import { Message, Poll, PollAnswer } from "./message";
|