@grammyjs/types 2.2.5 → 2.4.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/bot-command-scope.d.ts +4 -4
- package/inline.d.ts +6 -6
- package/manage.d.ts +28 -8
- package/message.d.ts +65 -45
- package/package.json +1 -1
- package/passport.d.ts +1 -1
- package/proxied.d.ts +86 -44
- package/update.d.ts +3 -1
package/bot-command-scope.d.ts
CHANGED
|
@@ -22,12 +22,12 @@ The following algorithm is used to determine the list of commands for a particul
|
|
|
22
22
|
### Commands in group and supergroup chats
|
|
23
23
|
- botCommandScopeChatMember + language_code
|
|
24
24
|
- botCommandScopeChatMember
|
|
25
|
-
- botCommandScopeChatAdministrators + language_code (
|
|
26
|
-
- botCommandScopeChatAdministrators (
|
|
25
|
+
- botCommandScopeChatAdministrators + language_code (administrators only)
|
|
26
|
+
- botCommandScopeChatAdministrators (administrators only)
|
|
27
27
|
- botCommandScopeChat + language_code
|
|
28
28
|
- botCommandScopeChat
|
|
29
|
-
- botCommandScopeAllChatAdministrators + language_code (
|
|
30
|
-
- botCommandScopeAllChatAdministrators (
|
|
29
|
+
- botCommandScopeAllChatAdministrators + language_code (administrators only)
|
|
30
|
+
- botCommandScopeAllChatAdministrators (administrators only)
|
|
31
31
|
- botCommandScopeAllGroupChats + language_code
|
|
32
32
|
- botCommandScopeAllGroupChats
|
|
33
33
|
- botCommandScopeDefault + language_code
|
package/inline.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export namespace InlineKeyboardButton {
|
|
|
30
30
|
text: string;
|
|
31
31
|
}
|
|
32
32
|
export interface UrlButton extends AbstractInlineKeyboardButton {
|
|
33
|
-
/** HTTP or tg:// url to be opened when button is pressed */
|
|
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
34
|
url: string;
|
|
35
35
|
}
|
|
36
36
|
export interface LoginButton extends AbstractInlineKeyboardButton {
|
|
@@ -63,7 +63,7 @@ export namespace InlineKeyboardButton {
|
|
|
63
63
|
export interface PayButton extends AbstractInlineKeyboardButton {
|
|
64
64
|
/** Specify True, to send a Pay button.
|
|
65
65
|
|
|
66
|
-
NOTE: This type of button must always be the first button in the first row. */
|
|
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
67
|
pay: boolean;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -209,7 +209,7 @@ export interface InlineQueryResultGif {
|
|
|
209
209
|
gif_width?: number;
|
|
210
210
|
/** Height of the GIF */
|
|
211
211
|
gif_height?: number;
|
|
212
|
-
/** Duration of the GIF */
|
|
212
|
+
/** Duration of the GIF in seconds */
|
|
213
213
|
gif_duration?: number;
|
|
214
214
|
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
215
215
|
thumb_url: string;
|
|
@@ -239,7 +239,7 @@ export interface InlineQueryResultMpeg4Gif {
|
|
|
239
239
|
mpeg4_width?: number;
|
|
240
240
|
/** Video height */
|
|
241
241
|
mpeg4_height?: number;
|
|
242
|
-
/** Video duration */
|
|
242
|
+
/** Video duration in seconds */
|
|
243
243
|
mpeg4_duration?: number;
|
|
244
244
|
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
245
245
|
thumb_url: string;
|
|
@@ -269,7 +269,7 @@ export interface InlineQueryResultVideo {
|
|
|
269
269
|
video_url: string;
|
|
270
270
|
/** Mime type of the content of video url, “text/html” or “video/mp4” */
|
|
271
271
|
mime_type: "text/html" | "video/mp4";
|
|
272
|
-
/** URL of the thumbnail (
|
|
272
|
+
/** URL of the thumbnail (JPEG only) for the video */
|
|
273
273
|
thumb_url: string;
|
|
274
274
|
/** Title for the result */
|
|
275
275
|
title: string;
|
|
@@ -371,7 +371,7 @@ export interface InlineQueryResultDocument {
|
|
|
371
371
|
reply_markup?: InlineKeyboardMarkup;
|
|
372
372
|
/** Content of the message to be sent instead of the file */
|
|
373
373
|
input_message_content?: InputMessageContent;
|
|
374
|
-
/** URL of the thumbnail (
|
|
374
|
+
/** URL of the thumbnail (JPEG only) for the file */
|
|
375
375
|
thumb_url?: string;
|
|
376
376
|
/** Thumbnail width */
|
|
377
377
|
thumb_width?: number;
|
package/manage.d.ts
CHANGED
|
@@ -86,9 +86,7 @@ export namespace Chat {
|
|
|
86
86
|
}
|
|
87
87
|
/** Internal type representing super group chats. */
|
|
88
88
|
export interface SupergroupChat
|
|
89
|
-
extends AbstractChat,
|
|
90
|
-
UserNameChat,
|
|
91
|
-
TitleChat {
|
|
89
|
+
extends AbstractChat, UserNameChat, TitleChat {
|
|
92
90
|
type: "supergroup";
|
|
93
91
|
}
|
|
94
92
|
/** Internal type representing channel chats. */
|
|
@@ -105,6 +103,8 @@ export namespace Chat {
|
|
|
105
103
|
pinned_message?: Message;
|
|
106
104
|
/** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
|
|
107
105
|
message_auto_delete_time?: number;
|
|
106
|
+
/** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
|
|
107
|
+
has_protected_content?: true;
|
|
108
108
|
}
|
|
109
109
|
/** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
|
|
110
110
|
interface NonPrivateGetChat extends GetChat {
|
|
@@ -131,15 +131,15 @@ export namespace Chat {
|
|
|
131
131
|
export interface PrivateGetChat extends PrivateChat, GetChat {
|
|
132
132
|
/** Bio of the other party in a private chat. Returned only in getChat. */
|
|
133
133
|
bio?: string;
|
|
134
|
+
/** True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat. */
|
|
135
|
+
has_private_forwards?: true;
|
|
134
136
|
}
|
|
135
137
|
/** Internal type representing group chats returned from `getChat`. */
|
|
136
138
|
export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
|
|
137
139
|
/** Internal type representing supergroup chats returned from `getChat`. */
|
|
138
140
|
export interface SupergroupGetChat
|
|
139
|
-
extends SupergroupChat,
|
|
140
|
-
|
|
141
|
-
LargeGetChat {
|
|
142
|
-
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. Returned only in getChat. */
|
|
141
|
+
extends SupergroupChat, MultiUserGetChat, LargeGetChat {
|
|
142
|
+
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
|
|
143
143
|
slow_mode_delay?: number;
|
|
144
144
|
/** For supergroups, name of group sticker set. Returned only in getChat. */
|
|
145
145
|
sticker_set_name?: string;
|
|
@@ -190,14 +190,20 @@ export interface ChatInviteLink {
|
|
|
190
190
|
invite_link: string;
|
|
191
191
|
/** Creator of the link */
|
|
192
192
|
creator: User;
|
|
193
|
+
/** True, if users joining the chat via the link need to be approved by chat administrators */
|
|
194
|
+
creates_join_request: boolean;
|
|
193
195
|
/** True, if the link is primary */
|
|
194
196
|
is_primary: boolean;
|
|
195
197
|
/** True, if the link is revoked */
|
|
196
198
|
is_revoked: boolean;
|
|
199
|
+
/** Invite link name */
|
|
200
|
+
name?: string;
|
|
197
201
|
/** Point in time (Unix timestamp) when the link will expire or has been expired */
|
|
198
202
|
expire_date?: number;
|
|
199
203
|
/** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
|
|
200
204
|
member_limit?: number;
|
|
205
|
+
/** Number of pending join requests created using this link */
|
|
206
|
+
pending_join_request_count?: number;
|
|
201
207
|
}
|
|
202
208
|
|
|
203
209
|
/** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
|
|
@@ -331,6 +337,20 @@ export interface ChatMemberUpdated {
|
|
|
331
337
|
invite_link?: ChatInviteLink;
|
|
332
338
|
}
|
|
333
339
|
|
|
340
|
+
/** Represents a join request sent to a chat. */
|
|
341
|
+
export interface ChatJoinRequest {
|
|
342
|
+
/** Chat to which the request was sent */
|
|
343
|
+
chat: Chat;
|
|
344
|
+
/** User that sent the join request */
|
|
345
|
+
from: User;
|
|
346
|
+
/** Date the request was sent in Unix time */
|
|
347
|
+
date: number;
|
|
348
|
+
/** Bio of the user. */
|
|
349
|
+
bio?: string;
|
|
350
|
+
/** Chat invite link that was used by the user to send the join request */
|
|
351
|
+
invite_link?: ChatInviteLink;
|
|
352
|
+
}
|
|
353
|
+
|
|
334
354
|
/** Describes actions that a non-administrator user is allowed to take in a chat. */
|
|
335
355
|
export interface ChatPermissions {
|
|
336
356
|
/** True, if the user is allowed to send text messages, contacts, locations and venues */
|
|
@@ -373,7 +393,7 @@ export interface File {
|
|
|
373
393
|
file_id: string;
|
|
374
394
|
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
|
|
375
395
|
file_unique_id: string;
|
|
376
|
-
/** File size, if known */
|
|
396
|
+
/** File size in bytes, if known */
|
|
377
397
|
file_size?: number;
|
|
378
398
|
/** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
|
|
379
399
|
file_path?: string;
|
package/message.d.ts
CHANGED
|
@@ -31,12 +31,16 @@ export namespace Message {
|
|
|
31
31
|
forward_sender_name?: string;
|
|
32
32
|
/** For forwarded messages, date the original message was sent in Unix time */
|
|
33
33
|
forward_date?: number;
|
|
34
|
+
/** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
35
|
+
is_automatic_forward?: true;
|
|
34
36
|
/** For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
|
|
35
37
|
reply_to_message?: ReplyMessage;
|
|
36
38
|
/** Bot through which the message was sent */
|
|
37
39
|
via_bot?: User;
|
|
38
40
|
/** Date the message was last edited in Unix time */
|
|
39
41
|
edit_date?: number;
|
|
42
|
+
/** True, if the message can't be forwarded */
|
|
43
|
+
has_protected_content?: true;
|
|
40
44
|
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
41
45
|
author_signature?: string;
|
|
42
46
|
/** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
|
|
@@ -68,43 +72,59 @@ export namespace Message {
|
|
|
68
72
|
export type PollMessage = CommonMessage & MsgWith<"poll">;
|
|
69
73
|
export type LocationMessage = CommonMessage & MsgWith<"location">;
|
|
70
74
|
export type VenueMessage = LocationMessage & MsgWith<"venue">;
|
|
71
|
-
export type NewChatMembersMessage =
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
export type NewChatMembersMessage =
|
|
76
|
+
& ServiceMessage
|
|
77
|
+
& MsgWith<"new_chat_members">;
|
|
78
|
+
export type LeftChatMemberMessage =
|
|
79
|
+
& ServiceMessage
|
|
80
|
+
& MsgWith<"left_chat_member">;
|
|
75
81
|
export type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">;
|
|
76
82
|
export type NewChatPhotoMessage = ServiceMessage & MsgWith<"new_chat_photo">;
|
|
77
|
-
export type DeleteChatPhotoMessage =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
MsgWith<"
|
|
83
|
-
export type
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
MsgWith<"
|
|
89
|
-
export type
|
|
90
|
-
|
|
83
|
+
export type DeleteChatPhotoMessage =
|
|
84
|
+
& ServiceMessage
|
|
85
|
+
& MsgWith<"delete_chat_photo">;
|
|
86
|
+
export type GroupChatCreatedMessage =
|
|
87
|
+
& ServiceMessage
|
|
88
|
+
& MsgWith<"group_chat_created">;
|
|
89
|
+
export type SupergroupChatCreated =
|
|
90
|
+
& ServiceMessage
|
|
91
|
+
& MsgWith<"supergroup_chat_created">;
|
|
92
|
+
export type ChannelChatCreatedMessage =
|
|
93
|
+
& ServiceMessage
|
|
94
|
+
& MsgWith<"channel_chat_created">;
|
|
95
|
+
export type MessageAutoDeleteTimerChangedMessage =
|
|
96
|
+
& ServiceMessage
|
|
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">;
|
|
91
104
|
export type PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">;
|
|
92
105
|
export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">;
|
|
93
|
-
export type SuccessfulPaymentMessage =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
export type SuccessfulPaymentMessage =
|
|
107
|
+
& ServiceMessage
|
|
108
|
+
& MsgWith<"successful_payment">;
|
|
109
|
+
export type ConnectedWebsiteMessage =
|
|
110
|
+
& ServiceMessage
|
|
111
|
+
& MsgWith<"connected_website">;
|
|
97
112
|
export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
|
|
98
|
-
export type ProximityAlertTriggeredMessage =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
MsgWith<"
|
|
104
|
-
export type
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
113
|
+
export type ProximityAlertTriggeredMessage =
|
|
114
|
+
& ServiceMessage
|
|
115
|
+
& MsgWith<"proximity_alert_triggered">;
|
|
116
|
+
export type VoiceChatScheduledMessage =
|
|
117
|
+
& ServiceMessage
|
|
118
|
+
& MsgWith<"voice_chat_scheduled">;
|
|
119
|
+
export type VoiceChatStartedMessage =
|
|
120
|
+
& ServiceMessage
|
|
121
|
+
& MsgWith<"voice_chat_started">;
|
|
122
|
+
export type VoiceChatEndedMessage =
|
|
123
|
+
& ServiceMessage
|
|
124
|
+
& MsgWith<"voice_chat_ended">;
|
|
125
|
+
export type VoiceChatParticipantsInvitedMessage =
|
|
126
|
+
& ServiceMessage
|
|
127
|
+
& MsgWith<"voice_chat_participants_invited">;
|
|
108
128
|
}
|
|
109
129
|
|
|
110
130
|
type ReplyMessage = Message & { reply_to_message: undefined };
|
|
@@ -203,8 +223,8 @@ Message entities can be nested, providing following restrictions are met:
|
|
|
203
223
|
|
|
204
224
|
Links `tg://user?id=<user_id>` can be used to mention a user by their ID without using a username. Please note:
|
|
205
225
|
|
|
206
|
-
- These links will work only if they are used inside an inline link. For example, they will not work, when used in
|
|
207
|
-
- These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via inline button or is a member in the group where he was mentioned.
|
|
226
|
+
- These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.
|
|
227
|
+
- These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via an inline button or is a member in the group where he was mentioned.
|
|
208
228
|
|
|
209
229
|
#### MarkdownV2 style
|
|
210
230
|
To use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
|
|
@@ -339,7 +359,7 @@ export interface PhotoSize {
|
|
|
339
359
|
width: number;
|
|
340
360
|
/** Photo height */
|
|
341
361
|
height: number;
|
|
342
|
-
/** File size */
|
|
362
|
+
/** File size in bytes */
|
|
343
363
|
file_size?: number;
|
|
344
364
|
}
|
|
345
365
|
|
|
@@ -361,7 +381,7 @@ export interface Animation {
|
|
|
361
381
|
file_name?: string;
|
|
362
382
|
/** MIME type of the file as defined by sender */
|
|
363
383
|
mime_type?: string;
|
|
364
|
-
/** File size */
|
|
384
|
+
/** File size in bytes */
|
|
365
385
|
file_size?: number;
|
|
366
386
|
}
|
|
367
387
|
|
|
@@ -381,7 +401,7 @@ export interface Audio {
|
|
|
381
401
|
file_name?: string;
|
|
382
402
|
/** MIME type of the file as defined by sender */
|
|
383
403
|
mime_type?: string;
|
|
384
|
-
/** File size */
|
|
404
|
+
/** File size in bytes */
|
|
385
405
|
file_size?: number;
|
|
386
406
|
/** Thumbnail of the album cover to which the music file belongs */
|
|
387
407
|
thumb?: PhotoSize;
|
|
@@ -399,7 +419,7 @@ export interface Document {
|
|
|
399
419
|
file_name?: string;
|
|
400
420
|
/** MIME type of the file as defined by sender */
|
|
401
421
|
mime_type?: string;
|
|
402
|
-
/** File size */
|
|
422
|
+
/** File size in bytes */
|
|
403
423
|
file_size?: number;
|
|
404
424
|
}
|
|
405
425
|
|
|
@@ -421,7 +441,7 @@ export interface Video {
|
|
|
421
441
|
file_name?: string;
|
|
422
442
|
/** Mime type of a file as defined by sender */
|
|
423
443
|
mime_type?: string;
|
|
424
|
-
/** File size */
|
|
444
|
+
/** File size in bytes */
|
|
425
445
|
file_size?: number;
|
|
426
446
|
}
|
|
427
447
|
|
|
@@ -437,7 +457,7 @@ export interface VideoNote {
|
|
|
437
457
|
duration: number;
|
|
438
458
|
/** Video thumbnail */
|
|
439
459
|
thumb?: PhotoSize;
|
|
440
|
-
/** File size */
|
|
460
|
+
/** File size in bytes */
|
|
441
461
|
file_size?: number;
|
|
442
462
|
}
|
|
443
463
|
|
|
@@ -451,7 +471,7 @@ export interface Voice {
|
|
|
451
471
|
duration: number;
|
|
452
472
|
/** MIME type of the file as defined by sender */
|
|
453
473
|
mime_type?: string;
|
|
454
|
-
/** File size */
|
|
474
|
+
/** File size in bytes */
|
|
455
475
|
file_size?: number;
|
|
456
476
|
}
|
|
457
477
|
|
|
@@ -533,7 +553,7 @@ export interface Location {
|
|
|
533
553
|
latitude: number;
|
|
534
554
|
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
|
|
535
555
|
horizontal_accuracy?: number;
|
|
536
|
-
/** Time relative to the message sending date, during which the location can be updated
|
|
556
|
+
/** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
|
|
537
557
|
live_period?: number;
|
|
538
558
|
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
|
|
539
559
|
heading?: number;
|
|
@@ -571,7 +591,7 @@ export interface ProximityAlertTriggered {
|
|
|
571
591
|
|
|
572
592
|
/** This object represents a service message about a change in auto-delete timer settings. */
|
|
573
593
|
export interface MessageAutoDeleteTimerChanged {
|
|
574
|
-
/** New auto-delete time for messages in the chat */
|
|
594
|
+
/** New auto-delete time for messages in the chat; in seconds */
|
|
575
595
|
message_auto_delete_time: number;
|
|
576
596
|
}
|
|
577
597
|
|
|
@@ -586,7 +606,7 @@ export interface VoiceChatStarted {}
|
|
|
586
606
|
|
|
587
607
|
/** This object represents a service message about a voice chat ended in the chat. */
|
|
588
608
|
export interface VoiceChatEnded {
|
|
589
|
-
/** Voice chat duration
|
|
609
|
+
/** Voice chat duration in seconds */
|
|
590
610
|
duration: number;
|
|
591
611
|
}
|
|
592
612
|
|
|
@@ -616,7 +636,7 @@ export interface Sticker {
|
|
|
616
636
|
set_name?: string;
|
|
617
637
|
/** For mask stickers, the position where the mask should be placed */
|
|
618
638
|
mask_position?: MaskPosition;
|
|
619
|
-
/** File size */
|
|
639
|
+
/** File size in bytes */
|
|
620
640
|
file_size?: number;
|
|
621
641
|
}
|
|
622
642
|
|
package/package.json
CHANGED
package/passport.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface PassportFile {
|
|
|
12
12
|
file_id: string;
|
|
13
13
|
/** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
|
|
14
14
|
file_unique_id: string;
|
|
15
|
-
/** File size */
|
|
15
|
+
/** File size in bytes */
|
|
16
16
|
file_size: number;
|
|
17
17
|
/** Unix time when the file was uploaded */
|
|
18
18
|
file_date: number;
|
package/proxied.d.ts
CHANGED
|
@@ -42,8 +42,7 @@ export interface InputFileProxy<F> {
|
|
|
42
42
|
[M in keyof InputFileProxy<F>["Telegram"]]: Params<
|
|
43
43
|
M,
|
|
44
44
|
F
|
|
45
|
-
>[0] extends undefined
|
|
46
|
-
? {}
|
|
45
|
+
>[0] extends undefined ? {}
|
|
47
46
|
: NonNullable<Params<M, F>[0]>;
|
|
48
47
|
};
|
|
49
48
|
|
|
@@ -102,7 +101,7 @@ export interface InputFileProxy<F> {
|
|
|
102
101
|
/** Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty. */
|
|
103
102
|
getWebhookInfo(): WebhookInfo;
|
|
104
103
|
|
|
105
|
-
/** A simple method for testing your bot's
|
|
104
|
+
/** A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object. */
|
|
106
105
|
getMe(): UserFromGetMe;
|
|
107
106
|
|
|
108
107
|
/** Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters. */
|
|
@@ -119,7 +118,7 @@ export interface InputFileProxy<F> {
|
|
|
119
118
|
text: string;
|
|
120
119
|
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
121
120
|
parse_mode?: ParseMode;
|
|
122
|
-
/**
|
|
121
|
+
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
123
122
|
entities?: MessageEntity[];
|
|
124
123
|
/** Boolean Disables link previews for links in this message */
|
|
125
124
|
disable_web_page_preview?: boolean;
|
|
@@ -161,7 +160,7 @@ export interface InputFileProxy<F> {
|
|
|
161
160
|
caption?: string;
|
|
162
161
|
/** Mode for parsing entities in the new caption. See formatting options for more details. */
|
|
163
162
|
parse_mode?: string;
|
|
164
|
-
/**
|
|
163
|
+
/** A list of special entities that appear in the new caption, which can be specified instead of parse_mode */
|
|
165
164
|
caption_entities?: MessageEntity[];
|
|
166
165
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
167
166
|
disable_notification?: boolean;
|
|
@@ -187,7 +186,7 @@ export interface InputFileProxy<F> {
|
|
|
187
186
|
caption?: string;
|
|
188
187
|
/** Mode for parsing entities in the photo caption. See formatting options for more details. */
|
|
189
188
|
parse_mode?: ParseMode;
|
|
190
|
-
/**
|
|
189
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
191
190
|
caption_entities?: MessageEntity[];
|
|
192
191
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
193
192
|
disable_notification?: boolean;
|
|
@@ -215,7 +214,7 @@ export interface InputFileProxy<F> {
|
|
|
215
214
|
caption?: string;
|
|
216
215
|
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
|
|
217
216
|
parse_mode?: ParseMode;
|
|
218
|
-
/**
|
|
217
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
219
218
|
caption_entities?: MessageEntity[];
|
|
220
219
|
/** Duration of the audio in seconds */
|
|
221
220
|
duration?: number;
|
|
@@ -224,7 +223,7 @@ export interface InputFileProxy<F> {
|
|
|
224
223
|
/** Track name */
|
|
225
224
|
title?: string;
|
|
226
225
|
/** 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>. */
|
|
227
|
-
thumb?: F
|
|
226
|
+
thumb?: F;
|
|
228
227
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
229
228
|
disable_notification?: boolean;
|
|
230
229
|
/** If the message is a reply, ID of the original message */
|
|
@@ -246,12 +245,12 @@ export interface InputFileProxy<F> {
|
|
|
246
245
|
/** 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. */
|
|
247
246
|
document: F | string;
|
|
248
247
|
/** 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>. */
|
|
249
|
-
thumb?: F
|
|
248
|
+
thumb?: F;
|
|
250
249
|
/** Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing */
|
|
251
250
|
caption?: string;
|
|
252
251
|
/** Mode for parsing entities in the document caption. See formatting options for more details. */
|
|
253
252
|
parse_mode?: ParseMode;
|
|
254
|
-
/**
|
|
253
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
255
254
|
caption_entities?: MessageEntity[];
|
|
256
255
|
/** Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album. */
|
|
257
256
|
disable_content_type_detection?: boolean;
|
|
@@ -282,12 +281,12 @@ export interface InputFileProxy<F> {
|
|
|
282
281
|
/** Video height */
|
|
283
282
|
height?: number;
|
|
284
283
|
/** 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>. */
|
|
285
|
-
thumb?: F
|
|
284
|
+
thumb?: F;
|
|
286
285
|
/** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
|
|
287
286
|
caption?: string;
|
|
288
287
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
289
288
|
parse_mode?: ParseMode;
|
|
290
|
-
/**
|
|
289
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
291
290
|
caption_entities?: MessageEntity[];
|
|
292
291
|
/** Pass True, if the uploaded video is suitable for streaming */
|
|
293
292
|
supports_streaming?: boolean;
|
|
@@ -318,12 +317,12 @@ export interface InputFileProxy<F> {
|
|
|
318
317
|
/** Animation height */
|
|
319
318
|
height?: number;
|
|
320
319
|
/** 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>. */
|
|
321
|
-
thumb?: F
|
|
320
|
+
thumb?: F;
|
|
322
321
|
/** Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing */
|
|
323
322
|
caption?: string;
|
|
324
323
|
/** Mode for parsing entities in the animation caption. See formatting options for more details. */
|
|
325
324
|
parse_mode?: ParseMode;
|
|
326
|
-
/**
|
|
325
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
327
326
|
caption_entities?: MessageEntity[];
|
|
328
327
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
329
328
|
disable_notification?: boolean;
|
|
@@ -349,7 +348,7 @@ export interface InputFileProxy<F> {
|
|
|
349
348
|
caption?: string;
|
|
350
349
|
/** Mode for parsing entities in the voice message caption. See formatting options for more details. */
|
|
351
350
|
parse_mode?: ParseMode;
|
|
352
|
-
/**
|
|
351
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
353
352
|
caption_entities?: MessageEntity[];
|
|
354
353
|
/** Duration of the voice message in seconds */
|
|
355
354
|
duration?: number;
|
|
@@ -379,7 +378,7 @@ export interface InputFileProxy<F> {
|
|
|
379
378
|
/** Video width and height, i.e. diameter of the video message */
|
|
380
379
|
length?: number;
|
|
381
380
|
/** 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>. */
|
|
382
|
-
thumb?: F
|
|
381
|
+
thumb?: F;
|
|
383
382
|
/** Sends the message silently. Users will receive a notification with no sound. */
|
|
384
383
|
disable_notification?: boolean;
|
|
385
384
|
/** If the message is a reply, ID of the original message */
|
|
@@ -562,7 +561,7 @@ export interface InputFileProxy<F> {
|
|
|
562
561
|
explanation?: string;
|
|
563
562
|
/** Mode for parsing entities in the explanation. See formatting options for more details. */
|
|
564
563
|
explanation_parse_mode?: ParseMode;
|
|
565
|
-
/**
|
|
564
|
+
/** A list of special entities that appear in the poll explanation, which can be specified instead of parse_mode */
|
|
566
565
|
explanation_entities?: MessageEntity[];
|
|
567
566
|
/** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */
|
|
568
567
|
open_period?: number;
|
|
@@ -612,7 +611,7 @@ export interface InputFileProxy<F> {
|
|
|
612
611
|
sendChatAction(args: {
|
|
613
612
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
614
613
|
chat_id: number | string;
|
|
615
|
-
/** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. */
|
|
614
|
+
/** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. */
|
|
616
615
|
action:
|
|
617
616
|
| "typing"
|
|
618
617
|
| "upload_photo"
|
|
@@ -621,6 +620,7 @@ export interface InputFileProxy<F> {
|
|
|
621
620
|
| "record_voice"
|
|
622
621
|
| "upload_voice"
|
|
623
622
|
| "upload_document"
|
|
623
|
+
| "choose_sticker"
|
|
624
624
|
| "find_location"
|
|
625
625
|
| "record_video_note"
|
|
626
626
|
| "upload_video_note";
|
|
@@ -644,11 +644,11 @@ export interface InputFileProxy<F> {
|
|
|
644
644
|
file_id: string;
|
|
645
645
|
}): File;
|
|
646
646
|
|
|
647
|
-
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat 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
|
|
647
|
+
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat 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 administrator rights. Returns True on success.
|
|
648
648
|
* @deprecated Use `banChatMember` instead. */
|
|
649
649
|
kickChatMember: InputFileProxy<F>["Telegram"]["banChatMember"];
|
|
650
650
|
|
|
651
|
-
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat 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
|
|
651
|
+
/** Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat 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 administrator rights. Returns True on success. */
|
|
652
652
|
banChatMember(args: {
|
|
653
653
|
/** Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) */
|
|
654
654
|
chat_id: number | string;
|
|
@@ -670,7 +670,7 @@ export interface InputFileProxy<F> {
|
|
|
670
670
|
only_if_banned?: boolean;
|
|
671
671
|
}): true;
|
|
672
672
|
|
|
673
|
-
/** Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate
|
|
673
|
+
/** Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. */
|
|
674
674
|
restrictChatMember(args: {
|
|
675
675
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
676
676
|
chat_id: number | string;
|
|
@@ -682,7 +682,7 @@ export interface InputFileProxy<F> {
|
|
|
682
682
|
until_date?: number;
|
|
683
683
|
}): true;
|
|
684
684
|
|
|
685
|
-
/** Use this method to 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
|
|
685
|
+
/** Use this method to 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 administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success. */
|
|
686
686
|
promoteChatMember(args: {
|
|
687
687
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
688
688
|
chat_id: number | string;
|
|
@@ -722,15 +722,33 @@ export interface InputFileProxy<F> {
|
|
|
722
722
|
custom_title: string;
|
|
723
723
|
}): true;
|
|
724
724
|
|
|
725
|
-
/** Use this method to
|
|
725
|
+
/** Use this method to ban a channel chat in a supergroup or a channel. The owner of the chat will not be able to send messages and join live streams on behalf of the chat, unless it is unbanned first. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
726
|
+
banChatSenderChat(args: {
|
|
727
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
728
|
+
chat_id: number | string;
|
|
729
|
+
/** Unique identifier of the target sender chat */
|
|
730
|
+
sender_chat_id: number;
|
|
731
|
+
/** Date when the sender chat will be unbanned, unix time. If the chat is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. */
|
|
732
|
+
until_date?: number;
|
|
733
|
+
}): true;
|
|
734
|
+
|
|
735
|
+
/** Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
736
|
+
unbanChatSenderChat(args: {
|
|
737
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
738
|
+
chat_id: number | string;
|
|
739
|
+
/** Unique identifier of the target sender chat */
|
|
740
|
+
sender_chat_id: number;
|
|
741
|
+
}): true;
|
|
742
|
+
|
|
743
|
+
/** Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success. */
|
|
726
744
|
setChatPermissions(args: {
|
|
727
745
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
728
746
|
chat_id: number | string;
|
|
729
|
-
/**
|
|
747
|
+
/** An object for new default chat permissions */
|
|
730
748
|
permissions: ChatPermissions;
|
|
731
749
|
}): true;
|
|
732
750
|
|
|
733
|
-
/** Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
751
|
+
/** Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
|
|
734
752
|
|
|
735
753
|
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again. */
|
|
736
754
|
exportChatInviteLink(args: {
|
|
@@ -738,29 +756,37 @@ export interface InputFileProxy<F> {
|
|
|
738
756
|
chat_id: number | string;
|
|
739
757
|
}): string;
|
|
740
758
|
|
|
741
|
-
/** Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
759
|
+
/** Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object. */
|
|
742
760
|
createChatInviteLink(args: {
|
|
743
761
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
744
762
|
chat_id: number | string;
|
|
763
|
+
/** Invite link name; 0-32 characters */
|
|
764
|
+
name?: string;
|
|
745
765
|
/** Point in time (Unix timestamp) when the link will expire */
|
|
746
766
|
expire_date?: number;
|
|
747
767
|
/** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
|
|
748
768
|
member_limit?: number;
|
|
769
|
+
/** True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified */
|
|
770
|
+
creates_join_request?: boolean;
|
|
749
771
|
}): ChatInviteLink;
|
|
750
772
|
|
|
751
|
-
/** Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
773
|
+
/** Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object. */
|
|
752
774
|
editChatInviteLink(args: {
|
|
753
775
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
754
776
|
chat_id: number | string;
|
|
755
777
|
/** The invite link to edit */
|
|
756
778
|
invite_link: string;
|
|
779
|
+
/** Invite link name; 0-32 characters */
|
|
780
|
+
name?: string;
|
|
757
781
|
/** Point in time (Unix timestamp) when the link will expire */
|
|
758
782
|
expire_date?: number;
|
|
759
783
|
/** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
|
|
760
784
|
member_limit?: number;
|
|
785
|
+
/** True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified */
|
|
786
|
+
creates_join_request?: boolean;
|
|
761
787
|
}): ChatInviteLink;
|
|
762
788
|
|
|
763
|
-
/** Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
789
|
+
/** Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object. */
|
|
764
790
|
revokeChatInviteLink(args: {
|
|
765
791
|
/** Unique identifier of the target chat or username of the target channel (in the format @channelusername) */
|
|
766
792
|
chat_id: number | string;
|
|
@@ -768,7 +794,23 @@ export interface InputFileProxy<F> {
|
|
|
768
794
|
invite_link: string;
|
|
769
795
|
}): ChatInviteLink;
|
|
770
796
|
|
|
771
|
-
/** Use this method to
|
|
797
|
+
/** Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. */
|
|
798
|
+
approveChatJoinRequest(args: {
|
|
799
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
800
|
+
chat_id: number | string;
|
|
801
|
+
/** Unique identifier of the target user */
|
|
802
|
+
user_id: number;
|
|
803
|
+
}): true;
|
|
804
|
+
|
|
805
|
+
/** Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success. */
|
|
806
|
+
declineChatJoinRequest(args: {
|
|
807
|
+
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
808
|
+
chat_id: number | string;
|
|
809
|
+
/** Unique identifier of the target user */
|
|
810
|
+
user_id: number;
|
|
811
|
+
}): true;
|
|
812
|
+
|
|
813
|
+
/** Use this method to set a new profile photo for the chat. Photos 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 administrator rights. Returns True on success. */
|
|
772
814
|
setChatPhoto(args: {
|
|
773
815
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
774
816
|
chat_id: number | string;
|
|
@@ -776,13 +818,13 @@ export interface InputFileProxy<F> {
|
|
|
776
818
|
photo: F;
|
|
777
819
|
}): true;
|
|
778
820
|
|
|
779
|
-
/** Use this method to delete a chat photo. Photos 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
|
|
821
|
+
/** Use this method to delete a chat photo. Photos 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 administrator rights. Returns True on success. */
|
|
780
822
|
deleteChatPhoto(args: {
|
|
781
823
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
782
824
|
chat_id: number | string;
|
|
783
825
|
}): true;
|
|
784
826
|
|
|
785
|
-
/** Use this method to 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
|
|
827
|
+
/** Use this method to 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 administrator rights. Returns True on success. */
|
|
786
828
|
setChatTitle(args: {
|
|
787
829
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
788
830
|
chat_id: number | string;
|
|
@@ -790,7 +832,7 @@ export interface InputFileProxy<F> {
|
|
|
790
832
|
title: string;
|
|
791
833
|
}): true;
|
|
792
834
|
|
|
793
|
-
/** Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
835
|
+
/** Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success. */
|
|
794
836
|
setChatDescription(args: {
|
|
795
837
|
/** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
|
|
796
838
|
chat_id: number | string;
|
|
@@ -858,7 +900,7 @@ export interface InputFileProxy<F> {
|
|
|
858
900
|
user_id: number;
|
|
859
901
|
}): ChatMember;
|
|
860
902
|
|
|
861
|
-
/** Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
903
|
+
/** Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method. Returns True on success. */
|
|
862
904
|
setChatStickerSet(args: {
|
|
863
905
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
864
906
|
chat_id: number | string;
|
|
@@ -866,7 +908,7 @@ export interface InputFileProxy<F> {
|
|
|
866
908
|
sticker_set_name: string;
|
|
867
909
|
}): true;
|
|
868
910
|
|
|
869
|
-
/** Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate
|
|
911
|
+
/** Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set ly returned in getChat requests to check if the bot can use this method. Returns True on success. */
|
|
870
912
|
deleteChatStickerSet(args: {
|
|
871
913
|
/** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
|
|
872
914
|
chat_id: number | string;
|
|
@@ -880,7 +922,7 @@ export interface InputFileProxy<F> {
|
|
|
880
922
|
callback_query_id: string;
|
|
881
923
|
/** Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters */
|
|
882
924
|
text?: string;
|
|
883
|
-
/** If
|
|
925
|
+
/** If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. */
|
|
884
926
|
show_alert?: boolean;
|
|
885
927
|
/** URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.
|
|
886
928
|
|
|
@@ -928,7 +970,7 @@ export interface InputFileProxy<F> {
|
|
|
928
970
|
text: string;
|
|
929
971
|
/** Mode for parsing entities in the message text. See formatting options for more details. */
|
|
930
972
|
parse_mode?: ParseMode;
|
|
931
|
-
/**
|
|
973
|
+
/** A list of special entities that appear in message text, which can be specified instead of parse_mode */
|
|
932
974
|
entities?: MessageEntity[];
|
|
933
975
|
/** Disables link previews for links in this message */
|
|
934
976
|
disable_web_page_preview?: boolean;
|
|
@@ -948,7 +990,7 @@ export interface InputFileProxy<F> {
|
|
|
948
990
|
caption?: string;
|
|
949
991
|
/** Mode for parsing entities in the message caption. See formatting options for more details. */
|
|
950
992
|
parse_mode?: ParseMode;
|
|
951
|
-
/**
|
|
993
|
+
/** A list of special entities that appear in the caption, which can be specified instead of parse_mode */
|
|
952
994
|
caption_entities?: MessageEntity[];
|
|
953
995
|
/** An object for an inline keyboard. */
|
|
954
996
|
reply_markup?: InlineKeyboardMarkup;
|
|
@@ -1109,7 +1151,7 @@ export interface InputFileProxy<F> {
|
|
|
1109
1151
|
/** Use this method to send answers to an inline query. On success, True is returned.
|
|
1110
1152
|
No more than 50 results per query are allowed.
|
|
1111
1153
|
|
|
1112
|
-
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an
|
|
1154
|
+
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. */
|
|
1113
1155
|
answerInlineQuery(args: {
|
|
1114
1156
|
/** Unique identifier for the answered query */
|
|
1115
1157
|
inline_query_id: string;
|
|
@@ -1298,7 +1340,7 @@ export interface InputFileProxy<F> {
|
|
|
1298
1340
|
/** 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. */
|
|
1299
1341
|
media: F | string;
|
|
1300
1342
|
/** 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>. */
|
|
1301
|
-
thumb?: F
|
|
1343
|
+
thumb?: F;
|
|
1302
1344
|
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
1303
1345
|
caption?: string;
|
|
1304
1346
|
/** Mode for parsing entities in the video caption. See formatting options for more details. */
|
|
@@ -1309,7 +1351,7 @@ export interface InputFileProxy<F> {
|
|
|
1309
1351
|
width?: number;
|
|
1310
1352
|
/** Video height */
|
|
1311
1353
|
height?: number;
|
|
1312
|
-
/** Video duration */
|
|
1354
|
+
/** Video duration in seconds */
|
|
1313
1355
|
duration?: number;
|
|
1314
1356
|
/** Pass True, if the uploaded video is suitable for streaming */
|
|
1315
1357
|
supports_streaming?: boolean;
|
|
@@ -1322,7 +1364,7 @@ export interface InputFileProxy<F> {
|
|
|
1322
1364
|
/** 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. */
|
|
1323
1365
|
media: F | string;
|
|
1324
1366
|
/** 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>. */
|
|
1325
|
-
thumb?: F
|
|
1367
|
+
thumb?: F;
|
|
1326
1368
|
/** Caption of the animation to be sent, 0-1024 characters after entities parsing */
|
|
1327
1369
|
caption?: string;
|
|
1328
1370
|
/** Mode for parsing entities in the animation caption. See formatting options for more details. */
|
|
@@ -1333,7 +1375,7 @@ export interface InputFileProxy<F> {
|
|
|
1333
1375
|
width?: number;
|
|
1334
1376
|
/** Animation height */
|
|
1335
1377
|
height?: number;
|
|
1336
|
-
/** Animation duration */
|
|
1378
|
+
/** Animation duration in seconds */
|
|
1337
1379
|
duration?: number;
|
|
1338
1380
|
};
|
|
1339
1381
|
|
|
@@ -1344,7 +1386,7 @@ export interface InputFileProxy<F> {
|
|
|
1344
1386
|
/** 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. */
|
|
1345
1387
|
media: F | string;
|
|
1346
1388
|
/** 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>. */
|
|
1347
|
-
thumb?: F
|
|
1389
|
+
thumb?: F;
|
|
1348
1390
|
/** Caption of the audio to be sent, 0-1024 characters after entities parsing */
|
|
1349
1391
|
caption?: string;
|
|
1350
1392
|
/** Mode for parsing entities in the audio caption. See formatting options for more details. */
|
|
@@ -1366,7 +1408,7 @@ export interface InputFileProxy<F> {
|
|
|
1366
1408
|
/** 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
1409
|
media: F | string;
|
|
1368
1410
|
/** 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>. */
|
|
1369
|
-
thumb?: F
|
|
1411
|
+
thumb?: F;
|
|
1370
1412
|
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
|
|
1371
1413
|
caption?: string;
|
|
1372
1414
|
/** Mode for parsing entities in the document caption. See formatting options for more details. */
|
package/update.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CallbackQuery } from "./callback";
|
|
2
2
|
import { ChosenInlineResult, InlineQuery } from "./inline";
|
|
3
|
-
import { Chat, ChatMemberUpdated, User } from "./manage";
|
|
3
|
+
import { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage";
|
|
4
4
|
import { Message, Poll, PollAnswer } from "./message";
|
|
5
5
|
import { PreCheckoutQuery, ShippingQuery } from "./payment";
|
|
6
6
|
|
|
@@ -66,4 +66,6 @@ export interface Update {
|
|
|
66
66
|
my_chat_member?: ChatMemberUpdated;
|
|
67
67
|
/** A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. */
|
|
68
68
|
chat_member?: ChatMemberUpdated;
|
|
69
|
+
/** A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */
|
|
70
|
+
chat_join_request?: ChatJoinRequest;
|
|
69
71
|
}
|