@grammyjs/types 3.3.1 → 3.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/methods.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
2
- import type { BotCommand, ChatAdministratorRights, ChatFromGetChat, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, File, ForumTopic, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
2
+ import type { BotCommand, ChatAdministratorRights, ChatFromGetChat, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
3
3
  import type { ForceReply, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove } from "./markup.js";
4
- import type { GameHighScore, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
4
+ import type { GameHighScore, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
5
5
  import type { PassportElementError } from "./passport.js";
6
6
  import type { LabeledPrice, ShippingOption } from "./payment.js";
7
7
  import type { BotCommandScope, BotDescription, BotName, BotShortDescription, MenuButton } from "./settings.js";
@@ -26,7 +26,7 @@ export type ApiMethods<F> = {
26
26
  limit?: number;
27
27
  /** 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. */
28
28
  timeout?: number;
29
- /** 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.
29
+ /** 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, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
30
30
 
31
31
  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. */
32
32
  allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
@@ -50,7 +50,7 @@ export type ApiMethods<F> = {
50
50
  ip_address?: string;
51
51
  /** The 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. */
52
52
  max_connections?: number;
53
- /** 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.
53
+ /** 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, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.
54
54
 
55
55
  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. */
56
56
  allowed_updates?: ReadonlyArray<Exclude<keyof Update, "update_id">>;
@@ -84,20 +84,18 @@ export type ApiMethods<F> = {
84
84
  parse_mode?: ParseMode;
85
85
  /** A list of special entities that appear in message text, which can be specified instead of parse_mode */
86
86
  entities?: MessageEntity[];
87
- /** Boolean Disables link previews for links in this message */
88
- disable_web_page_preview?: boolean;
87
+ /** Link preview generation options for the message */
88
+ link_preview_options?: LinkPreviewOptions;
89
89
  /** Sends the message silently. Users will receive a notification with no sound. */
90
90
  disable_notification?: boolean;
91
91
  /** Protects the contents of the sent message from forwarding and saving */
92
92
  protect_content?: boolean;
93
- /** If the message is a reply, ID of the original message */
94
- reply_to_message_id?: number;
95
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
96
- allow_sending_without_reply?: boolean;
93
+ /** Description of the message to reply to */
94
+ reply_parameters?: ReplyParameters;
97
95
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
98
96
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
99
97
  }): Message.TextMessage;
100
- /** Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned. */
98
+ /** Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned. */
101
99
  forwardMessage(args: {
102
100
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
103
101
  chat_id: number | string;
@@ -112,7 +110,22 @@ export type ApiMethods<F> = {
112
110
  /** Message identifier in the chat specified in from_chat_id */
113
111
  message_id: number;
114
112
  }): Message;
115
- /** Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
113
+ /** Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned. */
114
+ forwardMessages(args: {
115
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
116
+ chat_id: number | string;
117
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
118
+ message_thread_id?: number;
119
+ /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
120
+ from_chat_id: number | string;
121
+ /** Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
122
+ message_ids: number[];
123
+ /** Sends the messages silently. Users will receive a notification with no sound. */
124
+ disable_notification?: boolean;
125
+ /** Protects the contents of the forwarded messages from forwarding and saving */
126
+ protect_content?: boolean;
127
+ }): MessageId[];
128
+ /** Use this method to copy messages of any kind. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success. */
116
129
  copyMessage(args: {
117
130
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
118
131
  chat_id: number | string;
@@ -132,13 +145,28 @@ export type ApiMethods<F> = {
132
145
  disable_notification?: boolean;
133
146
  /** Protects the contents of the sent message from forwarding and saving */
134
147
  protect_content?: boolean;
135
- /** If the message is a reply, ID of the original message */
136
- reply_to_message_id?: number;
137
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
138
- allow_sending_without_reply?: boolean;
148
+ /** Description of the message to reply to */
149
+ reply_parameters?: ReplyParameters;
139
150
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
140
151
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
141
152
  }): MessageId;
153
+ /** Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned. */
154
+ copyMessages(args: {
155
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
156
+ chat_id: number | string;
157
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
158
+ message_thread_id?: number;
159
+ /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
160
+ from_chat_id: number | string;
161
+ /** Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
162
+ message_ids: number[];
163
+ /** Sends the messages silently. Users will receive a notification with no sound. */
164
+ disable_notification?: boolean;
165
+ /** Protects the contents of the sent messages from forwarding and saving */
166
+ protect_content?: boolean;
167
+ /** Pass True to copy the messages without their captions */
168
+ remove_caption?: boolean;
169
+ }): MessageId[];
142
170
  /** Use this method to send photos. On success, the sent Message is returned. */
143
171
  sendPhoto(args: {
144
172
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
@@ -159,10 +187,8 @@ export type ApiMethods<F> = {
159
187
  disable_notification?: boolean;
160
188
  /** Protects the contents of the sent message from forwarding and saving */
161
189
  protect_content?: boolean;
162
- /** If the message is a reply, ID of the original message */
163
- reply_to_message_id?: number;
164
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
165
- allow_sending_without_reply?: boolean;
190
+ /** Description of the message to reply to */
191
+ reply_parameters?: ReplyParameters;
166
192
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
167
193
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
168
194
  }): Message.PhotoMessage;
@@ -194,10 +220,8 @@ export type ApiMethods<F> = {
194
220
  disable_notification?: boolean;
195
221
  /** Protects the contents of the sent message from forwarding and saving */
196
222
  protect_content?: boolean;
197
- /** If the message is a reply, ID of the original message */
198
- reply_to_message_id?: number;
199
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
200
- allow_sending_without_reply?: boolean;
223
+ /** Description of the message to reply to */
224
+ reply_parameters?: ReplyParameters;
201
225
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
202
226
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
203
227
  }): Message.AudioMessage;
@@ -223,10 +247,8 @@ export type ApiMethods<F> = {
223
247
  disable_notification?: boolean;
224
248
  /** Protects the contents of the sent message from forwarding and saving */
225
249
  protect_content?: boolean;
226
- /** If the message is a reply, ID of the original message */
227
- reply_to_message_id?: number;
228
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
229
- allow_sending_without_reply?: boolean;
250
+ /** Description of the message to reply to */
251
+ reply_parameters?: ReplyParameters;
230
252
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
231
253
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
232
254
  }): Message.DocumentMessage;
@@ -260,10 +282,8 @@ export type ApiMethods<F> = {
260
282
  disable_notification?: boolean;
261
283
  /** Protects the contents of the sent message from forwarding and saving */
262
284
  protect_content?: boolean;
263
- /** If the message is a reply, ID of the original message */
264
- reply_to_message_id?: number;
265
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
266
- allow_sending_without_reply?: boolean;
285
+ /** Description of the message to reply to */
286
+ reply_parameters?: ReplyParameters;
267
287
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
268
288
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
269
289
  }): Message.VideoMessage;
@@ -295,10 +315,8 @@ export type ApiMethods<F> = {
295
315
  disable_notification?: boolean;
296
316
  /** Protects the contents of the sent message from forwarding and saving */
297
317
  protect_content?: boolean;
298
- /** If the message is a reply, ID of the original message */
299
- reply_to_message_id?: number;
300
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
301
- allow_sending_without_reply?: boolean;
318
+ /** Description of the message to reply to */
319
+ reply_parameters?: ReplyParameters;
302
320
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
303
321
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
304
322
  }): Message.AnimationMessage;
@@ -322,10 +340,8 @@ export type ApiMethods<F> = {
322
340
  disable_notification?: boolean;
323
341
  /** Protects the contents of the sent message from forwarding and saving */
324
342
  protect_content?: boolean;
325
- /** If the message is a reply, ID of the original message */
326
- reply_to_message_id?: number;
327
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
328
- allow_sending_without_reply?: boolean;
343
+ /** Description of the message to reply to */
344
+ reply_parameters?: ReplyParameters;
329
345
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
330
346
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
331
347
  }): Message.VoiceMessage;
@@ -348,10 +364,8 @@ export type ApiMethods<F> = {
348
364
  disable_notification?: boolean;
349
365
  /** Protects the contents of the sent message from forwarding and saving */
350
366
  protect_content?: boolean;
351
- /** If the message is a reply, ID of the original message */
352
- reply_to_message_id?: number;
353
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
354
- allow_sending_without_reply?: boolean;
367
+ /** Description of the message to reply to */
368
+ reply_parameters?: ReplyParameters;
355
369
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
356
370
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
357
371
  }): Message.VideoNoteMessage;
@@ -367,10 +381,8 @@ export type ApiMethods<F> = {
367
381
  disable_notification?: boolean;
368
382
  /** Protects the contents of the sent messages from forwarding and saving */
369
383
  protect_content?: boolean;
370
- /** If messages are a reply, ID of the original message */
371
- reply_to_message_id?: number;
372
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
373
- allow_sending_without_reply?: boolean;
384
+ /** Description of the message to reply to */
385
+ reply_parameters?: ReplyParameters;
374
386
  }): Array<Message.AudioMessage | Message.DocumentMessage | Message.PhotoMessage | Message.VideoMessage>;
375
387
  /** Use this method to send point on the map. On success, the sent Message is returned. */
376
388
  sendLocation(args: {
@@ -394,10 +406,8 @@ export type ApiMethods<F> = {
394
406
  disable_notification?: boolean;
395
407
  /** Protects the contents of the sent message from forwarding and saving */
396
408
  protect_content?: boolean;
397
- /** If the message is a reply, ID of the original message */
398
- reply_to_message_id?: number;
399
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
400
- allow_sending_without_reply?: boolean;
409
+ /** Description of the message to reply to */
410
+ reply_parameters?: ReplyParameters;
401
411
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
402
412
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
403
413
  }): Message.LocationMessage;
@@ -459,10 +469,8 @@ export type ApiMethods<F> = {
459
469
  disable_notification?: boolean;
460
470
  /** Protects the contents of the sent message from forwarding and saving */
461
471
  protect_content?: boolean;
462
- /** If the message is a reply, ID of the original message */
463
- reply_to_message_id?: number;
464
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
465
- allow_sending_without_reply?: boolean;
472
+ /** Description of the message to reply to */
473
+ reply_parameters?: ReplyParameters;
466
474
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
467
475
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
468
476
  }): Message.VenueMessage;
@@ -484,10 +492,8 @@ export type ApiMethods<F> = {
484
492
  disable_notification?: boolean;
485
493
  /** Protects the contents of the sent message from forwarding and saving */
486
494
  protect_content?: boolean;
487
- /** If the message is a reply, ID of the original message */
488
- reply_to_message_id?: number;
489
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
490
- allow_sending_without_reply?: boolean;
495
+ /** Description of the message to reply to */
496
+ reply_parameters?: ReplyParameters;
491
497
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
492
498
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
493
499
  }): Message.ContactMessage;
@@ -525,10 +531,8 @@ export type ApiMethods<F> = {
525
531
  disable_notification?: boolean;
526
532
  /** Protects the contents of the sent message from forwarding and saving */
527
533
  protect_content?: boolean;
528
- /** If the message is a reply, ID of the original message */
529
- reply_to_message_id?: number;
530
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
531
- allow_sending_without_reply?: boolean;
534
+ /** Description of the message to reply to */
535
+ reply_parameters?: ReplyParameters;
532
536
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
533
537
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
534
538
  }): Message.PollMessage;
@@ -544,10 +548,8 @@ export type ApiMethods<F> = {
544
548
  disable_notification?: boolean;
545
549
  /** Protects the contents of the sent message from forwarding */
546
550
  protect_content?: boolean;
547
- /** If the message is a reply, ID of the original message */
548
- reply_to_message_id?: number;
549
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
550
- allow_sending_without_reply?: boolean;
551
+ /** Description of the message to reply to */
552
+ reply_parameters?: ReplyParameters;
551
553
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
552
554
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
553
555
  }): Message.DiceMessage;
@@ -564,6 +566,17 @@ export type ApiMethods<F> = {
564
566
  /** Unique identifier for the target message thread; supergroups only */
565
567
  message_thread_id?: number;
566
568
  }): true;
569
+ /** Use this method to change the chosen reactions on a message. Service messages can't be reacted to. Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel. In albums, bots must react to the first message. Returns True on success. */
570
+ setMessageReaction(args: {
571
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
572
+ chat_id: number | string;
573
+ /** Identifier of the target message */
574
+ message_id: number;
575
+ /** New list of reaction types to set on the message. Currently, as non-premium users, bots can set up to one reaction per message. A custom emoji reaction can be used if it is either already present on the message or explicitly allowed by chat administrators. */
576
+ reaction?: ReactionType[];
577
+ /** Pass True to set the reaction with a big animation */
578
+ is_big?: boolean;
579
+ }): true;
567
580
  /** Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. */
568
581
  getUserProfilePhotos(args: {
569
582
  /** Unique identifier of the target user */
@@ -793,7 +806,7 @@ export type ApiMethods<F> = {
793
806
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
794
807
  chat_id: number | string;
795
808
  }): true;
796
- /** Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success. */
809
+ /** Use this method to get up to date information about the chat. Returns a Chat object on success. */
797
810
  getChat(args: {
798
811
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
799
812
  chat_id: number | string;
@@ -931,18 +944,13 @@ export type ApiMethods<F> = {
931
944
  /** The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. */
932
945
  cache_time?: number;
933
946
  }): true;
934
- /** Use this method to change the bot's name. Returns True on success. */
935
- setMyName(args: {
936
- /** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
937
- name?: string;
938
- /** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
939
- language_code?: string;
940
- }): true;
941
- /** Use this method to get the current bot name for the given user language. Returns BotName on success. */
942
- getMyName(args: {
943
- /** A two-letter ISO 639-1 language code or an empty string */
944
- language_code?: string;
945
- }): BotName;
947
+ /** Use this method to get the list of boosts added to a chat by a user. Requires administrator rights in the chat. Returns a UserChatBoosts object. */
948
+ getUserChatBoosts(args: {
949
+ /** Unique identifier for the chat or username of the channel (in the format @channelusername) */
950
+ chat_id: number | string;
951
+ /** Unique identifier of the target user */
952
+ user_id: number;
953
+ }): UserChatBoosts;
946
954
  /** Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success. */
947
955
  setMyCommands(args: {
948
956
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
@@ -966,6 +974,18 @@ export type ApiMethods<F> = {
966
974
  /** A two-letter ISO 639-1 language code or an empty string */
967
975
  language_code?: string;
968
976
  }): BotCommand[];
977
+ /** Use this method to change the bot's name. Returns True on success. */
978
+ setMyName(args: {
979
+ /** New bot name; 0-64 characters. Pass an empty string to remove the dedicated name for the given language. */
980
+ name?: string;
981
+ /** A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose language there is no dedicated name. */
982
+ language_code?: string;
983
+ }): true;
984
+ /** Use this method to get the current bot name for the given user language. Returns BotName on success. */
985
+ getMyName(args: {
986
+ /** A two-letter ISO 639-1 language code or an empty string */
987
+ language_code?: string;
988
+ }): BotName;
969
989
  /** Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success. */
970
990
  setMyDescription(args: {
971
991
  /** New bot description; 0-512 characters. Pass an empty string to remove the dedicated description for the given language. */
@@ -1028,8 +1048,8 @@ export type ApiMethods<F> = {
1028
1048
  parse_mode?: ParseMode;
1029
1049
  /** A list of special entities that appear in message text, which can be specified instead of parse_mode */
1030
1050
  entities?: MessageEntity[];
1031
- /** Disables link previews for links in this message */
1032
- disable_web_page_preview?: boolean;
1051
+ /** Link preview generation options for the message */
1052
+ link_preview_options?: LinkPreviewOptions;
1033
1053
  /** An object for an inline keyboard. */
1034
1054
  reply_markup?: InlineKeyboardMarkup;
1035
1055
  }): (Update.Edited & Message.TextMessage) | true;
@@ -1099,6 +1119,13 @@ export type ApiMethods<F> = {
1099
1119
  /** Identifier of the message to delete */
1100
1120
  message_id: number;
1101
1121
  }): true;
1122
+ /** Use this method to delete multiple messages simultaneously. Returns True on success. */
1123
+ deleteMessages(args: {
1124
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1125
+ chat_id: number | string;
1126
+ /** Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted */
1127
+ message_ids: number[];
1128
+ }): true;
1102
1129
  /** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
1103
1130
  sendSticker(args: {
1104
1131
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
@@ -1113,10 +1140,8 @@ export type ApiMethods<F> = {
1113
1140
  disable_notification?: boolean;
1114
1141
  /** Protects the contents of the sent message from forwarding and saving */
1115
1142
  protect_content?: boolean;
1116
- /** If the message is a reply, ID of the original message */
1117
- reply_to_message_id?: number;
1118
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
1119
- allow_sending_without_reply?: boolean;
1143
+ /** Description of the message to reply to */
1144
+ reply_parameters?: ReplyParameters;
1120
1145
  /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1121
1146
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
1122
1147
  }): Message.StickerMessage;
@@ -1303,10 +1328,8 @@ export type ApiMethods<F> = {
1303
1328
  disable_notification?: boolean;
1304
1329
  /** Protects the contents of the sent message from forwarding and saving */
1305
1330
  protect_content?: boolean;
1306
- /** If the message is a reply, ID of the original message */
1307
- reply_to_message_id?: number;
1308
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
1309
- allow_sending_without_reply?: boolean;
1331
+ /** Description of the message to reply to */
1332
+ reply_parameters?: ReplyParameters;
1310
1333
  /** An object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. */
1311
1334
  reply_markup?: InlineKeyboardMarkup;
1312
1335
  }): Message.InvoiceMessage;
@@ -1394,10 +1417,8 @@ export type ApiMethods<F> = {
1394
1417
  disable_notification?: boolean;
1395
1418
  /** Protects the contents of the sent message from forwarding and saving */
1396
1419
  protect_content?: boolean;
1397
- /** If the message is a reply, ID of the original message */
1398
- reply_to_message_id?: number;
1399
- /** Pass True if the message should be sent even if the specified replied-to message is not found */
1400
- allow_sending_without_reply?: boolean;
1420
+ /** Description of the message to reply to */
1421
+ reply_parameters?: ReplyParameters;
1401
1422
  /** An object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. */
1402
1423
  reply_markup?: InlineKeyboardMarkup;
1403
1424
  }): Message.GameMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/update.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { ChosenInlineResult, InlineQuery } from "./inline.js";
2
- import type { Chat, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
2
+ import type { Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
3
3
  import type { CallbackQuery } from "./markup.js";
4
- import type { Message, Poll, PollAnswer } from "./message.js";
4
+ import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
5
5
  import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
6
6
  /** Internal namespace used to make some message types more accurate */
7
7
  export declare namespace Update {
@@ -33,6 +33,10 @@ export interface Update {
33
33
  channel_post?: Message & Update.Channel;
34
34
  /** New version of a channel post that is known to the bot and was edited */
35
35
  edited_channel_post?: Message & Update.Edited & Update.Channel;
36
+ /** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify "message_reaction" in the list of allowed_updates to receive these updates. The update isn't received for reactions set by bots. */
37
+ message_reaction?: MessageReactionUpdated;
38
+ /** Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify "message_reaction_count" in the list of allowed_updates to receive these updates. */
39
+ message_reaction_count?: MessageReactionCountUpdated;
36
40
  /** New incoming inline query */
37
41
  inline_query?: InlineQuery;
38
42
  /** The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */
@@ -53,4 +57,8 @@ export interface Update {
53
57
  chat_member?: ChatMemberUpdated;
54
58
  /** 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. */
55
59
  chat_join_request?: ChatJoinRequest;
60
+ /** A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. */
61
+ chat_boost?: ChatBoostUpdated;
62
+ /** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
63
+ removed_chat_boost?: ChatBoostRemoved;
56
64
  }