@grammyjs/types 3.5.1 → 3.6.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/manage.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Location, Message, PhotoSize, ReactionType } from "./message.js";
1
+ import type { Location, Message, PhotoSize, ReactionType, Sticker } from "./message.js";
2
2
  import type { Update } from "./update.js";
3
3
  /** Describes the current status of a webhook. */
4
4
  export interface WebhookInfo {
@@ -50,6 +50,8 @@ export interface UserFromGetMe extends User {
50
50
  can_read_all_group_messages: boolean;
51
51
  /** True, if the bot supports inline queries. Returned only in getMe. */
52
52
  supports_inline_queries: boolean;
53
+ /** True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. */
54
+ can_connect_to_business?: boolean;
53
55
  }
54
56
  export declare namespace Chat {
55
57
  /** Internal type holding properties that all kinds of chats share. */
@@ -120,8 +122,6 @@ export declare namespace Chat {
120
122
  interface MultiUserGetChat {
121
123
  /** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
122
124
  permissions?: ChatPermissions;
123
- /** True, if the bot can change the group sticker set. Returned only in getChat. */
124
- can_set_sticker_set?: true;
125
125
  }
126
126
  /** Internal type holding properties that those private and channel chats returned from `getChat` share. */
127
127
  interface NonMultiUserGetChat {
@@ -141,6 +141,16 @@ export declare namespace Chat {
141
141
  }
142
142
  /** Internal type representing private chats returned from `getChat`. */
143
143
  interface PrivateGetChat extends PrivateChat, GetChat, NonGroupGetChat, NonMultiUserGetChat {
144
+ /** For private chats, the date of birth of the user. Returned only in getChat. */
145
+ birthdate?: Birthdate;
146
+ /** For private chats with business accounts, the intro of the business. Returned only in getChat. */
147
+ business_intro?: BusinessIntro;
148
+ /** For private chats with business accounts, the location of the business. Returned only in getChat. */
149
+ business_location?: BusinessLocation;
150
+ /** For private chats with business accounts, the opening hours of the business. Returned only in getChat. */
151
+ business_opening_hours?: BusinessOpeningHours;
152
+ /** For private chats, the personal channel of the user. Returned only in getChat. */
153
+ personal_chat?: Chat.ChannelChat;
144
154
  /** Bio of the other party in a private chat. Returned only in getChat. */
145
155
  bio?: string;
146
156
  /** 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. */
@@ -159,18 +169,20 @@ export declare namespace Chat {
159
169
  join_by_request?: true;
160
170
  /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat. */
161
171
  slow_mode_delay?: number;
172
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat. */
173
+ unrestrict_boost_count?: number;
162
174
  /** True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat. */
163
175
  has_visible_history?: boolean;
164
176
  /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
165
177
  has_aggressive_anti_spam_enabled?: true;
166
178
  /** For supergroups, name of group sticker set. Returned only in getChat. */
167
179
  sticker_set_name?: string;
168
- /** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
169
- location?: ChatLocation;
170
- /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat. */
171
- unrestrict_boost_count?: number;
180
+ /** True, if the bot can change the group sticker set. Returned only in getChat. */
181
+ can_set_sticker_set?: true;
172
182
  /** For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat. */
173
183
  custom_emoji_sticker_set_name?: string;
184
+ /** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
185
+ location?: ChatLocation;
174
186
  }
175
187
  /** Internal type representing channel chats returned from `getChat`. */
176
188
  interface ChannelGetChat extends ChannelChat, GetChat, NonGroupGetChat, NonPrivateGetChat, NonMultiUserGetChat, LargeGetChat {
@@ -241,19 +253,19 @@ export interface ChatAdministratorRights {
241
253
  can_change_info: boolean;
242
254
  /** True, if the user is allowed to invite new users to the chat */
243
255
  can_invite_users: boolean;
244
- /** True, if the administrator can post messages in the channel, or access channel statistics; channels only */
245
- can_post_messages?: boolean;
246
- /** True, if the administrator can edit messages of other users and can pin messages; channels only */
247
- can_edit_messages?: boolean;
248
- /** True, if the user is allowed to pin messages; groups and supergroups only */
249
- can_pin_messages?: boolean;
250
256
  /** True, if the administrator can post stories to the chat */
251
- can_post_stories?: boolean;
257
+ can_post_stories: boolean;
252
258
  /** True, if the administrator can edit stories posted by other users */
253
- can_edit_stories?: boolean;
259
+ can_edit_stories: boolean;
254
260
  /** True, if the administrator can delete stories posted by other users */
255
- can_delete_stories?: boolean;
256
- /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
261
+ can_delete_stories: boolean;
262
+ /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
263
+ can_post_messages?: boolean;
264
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
265
+ can_edit_messages?: boolean;
266
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
267
+ can_pin_messages?: boolean;
268
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
257
269
  can_manage_topics?: boolean;
258
270
  }
259
271
  /** This object represents changes in the status of a chat member. */
@@ -316,19 +328,19 @@ export interface ChatMemberAdministrator {
316
328
  can_change_info: boolean;
317
329
  /** True, if the user is allowed to invite new users to the chat */
318
330
  can_invite_users: boolean;
319
- /** True, if the administrator can post messages in the channel, or access channel statistics; channels only */
320
- can_post_messages?: boolean;
321
- /** True, if the administrator can edit messages of other users and can pin messages; channels only */
322
- can_edit_messages?: boolean;
323
- /** True, if the user is allowed to pin messages; groups and supergroups only */
324
- can_pin_messages?: boolean;
325
331
  /** True, if the administrator can post stories to the chat */
326
- can_post_stories?: boolean;
332
+ can_post_stories: boolean;
327
333
  /** True, if the administrator can edit stories posted by other users */
328
- can_edit_stories?: boolean;
334
+ can_edit_stories: boolean;
329
335
  /** True, if the administrator can delete stories posted by other users */
330
- can_delete_stories?: boolean;
331
- /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
336
+ can_delete_stories: boolean;
337
+ /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
338
+ can_post_messages?: boolean;
339
+ /** True, if the administrator can edit messages of other users and can pin messages; for channels only */
340
+ can_edit_messages?: boolean;
341
+ /** True, if the user is allowed to pin messages; for groups and supergroups only */
342
+ can_pin_messages?: boolean;
343
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
332
344
  can_manage_topics?: boolean;
333
345
  /** Custom title for this user */
334
346
  custom_title?: string;
@@ -441,6 +453,40 @@ export interface ChatPermissions {
441
453
  /** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
442
454
  can_manage_topics?: boolean;
443
455
  }
456
+ export interface Birthdate {
457
+ /** Day of the user's birth; 1-31 */
458
+ day: number;
459
+ /** Month of the user's birth; 1-12 */
460
+ month: number;
461
+ /** Year of the user's birth */
462
+ year?: number;
463
+ }
464
+ export interface BusinessIntro {
465
+ /** Title text of the business intro */
466
+ title?: string;
467
+ /** Message text of the business intro */
468
+ message?: string;
469
+ /** Sticker of the business intro */
470
+ sticker?: Sticker;
471
+ }
472
+ export interface BusinessLocation {
473
+ /** Address of the business */
474
+ address: string;
475
+ /** Location of the business */
476
+ location?: Location;
477
+ }
478
+ export interface BusinessOpeningHoursInterval {
479
+ /** The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 24 60 */
480
+ opening_minute: number;
481
+ /** The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 24 60 */
482
+ closing_minute: number;
483
+ }
484
+ export interface BusinessOpeningHours {
485
+ /** Unique name of the time zone for which the opening hours are defined */
486
+ time_zone_name: string;
487
+ /** List of time intervals describing business opening hours */
488
+ opening_hours: BusinessOpeningHoursInterval[];
489
+ }
444
490
  /** Represents a location to which a chat is connected. */
445
491
  export interface ChatLocation {
446
492
  /** The location to which the supergroup is connected. Can't be a live location. */
@@ -531,3 +577,27 @@ export interface UserChatBoosts {
531
577
  /** The list of boosts added to the chat by the user */
532
578
  boosts: ChatBoost[];
533
579
  }
580
+ /** Describes the connection of the bot with a business account. */
581
+ export interface BusinessConnection {
582
+ /** Unique identifier of the business connection */
583
+ id: string;
584
+ /** Business account user that created the business connection */
585
+ user: User;
586
+ /** Identifier of a private chat with the user who created the business connection. */
587
+ user_chat_id: number;
588
+ /** Date the connection was established in Unix time */
589
+ date: number;
590
+ /** True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours */
591
+ can_reply: boolean;
592
+ /** True, if the connection is active */
593
+ is_enabled: boolean;
594
+ }
595
+ /** This object is received when messages are deleted from a connected business account. */
596
+ export interface BusinessMessagesDeleted {
597
+ /** Unique identifier of the business connection */
598
+ business_connection_id: string;
599
+ /** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
600
+ chat: Chat;
601
+ /** A JSON-serialized list of identifiers of deleted messages in the chat of the business account */
602
+ message_ids: number[];
603
+ }
package/markup.d.ts CHANGED
@@ -189,7 +189,7 @@ export interface WebAppInfo {
189
189
  /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
190
190
  url: string;
191
191
  }
192
- /** This object defines the criteria used to request suitable users. The identifiers of the selected users will be shared with the bot when the corresponding button is pressed. */
192
+ /** This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. */
193
193
  export interface KeyboardButtonRequestUsers {
194
194
  /** Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message */
195
195
  request_id: number;
@@ -199,8 +199,14 @@ export interface KeyboardButtonRequestUsers {
199
199
  user_is_premium?: boolean;
200
200
  /** The maximum number of users to be selected; 1-10. Defaults to 1. */
201
201
  max_quantity?: number;
202
+ /** Pass True to request the users' first and last name */
203
+ request_name?: boolean;
204
+ /** Pass True to request the users' username */
205
+ request_username?: boolean;
206
+ /** Pass True to request the users' photo */
207
+ request_photo?: boolean;
202
208
  }
203
- /** This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. */
209
+ /** This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. */
204
210
  export interface KeyboardButtonRequestChat {
205
211
  /** Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message */
206
212
  request_id: number;
@@ -218,4 +224,10 @@ export interface KeyboardButtonRequestChat {
218
224
  bot_administrator_rights?: ChatAdministratorRights;
219
225
  /** Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
220
226
  bot_is_member?: boolean;
227
+ /** Pass True to request the chat's title */
228
+ request_title?: boolean;
229
+ /** Pass True to request the chat's username */
230
+ request_username?: boolean;
231
+ /** Pass True to request the chat's photo */
232
+ request_photo?: boolean;
221
233
  }
package/message.d.ts CHANGED
@@ -15,12 +15,18 @@ export declare namespace Message {
15
15
  sender_chat?: Chat;
16
16
  /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
17
17
  date: number;
18
+ /** Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. */
19
+ business_connection_id?: string;
18
20
  /** Chat the message belongs to */
19
21
  chat: Chat;
20
22
  /** True, if the message is sent to a forum topic */
21
23
  is_topic_message?: boolean;
22
24
  }
23
25
  interface CommonMessage extends ServiceMessage {
26
+ /** If the sender of the message boosted the chat, the number of boosts added by the user */
27
+ sender_boost_count?: number;
28
+ /** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */
29
+ sender_business_bot?: User;
24
30
  /** Information about the original message for forwarded messages */
25
31
  forward_origin?: MessageOrigin;
26
32
  /** True, if the message is a channel post that was automatically forwarded to the connected discussion group */
@@ -39,6 +45,8 @@ export declare namespace Message {
39
45
  edit_date?: number;
40
46
  /** True, if the message can't be forwarded */
41
47
  has_protected_content?: true;
48
+ /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
49
+ is_from_offline?: true;
42
50
  /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
43
51
  author_signature?: string;
44
52
  /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
@@ -94,6 +102,7 @@ export declare namespace Message {
94
102
  type WriteAccessAllowedMessage = ServiceMessage & MsgWith<"write_access_allowed">;
95
103
  type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">;
96
104
  type ProximityAlertTriggeredMessage = ServiceMessage & MsgWith<"proximity_alert_triggered">;
105
+ type BoostAddedMessage = ServiceMessage & MsgWith<"boost_added">;
97
106
  type ForumTopicCreatedMessage = ServiceMessage & MsgWith<"forum_topic_created">;
98
107
  type ForumTopicEditedMessage = ServiceMessage & MsgWith<"forum_topic_edited">;
99
108
  type ForumTopicClosedMessage = ServiceMessage & MsgWith<"forum_topic_closed">;
@@ -188,6 +197,8 @@ export interface Message extends Message.MediaMessage {
188
197
  passport_data?: PassportData;
189
198
  /** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
190
199
  proximity_alert_triggered?: ProximityAlertTriggered;
200
+ /** Service message: user boosted the chat */
201
+ boost_added?: ChatBoostAdded;
191
202
  /** Service message: forum topic created */
192
203
  forum_topic_created?: ForumTopicCreated;
193
204
  /** Service message: forum topic edited */
@@ -200,10 +211,6 @@ export interface Message extends Message.MediaMessage {
200
211
  general_forum_topic_hidden?: GeneralForumTopicHidden;
201
212
  /** Service message: the 'General' forum topic unhidden */
202
213
  general_forum_topic_unhidden?: GeneralForumTopicUnhidden;
203
- /** The message is a service message about a user boosting the chat */
204
- boost_added: ChatBoostAdded;
205
- /** If the sender of the message boosted the chat, the number of boosts added by the user */
206
- sender_boost_count: number;
207
214
  /** Service message: a scheduled giveaway was created */
208
215
  giveaway_created?: GiveawayCreated;
209
216
  /** The message is a scheduled giveaway message */
@@ -450,9 +457,9 @@ export interface ExternalReplyInfo {
450
457
  export interface ReplyParameters {
451
458
  /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */
452
459
  message_id: number;
453
- /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername) */
460
+ /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account. */
454
461
  chat_id?: number | string;
455
- /** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. */
462
+ /** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. Always True for messages sent on behalf of a business account. */
456
463
  allow_sending_without_reply?: boolean;
457
464
  /** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */
458
465
  quote?: string;
@@ -699,10 +706,10 @@ export interface Poll {
699
706
  }
700
707
  /** This object represents a point on the map. */
701
708
  export interface Location {
702
- /** Longitude as defined by sender */
703
- longitude: number;
704
709
  /** Latitude as defined by sender */
705
710
  latitude: number;
711
+ /** Longitude as defined by sender */
712
+ longitude: number;
706
713
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
707
714
  horizontal_accuracy?: number;
708
715
  /** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
@@ -783,19 +790,38 @@ export interface ChatBoostAdded {
783
790
  /** Number of boosts added by the user */
784
791
  boost_count: number;
785
792
  }
793
+ /** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button. */
794
+ export interface SharedUser {
795
+ /** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
796
+ user_id: number;
797
+ /** First name of the user, if the name was requested by the bot */
798
+ first_name?: string;
799
+ /** Last name of the user, if the name was requested by the bot */
800
+ last_name?: string;
801
+ /** Username of the user, if the username was requested by the bot */
802
+ username?: string;
803
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
804
+ photo?: PhotoSize[];
805
+ }
786
806
  /** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUsers button. */
787
807
  export interface UsersShared {
788
808
  /** Identifier of the request */
789
809
  request_id: number;
790
- /** Identifiers of the shared users. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means. */
791
- user_ids: number[];
810
+ /** Information about users shared with the bot. */
811
+ users: SharedUser[];
792
812
  }
793
- /** This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button. */
813
+ /** This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */
794
814
  export interface ChatShared {
795
815
  /** Identifier of the request */
796
816
  request_id: number;
797
817
  /** Identifier of the shared chat. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
798
818
  chat_id: number;
819
+ /** Title of the chat, if the title was requested by the bot. */
820
+ title?: string;
821
+ /** Username of the chat, if the username was requested by the bot and available. */
822
+ username?: string;
823
+ /** Available sizes of the chat photo, if the photo was requested by the bot */
824
+ photo?: PhotoSize[];
799
825
  }
800
826
  /** This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. */
801
827
  export interface WriteAccessAllowed {
@@ -939,10 +965,6 @@ export interface StickerSet {
939
965
  title: string;
940
966
  /** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */
941
967
  sticker_type: "regular" | "mask" | "custom_emoji";
942
- /** True, if the sticker set contains animated stickers */
943
- is_animated: boolean;
944
- /** True, if the sticker set contains video stickers */
945
- is_video: boolean;
946
968
  /** List of all set stickers */
947
969
  stickers: Sticker[];
948
970
  /** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
package/methods.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { InlineQueryResult, InlineQueryResultsButton } from "./inline.js";
2
- import type { BotCommand, ChatAdministratorRights, ChatFromGetChat, ChatInviteLink, ChatMember, ChatMemberAdministrator, ChatMemberOwner, ChatPermissions, ForumTopic, UserChatBoosts, UserFromGetMe, UserProfilePhotos, WebhookInfo } from "./manage.js";
2
+ import type { BotCommand, BusinessConnection, 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
4
  import type { File, GameHighScore, LinkPreviewOptions, MaskPosition, Message, MessageEntity, MessageId, ParseMode, Poll, ReactionType, ReplyParameters, SentWebAppMessage, Sticker, StickerSet } from "./message.js";
5
5
  import type { PassportElementError } from "./passport.js";
@@ -74,6 +74,8 @@ export type ApiMethods<F> = {
74
74
  close(): true;
75
75
  /** Use this method to send text messages. On success, the sent Message is returned. */
76
76
  sendMessage(args: {
77
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
78
+ business_connection_id?: string;
77
79
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
78
80
  chat_id: number | string;
79
81
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -92,7 +94,7 @@ export type ApiMethods<F> = {
92
94
  protect_content?: boolean;
93
95
  /** Description of the message to reply to */
94
96
  reply_parameters?: ReplyParameters;
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. */
97
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
96
98
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
97
99
  /** @deprecated Use `reply_parameters` instead. */
98
100
  reply_to_message_id?: number;
@@ -120,7 +122,7 @@ export type ApiMethods<F> = {
120
122
  message_thread_id?: number;
121
123
  /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
122
124
  from_chat_id: number | string;
123
- /** Identifiers of 1-100 messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
125
+ /** A list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order. */
124
126
  message_ids: number[];
125
127
  /** Sends the messages silently. Users will receive a notification with no sound. */
126
128
  disable_notification?: boolean;
@@ -162,7 +164,7 @@ export type ApiMethods<F> = {
162
164
  message_thread_id?: number;
163
165
  /** Unique identifier for the chat where the original messages were sent (or channel username in the format @channelusername) */
164
166
  from_chat_id: number | string;
165
- /** Identifiers of 1-100 messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
167
+ /** A list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order. */
166
168
  message_ids: number[];
167
169
  /** Sends the messages silently. Users will receive a notification with no sound. */
168
170
  disable_notification?: boolean;
@@ -173,6 +175,8 @@ export type ApiMethods<F> = {
173
175
  }): MessageId[];
174
176
  /** Use this method to send photos. On success, the sent Message is returned. */
175
177
  sendPhoto(args: {
178
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
179
+ business_connection_id?: string;
176
180
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
177
181
  chat_id: number | string;
178
182
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -193,7 +197,7 @@ export type ApiMethods<F> = {
193
197
  protect_content?: boolean;
194
198
  /** Description of the message to reply to */
195
199
  reply_parameters?: ReplyParameters;
196
- /** 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. */
200
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
197
201
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
198
202
  /** @deprecated Use `reply_parameters` instead. */
199
203
  reply_to_message_id?: number;
@@ -202,6 +206,8 @@ export type ApiMethods<F> = {
202
206
 
203
207
  For sending voice messages, use the sendVoice method instead. */
204
208
  sendAudio(args: {
209
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
210
+ business_connection_id?: string;
205
211
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
206
212
  chat_id: number | string;
207
213
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -228,13 +234,15 @@ export type ApiMethods<F> = {
228
234
  protect_content?: boolean;
229
235
  /** Description of the message to reply to */
230
236
  reply_parameters?: ReplyParameters;
231
- /** 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. */
237
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
232
238
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
233
239
  /** @deprecated Use `reply_parameters` instead. */
234
240
  reply_to_message_id?: number;
235
241
  }): Message.AudioMessage;
236
242
  /** Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. */
237
243
  sendDocument(args: {
244
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
245
+ business_connection_id?: string;
238
246
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
239
247
  chat_id: number | string;
240
248
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -257,13 +265,15 @@ export type ApiMethods<F> = {
257
265
  protect_content?: boolean;
258
266
  /** Description of the message to reply to */
259
267
  reply_parameters?: ReplyParameters;
260
- /** 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
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
261
269
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
262
270
  /** @deprecated Use `reply_parameters` instead. */
263
271
  reply_to_message_id?: number;
264
272
  }): Message.DocumentMessage;
265
273
  /** Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. */
266
274
  sendVideo(args: {
275
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
276
+ business_connection_id?: string;
267
277
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
268
278
  chat_id: number | string;
269
279
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -294,13 +304,15 @@ export type ApiMethods<F> = {
294
304
  protect_content?: boolean;
295
305
  /** Description of the message to reply to */
296
306
  reply_parameters?: ReplyParameters;
297
- /** 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. */
307
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
298
308
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
299
309
  /** @deprecated Use `reply_parameters` instead. */
300
310
  reply_to_message_id?: number;
301
311
  }): Message.VideoMessage;
302
312
  /** Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. */
303
313
  sendAnimation(args: {
314
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
315
+ business_connection_id?: string;
304
316
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
305
317
  chat_id: number | string;
306
318
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -329,13 +341,15 @@ export type ApiMethods<F> = {
329
341
  protect_content?: boolean;
330
342
  /** Description of the message to reply to */
331
343
  reply_parameters?: ReplyParameters;
332
- /** 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. */
344
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
333
345
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
334
346
  /** @deprecated Use `reply_parameters` instead. */
335
347
  reply_to_message_id?: number;
336
348
  }): Message.AnimationMessage;
337
349
  /** Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. */
338
350
  sendVoice(args: {
351
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
352
+ business_connection_id?: string;
339
353
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
340
354
  chat_id: number | string;
341
355
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -356,7 +370,7 @@ export type ApiMethods<F> = {
356
370
  protect_content?: boolean;
357
371
  /** Description of the message to reply to */
358
372
  reply_parameters?: ReplyParameters;
359
- /** 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. */
373
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
360
374
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
361
375
  /** @deprecated Use `reply_parameters` instead. */
362
376
  reply_to_message_id?: number;
@@ -364,6 +378,8 @@ export type ApiMethods<F> = {
364
378
  /** Use this method to send video messages. On success, the sent Message is returned.
365
379
  As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. */
366
380
  sendVideoNote(args: {
381
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
382
+ business_connection_id?: string;
367
383
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
368
384
  chat_id: number | string;
369
385
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -382,13 +398,15 @@ export type ApiMethods<F> = {
382
398
  protect_content?: boolean;
383
399
  /** Description of the message to reply to */
384
400
  reply_parameters?: ReplyParameters;
385
- /** 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. */
401
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
386
402
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
387
403
  /** @deprecated Use `reply_parameters` instead. */
388
404
  reply_to_message_id?: number;
389
405
  }): Message.VideoNoteMessage;
390
406
  /** Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned. */
391
407
  sendMediaGroup(args: {
408
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
409
+ business_connection_id?: string;
392
410
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
393
411
  chat_id: number | string;
394
412
  /** An array describing messages to be sent, must include 2-10 items */
@@ -406,6 +424,8 @@ export type ApiMethods<F> = {
406
424
  }): Array<Message.AudioMessage | Message.DocumentMessage | Message.PhotoMessage | Message.VideoMessage>;
407
425
  /** Use this method to send point on the map. On success, the sent Message is returned. */
408
426
  sendLocation(args: {
427
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
428
+ business_connection_id?: string;
409
429
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
410
430
  chat_id: number | string;
411
431
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -428,7 +448,7 @@ export type ApiMethods<F> = {
428
448
  protect_content?: boolean;
429
449
  /** Description of the message to reply to */
430
450
  reply_parameters?: ReplyParameters;
431
- /** 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. */
451
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
432
452
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
433
453
  /** @deprecated Use `reply_parameters` instead. */
434
454
  reply_to_message_id?: number;
@@ -467,6 +487,8 @@ export type ApiMethods<F> = {
467
487
  }): (Update.Edited & Message.LocationMessage) | true;
468
488
  /** Use this method to send information about a venue. On success, the sent Message is returned. */
469
489
  sendVenue(args: {
490
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
491
+ business_connection_id?: string;
470
492
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
471
493
  chat_id: number | string;
472
494
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -493,13 +515,15 @@ export type ApiMethods<F> = {
493
515
  protect_content?: boolean;
494
516
  /** Description of the message to reply to */
495
517
  reply_parameters?: ReplyParameters;
496
- /** 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. */
518
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
497
519
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
498
520
  /** @deprecated Use `reply_parameters` instead. */
499
521
  reply_to_message_id?: number;
500
522
  }): Message.VenueMessage;
501
523
  /** Use this method to send phone contacts. On success, the sent Message is returned. */
502
524
  sendContact(args: {
525
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
526
+ business_connection_id?: string;
503
527
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
504
528
  chat_id: number | string;
505
529
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -518,13 +542,15 @@ export type ApiMethods<F> = {
518
542
  protect_content?: boolean;
519
543
  /** Description of the message to reply to */
520
544
  reply_parameters?: ReplyParameters;
521
- /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
545
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
522
546
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
523
547
  /** @deprecated Use `reply_parameters` instead. */
524
548
  reply_to_message_id?: number;
525
549
  }): Message.ContactMessage;
526
550
  /** Use this method to send a native poll. On success, the sent Message is returned. */
527
551
  sendPoll(args: {
552
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
553
+ business_connection_id?: string;
528
554
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
529
555
  chat_id: number | string;
530
556
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -559,13 +585,15 @@ export type ApiMethods<F> = {
559
585
  protect_content?: boolean;
560
586
  /** Description of the message to reply to */
561
587
  reply_parameters?: ReplyParameters;
562
- /** 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. */
588
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
563
589
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
564
590
  /** @deprecated Use `reply_parameters` instead. */
565
591
  reply_to_message_id?: number;
566
592
  }): Message.PollMessage;
567
593
  /** Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. */
568
594
  sendDice(args: {
595
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
596
+ business_connection_id?: string;
569
597
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
570
598
  chat_id: number | string;
571
599
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -578,7 +606,7 @@ export type ApiMethods<F> = {
578
606
  protect_content?: boolean;
579
607
  /** Description of the message to reply to */
580
608
  reply_parameters?: ReplyParameters;
581
- /** 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. */
609
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
582
610
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
583
611
  /** @deprecated Use `reply_parameters` instead. */
584
612
  reply_to_message_id?: number;
@@ -589,11 +617,13 @@ export type ApiMethods<F> = {
589
617
 
590
618
  We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. */
591
619
  sendChatAction(args: {
620
+ /** Unique identifier of the business connection on behalf of which the action will be sent */
621
+ business_connection_id?: string;
592
622
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
593
623
  chat_id: number | string;
594
624
  /** 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. */
595
625
  action: "typing" | "upload_photo" | "record_video" | "upload_video" | "record_voice" | "upload_voice" | "upload_document" | "choose_sticker" | "find_location" | "record_video_note" | "upload_video_note";
596
- /** Unique identifier for the target message thread; supergroups only */
626
+ /** Unique identifier for the target message thread; for supergroups only */
597
627
  message_thread_id?: number;
598
628
  }): true;
599
629
  /** 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. */
@@ -602,7 +632,7 @@ export type ApiMethods<F> = {
602
632
  chat_id: number | string;
603
633
  /** Identifier of the target message */
604
634
  message_id: number;
605
- /** 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. */
635
+ /** A 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. */
606
636
  reaction?: ReactionType[];
607
637
  /** Pass True to set the reaction with a big animation */
608
638
  is_big?: boolean;
@@ -679,21 +709,19 @@ export type ApiMethods<F> = {
679
709
  can_promote_members?: boolean;
680
710
  /** Pass True if the administrator can change chat title, photo and other settings */
681
711
  can_change_info?: boolean;
682
- /** Pass True if the administrator can invite new users to the chat */
683
- can_invite_users?: boolean;
684
- /** Pass True if the administrator can post messages in the channel, or access channel statistics; channels only */
685
- can_post_messages?: boolean;
686
- /** Pass True if the administrator can edit messages of other users and can pin messages; channels only */
687
- can_edit_messages?: boolean;
688
- /** Pass True if the administrator can pin messages, supergroups only */
689
- can_pin_messages?: boolean;
690
- /** Pass True if the administrator can post stories to the chat */
712
+ /** True if the administrator can post stories to the chat */
691
713
  can_post_stories?: boolean;
692
- /** Pass True if the administrator can edit stories posted by other users */
714
+ /** True if the administrator can edit stories posted by other users */
693
715
  can_edit_stories?: boolean;
694
- /** Pass True if the administrator can delete stories posted by other users */
716
+ /** True if the administrator can delete stories posted by other users */
695
717
  can_delete_stories?: boolean;
696
- /** Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only */
718
+ /** True if the administrator can post messages in the channel, or access channel statistics; for channels only */
719
+ can_post_messages?: boolean;
720
+ /** True if the administrator can edit messages of other users and can pin messages; for channels only */
721
+ can_edit_messages?: boolean;
722
+ /** True if the administrator can pin messages; for supergroups only */
723
+ can_pin_messages?: boolean;
724
+ /** True if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
697
725
  can_manage_topics?: boolean;
698
726
  }): true;
699
727
  /** Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. */
@@ -981,6 +1009,11 @@ export type ApiMethods<F> = {
981
1009
  /** Unique identifier of the target user */
982
1010
  user_id: number;
983
1011
  }): UserChatBoosts;
1012
+ /** Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success. */
1013
+ getBusinessConnection(args: {
1014
+ /** Unique identifier of the business connection */
1015
+ business_connection_id: string;
1016
+ }): BusinessConnection;
984
1017
  /** 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. */
985
1018
  setMyCommands(args: {
986
1019
  /** A list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
@@ -1153,16 +1186,18 @@ export type ApiMethods<F> = {
1153
1186
  deleteMessages(args: {
1154
1187
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1155
1188
  chat_id: number | string;
1156
- /** Identifiers of 1-100 messages to delete. See deleteMessage for limitations on which messages can be deleted */
1189
+ /** A list of 1-100 identifiers of messages to delete. See deleteMessage for limitations on which messages can be deleted */
1157
1190
  message_ids: number[];
1158
1191
  }): true;
1159
1192
  /** Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers. On success, the sent Message is returned. */
1160
1193
  sendSticker(args: {
1194
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
1195
+ business_connection_id?: string;
1161
1196
  /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1162
1197
  chat_id: number | string;
1163
1198
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1164
1199
  message_thread_id?: number;
1165
- /** Sticker 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 .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker using multipart/form-data. Video stickers can only be sent by a file_id. Animated stickers can't be sent via an HTTP URL. */
1200
+ /** Sticker 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 .WEBP sticker from the Internet, or upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data. Video and animated stickers can't be sent via an HTTP URL. */
1166
1201
  sticker: F | string;
1167
1202
  /** Emoji associated with the sticker; only for just uploaded stickers */
1168
1203
  emoji?: string;
@@ -1172,7 +1207,7 @@ export type ApiMethods<F> = {
1172
1207
  protect_content?: boolean;
1173
1208
  /** Description of the message to reply to */
1174
1209
  reply_parameters?: ReplyParameters;
1175
- /** 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. */
1210
+ /** Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account. */
1176
1211
  reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply;
1177
1212
  /** @deprecated Use `reply_parameters` instead. */
1178
1213
  reply_to_message_id?: number;
@@ -1184,10 +1219,10 @@ export type ApiMethods<F> = {
1184
1219
  }): StickerSet;
1185
1220
  /** Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects. */
1186
1221
  getCustomEmojiStickers(args: {
1187
- /** List of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1222
+ /** A list of custom emoji identifiers. At most 200 custom emoji identifiers can be specified. */
1188
1223
  custom_emoji_ids: string[];
1189
1224
  }): Sticker[];
1190
- /** Use this method to upload a file with a sticker for later use in the createNewStickerSet and addStickerToSet methods (the file can be used multiple times). Returns the uploaded File on success. */
1225
+ /** Use this method to upload a file with a sticker for later use in the createNewStickerSet, addStickerToSet, or replaceStickerInSet methods (the file can be used multiple times). Returns the uploaded File on success. */
1191
1226
  uploadStickerFile(args: {
1192
1227
  /** User identifier of sticker file owner */
1193
1228
  user_id: number;
@@ -1206,14 +1241,12 @@ export type ApiMethods<F> = {
1206
1241
  title: string;
1207
1242
  /** A list of 1-50 initial stickers to be added to the sticker set */
1208
1243
  stickers: InputSticker<F>[];
1209
- /** Format of the sticker, must be one of “static”, “animated”, “video” */
1210
- sticker_format: "static" | "animated" | "video";
1211
1244
  /** Type of stickers in the set, pass “regular”, “mask”, or “custom_emoji”. By default, a regular sticker set is created. */
1212
1245
  sticker_type?: "regular" | "mask" | "custom_emoji";
1213
1246
  /** Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only */
1214
1247
  needs_repainting?: boolean;
1215
1248
  }): true;
1216
- /** Use this method to add a new sticker to a set created by the bot. The format of the added sticker must match the format of the other stickers in the set. Emoji sticker sets can have up to 200 stickers. Animated and video sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success. */
1249
+ /** Use this method to add a new sticker to a set created by the bot. Emoji sticker sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers. Returns True on success. */
1217
1250
  addStickerToSet(args: {
1218
1251
  /** User identifier of sticker set owner */
1219
1252
  user_id: number;
@@ -1234,6 +1267,17 @@ export type ApiMethods<F> = {
1234
1267
  /** File identifier of the sticker */
1235
1268
  sticker: string;
1236
1269
  }): true;
1270
+ /** Use this method to replace an existing sticker in a sticker set with a new one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet, then setStickerPositionInSet. Returns True on success. */
1271
+ replaceStickerInSet(args: {
1272
+ /** User identifier of the sticker set owner */
1273
+ user_id: number;
1274
+ /** Sticker set name */
1275
+ name: string;
1276
+ /** File identifier of the replaced sticker */
1277
+ old_sticker: string;
1278
+ /** An object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set remains unchanged.:x */
1279
+ sticker: InputSticker<F>;
1280
+ }): true;
1237
1281
  /** Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success. */
1238
1282
  setStickerEmojiList(args: {
1239
1283
  /** File identifier of the sticker */
@@ -1275,6 +1319,8 @@ export type ApiMethods<F> = {
1275
1319
  user_id: number;
1276
1320
  /** A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements), or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, 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. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail. */
1277
1321
  thumbnail?: F | string;
1322
+ /** Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a WEBM video */
1323
+ format: "static" | "animated" | "video";
1278
1324
  }): true;
1279
1325
  /** Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success. */
1280
1326
  setCustomEmojiStickerSetThumbnail(args: {
@@ -1441,6 +1487,8 @@ export type ApiMethods<F> = {
1441
1487
  }): true;
1442
1488
  /** Use this method to send a game. On success, the sent Message is returned. */
1443
1489
  sendGame(args: {
1490
+ /** Unique identifier of the business connection on behalf of which the message will be sent */
1491
+ business_connection_id?: string;
1444
1492
  /** Unique identifier for the target chat */
1445
1493
  chat_id: number;
1446
1494
  /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
@@ -1453,7 +1501,7 @@ export type ApiMethods<F> = {
1453
1501
  protect_content?: boolean;
1454
1502
  /** Description of the message to reply to */
1455
1503
  reply_parameters?: ReplyParameters;
1456
- /** 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. */
1504
+ /** 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. Not supported for messages sent on behalf of a business account. */
1457
1505
  reply_markup?: InlineKeyboardMarkup;
1458
1506
  /** @deprecated Use `reply_parameters` instead. */
1459
1507
  reply_to_message_id?: number;
@@ -1493,6 +1541,8 @@ export type ApiMethods<F> = {
1493
1541
  export interface InputSticker<F> {
1494
1542
  /** The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, 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. Animated and video stickers can't be uploaded via HTTP URL. */
1495
1543
  sticker: F | string;
1544
+ /** Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a WEBM video */
1545
+ format: "static" | "animated" | "video";
1496
1546
  /** List of 1-20 emoji associated with the sticker */
1497
1547
  emoji_list: string[];
1498
1548
  /** Position where the mask should be placed on faces. For “mask” stickers only. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammyjs/types",
3
- "version": "3.5.1",
3
+ "version": "3.6.0",
4
4
  "description": "Telegram Bot API type declarations for grammY",
5
5
  "main": "mod.js",
6
6
  "repository": {
package/passport.d.ts CHANGED
@@ -20,21 +20,21 @@ export interface PassportFile {
20
20
  export interface EncryptedPassportElement {
21
21
  /** Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”. */
22
22
  type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email";
23
- /** Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */
23
+ /** Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */
24
24
  data?: string;
25
- /** User's verified phone number, available only for “phone_number” type */
25
+ /** User's verified phone number; available only for “phone_number” type */
26
26
  phone_number?: string;
27
- /** User's verified email address, available only for “email” type */
27
+ /** User's verified email address; available only for “email” type */
28
28
  email?: string;
29
- /** Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
29
+ /** Array of encrypted files with documents provided by the user; available only for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
30
30
  files?: PassportFile[];
31
- /** Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
31
+ /** Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
32
32
  front_side?: PassportFile;
33
- /** Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
33
+ /** Encrypted file with the reverse side of the document, provided by the user; available only for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
34
34
  reverse_side?: PassportFile;
35
- /** Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
35
+ /** Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */
36
36
  selfie?: PassportFile;
37
- /** Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
37
+ /** Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. */
38
38
  translation?: PassportFile[];
39
39
  /** Base64-encoded element hash for using in PassportElementErrorUnspecified */
40
40
  hash: string;
package/update.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ChosenInlineResult, InlineQuery } from "./inline.js";
2
- import type { Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
2
+ import type { BusinessConnection, BusinessMessagesDeleted, Chat, ChatBoostRemoved, ChatBoostUpdated, ChatJoinRequest, ChatMemberUpdated, User } from "./manage.js";
3
3
  import type { CallbackQuery } from "./markup.js";
4
4
  import type { Message, MessageReactionCountUpdated, MessageReactionUpdated, Poll, PollAnswer } from "./message.js";
5
5
  import type { PreCheckoutQuery, ShippingQuery } from "./payment.js";
@@ -33,6 +33,14 @@ 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. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. */
35
35
  edited_channel_post?: Message & Update.Edited & Update.Channel;
36
+ /** The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot */
37
+ business_connection?: BusinessConnection;
38
+ /** New non-service message from a connected business account */
39
+ business_message?: Message;
40
+ /** New version of a message from a connected business account */
41
+ edited_business_message?: Message;
42
+ /** Messages were deleted from a connected business account */
43
+ deleted_business_messages?: BusinessMessagesDeleted;
36
44
  /** 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
45
  message_reaction?: MessageReactionUpdated;
38
46
  /** 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. The updates are grouped and can be sent with delay up to a few minutes. */