@telegram.ts/types 1.8.0 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telegram.ts/types",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Comprehensive Type Declarations for Telegram Bot API with telegramsjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -7,9 +7,9 @@ import type {
7
7
  BotCommand,
8
8
  BusinessConnection,
9
9
  ChatAdministratorRights,
10
- ChatFromGetChat,
11
10
  ChatInviteLink,
12
11
  ChatMember,
12
+ ChatFullInfo,
13
13
  ChatMemberAdministrator,
14
14
  ChatMemberOwner,
15
15
  ChatPermissions,
@@ -28,6 +28,7 @@ import type {
28
28
  import type {
29
29
  File,
30
30
  GameHighScore,
31
+ InputPollOption,
31
32
  LinkPreviewOptions,
32
33
  MaskPosition,
33
34
  Message,
@@ -141,7 +142,7 @@ export type ApiMethods = {
141
142
  protect_content?: boolean;
142
143
  /** Description of the message to reply to */
143
144
  reply_parameters?: ReplyParameters;
144
- /** 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. */
145
+ /** 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. */
145
146
  reply_markup?:
146
147
  | InlineKeyboardMarkup
147
148
  | ReplyKeyboardMarkup
@@ -205,7 +206,7 @@ export type ApiMethods = {
205
206
  protect_content?: boolean;
206
207
  /** Description of the message to reply to */
207
208
  reply_parameters?: ReplyParameters;
208
- /** 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. */
209
+ /** 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. */
209
210
  reply_markup?:
210
211
  | InlineKeyboardMarkup
211
212
  | ReplyKeyboardMarkup
@@ -257,7 +258,7 @@ export type ApiMethods = {
257
258
  protect_content?: boolean;
258
259
  /** Description of the message to reply to */
259
260
  reply_parameters?: ReplyParameters;
260
- /** 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
+ /** 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. */
261
262
  reply_markup?:
262
263
  | InlineKeyboardMarkup
263
264
  | ReplyKeyboardMarkup
@@ -267,9 +268,7 @@ export type ApiMethods = {
267
268
  reply_to_message_id?: number;
268
269
  }): Message.PhotoMessage;
269
270
 
270
- /** Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
271
-
272
- For sending voice messages, use the sendVoice method instead. */
271
+ /** 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, or in .MP3 format, or in .M4A format (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. */
273
272
  sendAudio(args: {
274
273
  /** Unique identifier of the business connection on behalf of which the message will be sent */
275
274
  business_connection_id?: string;
@@ -299,7 +298,7 @@ export type ApiMethods = {
299
298
  protect_content?: boolean;
300
299
  /** Description of the message to reply to */
301
300
  reply_parameters?: ReplyParameters;
302
- /** 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. */
301
+ /** 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. */
303
302
  reply_markup?:
304
303
  | InlineKeyboardMarkup
305
304
  | ReplyKeyboardMarkup
@@ -335,7 +334,7 @@ export type ApiMethods = {
335
334
  protect_content?: boolean;
336
335
  /** Description of the message to reply to */
337
336
  reply_parameters?: ReplyParameters;
338
- /** 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. */
337
+ /** 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. */
339
338
  reply_markup?:
340
339
  | InlineKeyboardMarkup
341
340
  | ReplyKeyboardMarkup
@@ -379,7 +378,7 @@ export type ApiMethods = {
379
378
  protect_content?: boolean;
380
379
  /** Description of the message to reply to */
381
380
  reply_parameters?: ReplyParameters;
382
- /** 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. */
381
+ /** 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. */
383
382
  reply_markup?:
384
383
  | InlineKeyboardMarkup
385
384
  | ReplyKeyboardMarkup
@@ -421,7 +420,7 @@ export type ApiMethods = {
421
420
  protect_content?: boolean;
422
421
  /** Description of the message to reply to */
423
422
  reply_parameters?: ReplyParameters;
424
- /** 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. */
423
+ /** 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. */
425
424
  reply_markup?:
426
425
  | InlineKeyboardMarkup
427
426
  | ReplyKeyboardMarkup
@@ -455,7 +454,7 @@ export type ApiMethods = {
455
454
  protect_content?: boolean;
456
455
  /** Description of the message to reply to */
457
456
  reply_parameters?: ReplyParameters;
458
- /** 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. */
457
+ /** 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. */
459
458
  reply_markup?:
460
459
  | InlineKeyboardMarkup
461
460
  | ReplyKeyboardMarkup
@@ -488,7 +487,7 @@ export type ApiMethods = {
488
487
  protect_content?: boolean;
489
488
  /** Description of the message to reply to */
490
489
  reply_parameters?: ReplyParameters;
491
- /** 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. */
490
+ /** 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. */
492
491
  reply_markup?:
493
492
  | InlineKeyboardMarkup
494
493
  | ReplyKeyboardMarkup
@@ -539,7 +538,7 @@ export type ApiMethods = {
539
538
  longitude: number;
540
539
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
541
540
  horizontal_accuracy?: number;
542
- /** Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. */
541
+ /** Period in seconds during which the location will be updated (see Live Locations, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
543
542
  live_period?: number;
544
543
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
545
544
  heading?: number;
@@ -551,7 +550,7 @@ export type ApiMethods = {
551
550
  protect_content?: boolean;
552
551
  /** Description of the message to reply to */
553
552
  reply_parameters?: ReplyParameters;
554
- /** 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. */
553
+ /** 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. */
555
554
  reply_markup?:
556
555
  | InlineKeyboardMarkup
557
556
  | ReplyKeyboardMarkup
@@ -573,6 +572,8 @@ export type ApiMethods = {
573
572
  latitude: number;
574
573
  /** Longitude of new location */
575
574
  longitude: number;
575
+ /** New period in seconds during which the location can be updated, starting from the message send date. If 0x7FFFFFFF is specified, then the location can be updated forever. Otherwise, the new value must not exceed the current live_period by more than a day, and the live location expiration date must remain within the next 90 days. If not specified, then live_period remains unchanged */
576
+ live_period?: number;
576
577
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
577
578
  horizontal_accuracy?: number;
578
579
  /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
@@ -625,7 +626,7 @@ export type ApiMethods = {
625
626
  protect_content?: boolean;
626
627
  /** Description of the message to reply to */
627
628
  reply_parameters?: ReplyParameters;
628
- /** 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. */
629
+ /** 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. */
629
630
  reply_markup?:
630
631
  | InlineKeyboardMarkup
631
632
  | ReplyKeyboardMarkup
@@ -657,7 +658,7 @@ export type ApiMethods = {
657
658
  protect_content?: boolean;
658
659
  /** Description of the message to reply to */
659
660
  reply_parameters?: ReplyParameters;
660
- /** 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. */
661
+ /** 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. */
661
662
  reply_markup?:
662
663
  | InlineKeyboardMarkup
663
664
  | ReplyKeyboardMarkup
@@ -677,8 +678,12 @@ export type ApiMethods = {
677
678
  message_thread_id?: number;
678
679
  /** Poll question, 1-300 characters */
679
680
  question: string;
680
- /** A list of answer options, 2-10 strings 1-100 characters each */
681
- options: readonly string[];
681
+ /** Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed */
682
+ question_parse_mode?: string;
683
+ /** A list of special entities that appear in the poll question. It can be specified instead of question_parse_mode */
684
+ question_entities?: MessageEntity[];
685
+ /** A list of 2-10 answer options */
686
+ options: InputPollOption[];
682
687
  /** True, if the poll needs to be anonymous, defaults to True */
683
688
  is_anonymous?: boolean;
684
689
  /** Poll type, “quiz” or “regular”, defaults to “regular” */
@@ -691,7 +696,7 @@ export type ApiMethods = {
691
696
  explanation?: string;
692
697
  /** Mode for parsing entities in the explanation. See formatting options for more details. */
693
698
  explanation_parse_mode?: ParseMode;
694
- /** A list of special entities that appear in the poll explanation, which can be specified instead of parse_mode */
699
+ /** A list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode */
695
700
  explanation_entities?: MessageEntity[];
696
701
  /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */
697
702
  open_period?: number;
@@ -705,7 +710,7 @@ export type ApiMethods = {
705
710
  protect_content?: boolean;
706
711
  /** Description of the message to reply to */
707
712
  reply_parameters?: ReplyParameters;
708
- /** 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. */
713
+ /** 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. */
709
714
  reply_markup?:
710
715
  | InlineKeyboardMarkup
711
716
  | ReplyKeyboardMarkup
@@ -731,7 +736,7 @@ export type ApiMethods = {
731
736
  protect_content?: boolean;
732
737
  /** Description of the message to reply to */
733
738
  reply_parameters?: ReplyParameters;
734
- /** 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. */
739
+ /** 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. */
735
740
  reply_markup?:
736
741
  | InlineKeyboardMarkup
737
742
  | ReplyKeyboardMarkup
@@ -862,7 +867,7 @@ export type ApiMethods = {
862
867
  can_invite_users?: boolean;
863
868
  /** True if the administrator can post stories to the chat */
864
869
  can_post_stories?: boolean;
865
- /** True if the administrator can edit stories posted by other users */
870
+ /** Pass True if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
866
871
  can_edit_stories?: boolean;
867
872
  /** True if the administrator can delete stories posted by other users */
868
873
  can_delete_stories?: boolean;
@@ -1034,11 +1039,11 @@ export type ApiMethods = {
1034
1039
  chat_id: number | string;
1035
1040
  }): true;
1036
1041
 
1037
- /** Use this method to get up to date information about the chat. Returns a Chat object on success. */
1042
+ /** Use this method to get up-to-date information about the chat. Returns a ChatFullInfo object on success. */
1038
1043
  getChat(args: {
1039
1044
  /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
1040
1045
  chat_id: number | string;
1041
- }): ChatFromGetChat;
1046
+ }): ChatFullInfo;
1042
1047
 
1043
1048
  /** Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects. */
1044
1049
  getChatAdministrators(args: {
@@ -1425,7 +1430,7 @@ export type ApiMethods = {
1425
1430
  protect_content?: boolean;
1426
1431
  /** Description of the message to reply to */
1427
1432
  reply_parameters?: ReplyParameters;
1428
- /** 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. */
1433
+ /** 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. */
1429
1434
  reply_markup?:
1430
1435
  | InlineKeyboardMarkup
1431
1436
  | ReplyKeyboardMarkup
@@ -1746,7 +1751,7 @@ export type ApiMethods = {
1746
1751
  protect_content?: boolean;
1747
1752
  /** Description of the message to reply to */
1748
1753
  reply_parameters?: ReplyParameters;
1749
- /** 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. */
1754
+ /** 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. */
1750
1755
  reply_markup?: InlineKeyboardMarkup;
1751
1756
  /** @deprecated Use `reply_parameters` instead. */
1752
1757
  reply_to_message_id?: number;
@@ -318,7 +318,7 @@ export interface InlineQueryResultLocation {
318
318
  title: string;
319
319
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
320
320
  horizontal_accuracy?: number;
321
- /** Period in seconds for which the location can be updated, should be between 60 and 86400. */
321
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
322
322
  live_period?: number;
323
323
  /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
324
324
  heading?: number;
@@ -615,7 +615,7 @@ export interface InputLocationMessageContent {
615
615
  longitude: number;
616
616
  /** The radius of uncertainty for the location, measured in meters; 0-1500 */
617
617
  horizontal_accuracy?: number;
618
- /** Period in seconds for which the location can be updated, should be between 60 and 86400. */
618
+ /** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
619
619
  live_period?: number;
620
620
  /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
621
621
  heading?: number;
@@ -64,189 +64,450 @@ export interface UserFromGetMe extends User {
64
64
  }
65
65
 
66
66
  export declare namespace Chat {
67
- // ABSTRACT
68
- /** Internal type holding properties that all kinds of chats share. */
69
- interface AbstractChat {
67
+ /** Internal type for private chats */
68
+ export interface PrivateChat {
70
69
  /** Unique identifier for this chat. */
71
70
  id: number;
72
- /** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
73
- type: string;
74
- }
75
-
76
- // HELPERS
77
- /** Internal type holding properties that those chats with user names share. */
78
- interface UserNameChat {
71
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
72
+ type: "private";
73
+ /** Title, for supergroups, channels and group chats */
74
+ title?: undefined;
79
75
  /** Username, for private chats, supergroups and channels if available */
80
76
  username?: string;
81
- }
82
- /** Internal type holding properties that those chats with titles share. */
83
- interface TitleChat {
84
- /** Title, for supergroups, channels and group chats */
85
- title: string;
86
- }
87
-
88
- // ==> CHATS
89
- /** Internal type representing private chats. */
90
- export interface PrivateChat extends AbstractChat, UserNameChat {
91
- type: "private";
92
77
  /** First name of the other party in a private chat */
93
78
  first_name: string;
94
79
  /** Last name of the other party in a private chat */
95
80
  last_name?: string;
81
+ /** True, if the supergroup chat is a forum (has topics enabled) */
82
+ is_forum?: undefined;
96
83
  }
97
- /** Internal type representing group chats. */
98
- export interface GroupChat extends AbstractChat, TitleChat {
84
+ /** Internal type for group chats */
85
+ export interface GroupChat {
86
+ /** Unique identifier for this chat. */
87
+ id: number;
88
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
99
89
  type: "group";
90
+ /** Title, for supergroups, channels and group chats */
91
+ title: string;
92
+ /** Username, for private chats, supergroups and channels if available */
93
+ username?: undefined;
94
+ /** First name of the other party in a private chat */
95
+ first_name?: undefined;
96
+ /** Last name of the other party in a private chat */
97
+ last_name?: undefined;
98
+ /** True, if the supergroup chat is a forum (has topics enabled) */
99
+ is_forum?: undefined;
100
100
  }
101
- /** Internal type representing super group chats. */
102
- export interface SupergroupChat
103
- extends AbstractChat,
104
- UserNameChat,
105
- TitleChat {
101
+ /** Internal type for supergroup chats */
102
+ export interface SupergroupChat {
103
+ /** Unique identifier for this chat. */
104
+ id: number;
105
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
106
106
  type: "supergroup";
107
+ /** Title, for supergroups, channels and group chats */
108
+ title: string;
109
+ /** Username, for private chats, supergroups and channels if available */
110
+ username?: string;
111
+ /** First name of the other party in a private chat */
112
+ first_name?: undefined;
113
+ /** Last name of the other party in a private chat */
114
+ last_name?: undefined;
107
115
  /** True, if the supergroup chat is a forum (has topics enabled) */
108
116
  is_forum?: true;
109
117
  }
110
- /** Internal type representing channel chats. */
111
- export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
118
+ /** Internal type for channel chats */
119
+ export interface ChannelChat {
120
+ /** Unique identifier for this chat. */
121
+ id: number;
122
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
112
123
  type: "channel";
124
+ /** Title, for supergroups, channels and group chats */
125
+ title: string;
126
+ /** Username, for private chats, supergroups and channels if available */
127
+ username?: string;
128
+ /** First name of the other party in a private chat */
129
+ first_name?: undefined;
130
+ /** Last name of the other party in a private chat */
131
+ last_name?: undefined;
132
+ /** True, if the supergroup chat is a forum (has topics enabled) */
133
+ is_forum?: undefined;
113
134
  }
135
+ }
114
136
 
115
- // GET CHAT HELPERS
116
- /** Internal type holding properties that those chats returned from `getChat` share. */
117
- interface GetChat {
118
- /** Chat photo. Returned only in getChat. */
137
+ /** This object represents a chat. */
138
+ export type Chat =
139
+ | Chat.PrivateChat
140
+ | Chat.GroupChat
141
+ | Chat.SupergroupChat
142
+ | Chat.ChannelChat;
143
+
144
+ export declare namespace ChatFullInfo {
145
+ /** Internal type for private chats */
146
+ export interface PrivateChat {
147
+ /** Unique identifier for this chat. */
148
+ id: number;
149
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
150
+ type: "private";
151
+ /** Title, for supergroups, channels and group chats */
152
+ title?: undefined;
153
+ /** Username, for private chats, supergroups and channels if available */
154
+ username?: string;
155
+ /** First name of the other party in a private chat */
156
+ first_name: string;
157
+ /** Last name of the other party in a private chat */
158
+ last_name?: string;
159
+ /** True, if the supergroup chat is a forum (has topics enabled) */
160
+ is_forum?: undefined;
161
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
162
+ accent_color_id: number;
163
+ /** The maximum number of reactions that can be set on a message in the chat */
164
+ max_reaction_count: number;
165
+ /** Chat photo */
119
166
  photo?: ChatPhoto;
120
- /** The most recent pinned message (by sending date). Returned only in getChat. */
167
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
168
+ active_usernames?: string[];
169
+ /** For private chats, the date of birth of the user */
170
+ birthdate?: Birthdate;
171
+ /** For private chats with business accounts, the intro of the business */
172
+ business_intro?: BusinessIntro;
173
+ /** For private chats with business accounts, the location of the business */
174
+ business_location?: BusinessLocation;
175
+ /** For private chats with business accounts, the opening hours of the business */
176
+ business_opening_hours?: BusinessOpeningHours;
177
+ /** For private chats, the personal channel of the user */
178
+ personal_chat?: Chat;
179
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
180
+ available_reactions?: ReactionType[];
181
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
182
+ background_custom_emoji_id?: string;
183
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */
184
+ profile_accent_color_id?: number;
185
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
186
+ profile_background_custom_emoji_id?: string;
187
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
188
+ emoji_status_custom_emoji_id?: string;
189
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
190
+ emoji_status_expiration_date?: number;
191
+ /** Bio of the other party in a private chat */
192
+ bio?: string;
193
+ /** 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 */
194
+ has_private_forwards?: true;
195
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
196
+ has_restricted_voice_and_video_messages?: true;
197
+ /** True, if users need to join the supergroup before they can send messages */
198
+ join_to_send_messages?: undefined;
199
+ /** True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
200
+ join_by_request?: undefined;
201
+ /** Description, for groups, supergroups and channel chats */
202
+ description?: undefined;
203
+ /** Primary invite link, for groups, supergroups and channel chats */
204
+ invite_link?: undefined;
205
+ /** The most recent pinned message (by sending date) */
121
206
  pinned_message?: Message;
122
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
207
+ /** Default chat member permissions, for groups and supergroups */
208
+ permissions?: undefined;
209
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
210
+ slow_mode_delay?: undefined;
211
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
212
+ unrestrict_boost_count?: undefined;
213
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
123
214
  message_auto_delete_time?: number;
124
- /** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
215
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
216
+ has_aggressive_anti_spam_enabled?: undefined;
217
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
218
+ has_hidden_members?: undefined;
219
+ /** True, if messages from the chat can't be forwarded to other chats */
125
220
  has_protected_content?: true;
221
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
222
+ has_visible_history?: undefined;
223
+ /** For supergroups, name of the group sticker set */
224
+ sticker_set_name?: undefined;
225
+ /** True, if the bot can change the group sticker set */
226
+ can_set_sticker_set?: undefined;
227
+ /** 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. */
228
+ custom_emoji_sticker_set_name?: undefined;
229
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
230
+ linked_chat_id?: undefined;
231
+ /** For supergroups, the location to which the supergroup is connected */
232
+ location?: undefined;
126
233
  }
127
- /** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
128
- interface NonGroupGetChat {
129
- /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
130
- active_usernames?: string[];
131
- }
132
- /** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
133
- interface NonPrivateGetChat {
134
- /** Description, for groups, supergroups and channel chats. Returned only in getChat. */
234
+ /** Internal type for group chats */
235
+ export interface GroupChat {
236
+ /** Unique identifier for this chat. */
237
+ id: number;
238
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
239
+ type: "group";
240
+ /** Title, for supergroups, channels and group chats */
241
+ title?: string;
242
+ /** Username, for private chats, supergroups and channels if available */
243
+ username?: undefined;
244
+ /** First name of the other party in a private chat */
245
+ first_name?: undefined;
246
+ /** Last name of the other party in a private chat */
247
+ last_name?: undefined;
248
+ /** True, if the supergroup chat is a forum (has topics enabled) */
249
+ is_forum?: undefined;
250
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
251
+ accent_color_id: number;
252
+ /** The maximum number of reactions that can be set on a message in the chat */
253
+ max_reaction_count: number;
254
+ /** Chat photo */
255
+ photo?: ChatPhoto;
256
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
257
+ active_usernames?: undefined;
258
+ /** For private chats, the date of birth of the user */
259
+ birthdate?: undefined;
260
+ /** For private chats with business accounts, the intro of the business */
261
+ business_intro?: undefined;
262
+ /** For private chats with business accounts, the location of the business */
263
+ business_location?: undefined;
264
+ /** For private chats with business accounts, the opening hours of the business */
265
+ business_opening_hours?: undefined;
266
+ /** For private chats, the personal channel of the user */
267
+ personal_chat?: undefined;
268
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
269
+ available_reactions?: ReactionType[];
270
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
271
+ background_custom_emoji_id?: string;
272
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */
273
+ profile_accent_color_id?: number;
274
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
275
+ profile_background_custom_emoji_id?: string;
276
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
277
+ emoji_status_custom_emoji_id?: string;
278
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
279
+ emoji_status_expiration_date?: number;
280
+ /** Bio of the other party in a private chat */
281
+ bio?: undefined;
282
+ /** 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 */
283
+ has_private_forwards?: undefined;
284
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
285
+ has_restricted_voice_and_video_messages?: undefined;
286
+ /** True, if users need to join the supergroup before they can send messages */
287
+ join_to_send_messages?: undefined;
288
+ /** True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
289
+ join_by_request?: undefined;
290
+ /** Description, for groups, supergroups and channel chats */
135
291
  description?: string;
136
- /** Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
292
+ /** Primary invite link, for groups, supergroups and channel chats */
137
293
  invite_link?: string;
138
- /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat. */
139
- available_reactions?: ReactionType[];
140
- }
141
- /** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
142
- interface MultiUserGetChat {
143
- /** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
294
+ /** The most recent pinned message (by sending date) */
295
+ pinned_message?: Message;
296
+ /** Default chat member permissions, for groups and supergroups */
144
297
  permissions?: ChatPermissions;
298
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
299
+ slow_mode_delay?: undefined;
300
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
301
+ unrestrict_boost_count?: undefined;
302
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
303
+ message_auto_delete_time?: number;
304
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
305
+ has_aggressive_anti_spam_enabled?: undefined;
306
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
307
+ has_hidden_members?: true;
308
+ /** True, if messages from the chat can't be forwarded to other chats */
309
+ has_protected_content?: true;
310
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
311
+ has_visible_history?: true;
312
+ /** For supergroups, name of the group sticker set */
313
+ sticker_set_name?: undefined;
314
+ /** True, if the bot can change the group sticker set */
315
+ can_set_sticker_set?: true;
316
+ /** 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. */
317
+ custom_emoji_sticker_set_name?: undefined;
318
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
319
+ linked_chat_id?: undefined;
320
+ /** For supergroups, the location to which the supergroup is connected */
321
+ location?: undefined;
145
322
  }
146
- /** Internal type holding properties that those private and channel chats returned from `getChat` share. */
147
- interface NonMultiUserGetChat {
148
- /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. */
323
+ /** Internal type for supergroup chats */
324
+ export interface SupergroupChat {
325
+ /** Unique identifier for this chat. */
326
+ id: number;
327
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
328
+ type: "supergroup";
329
+ /** Title, for supergroups, channels and group chats */
330
+ title?: string;
331
+ /** Username, for private chats, supergroups and channels if available */
332
+ username?: string;
333
+ /** First name of the other party in a private chat */
334
+ first_name?: undefined;
335
+ /** Last name of the other party in a private chat */
336
+ last_name?: undefined;
337
+ /** True, if the supergroup chat is a forum (has topics enabled) */
338
+ is_forum?: true;
339
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
149
340
  accent_color_id: number;
150
- /** Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat. */
341
+ /** The maximum number of reactions that can be set on a message in the chat */
342
+ max_reaction_count: number;
343
+ /** Chat photo */
344
+ photo?: ChatPhoto;
345
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
346
+ active_usernames?: string[];
347
+ /** For private chats, the date of birth of the user */
348
+ birthdate?: undefined;
349
+ /** For private chats with business accounts, the intro of the business */
350
+ business_intro?: undefined;
351
+ /** For private chats with business accounts, the location of the business */
352
+ business_location?: undefined;
353
+ /** For private chats with business accounts, the opening hours of the business */
354
+ business_opening_hours?: undefined;
355
+ /** For private chats, the personal channel of the user */
356
+ personal_chat?: undefined;
357
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
358
+ available_reactions?: ReactionType[];
359
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
151
360
  background_custom_emoji_id?: string;
152
- /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat. */
361
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */
362
+ profile_accent_color_id?: number;
363
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
364
+ profile_background_custom_emoji_id?: string;
365
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
153
366
  emoji_status_custom_emoji_id?: string;
154
- /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat. */
367
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
155
368
  emoji_status_expiration_date?: number;
156
- }
157
- /** Internal type holding properties that those supergroup and channel chats returned from `getChat` share. */
158
- interface LargeGetChat {
159
- /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in getChat. */
160
- linked_chat_id?: number;
161
- }
162
-
163
- // ==> GET CHATS
164
- /** Internal type representing private chats returned from `getChat`. */
165
- export interface PrivateGetChat
166
- extends PrivateChat,
167
- GetChat,
168
- NonGroupGetChat,
169
- NonMultiUserGetChat {
170
- /** For private chats, the date of birth of the user. Returned only in getChat. */
171
- birthdate?: Birthdate;
172
- /** For private chats with business accounts, the intro of the business. Returned only in getChat. */
173
- business_intro?: BusinessIntro;
174
- /** For private chats with business accounts, the location of the business. Returned only in getChat. */
175
- business_location?: BusinessLocation;
176
- /** For private chats with business accounts, the opening hours of the business. Returned only in getChat. */
177
- business_opening_hours?: BusinessOpeningHours;
178
- /** For private chats, the personal channel of the user. Returned only in getChat. */
179
- personal_chat?: Chat.ChannelChat;
180
- /** Bio of the other party in a private chat. Returned only in getChat. */
369
+ /** Bio of the other party in a private chat */
181
370
  bio?: string;
182
- /** 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. */
183
- has_private_forwards?: true;
184
- /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
185
- has_restricted_voice_and_video_messages?: true;
186
- }
187
- /** Internal type representing group chats returned from `getChat`. */
188
- export interface GroupGetChat
189
- extends GroupChat,
190
- GetChat,
191
- NonPrivateGetChat,
192
- MultiUserGetChat {}
193
- /** Internal type representing supergroup chats returned from `getChat`. */
194
- export interface SupergroupGetChat
195
- extends SupergroupChat,
196
- GetChat,
197
- NonGroupGetChat,
198
- NonPrivateGetChat,
199
- MultiUserGetChat,
200
- LargeGetChat {
201
- /** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */
371
+ /** 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 */
372
+ has_private_forwards?: undefined;
373
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
374
+ has_restricted_voice_and_video_messages?: undefined;
375
+ /** True, if users need to join the supergroup before they can send messages */
202
376
  join_to_send_messages?: true;
203
- /** True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */
377
+ /** True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
204
378
  join_by_request?: true;
205
- /** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
379
+ /** Description, for groups, supergroups and channel chats */
380
+ description?: string;
381
+ /** Primary invite link, for groups, supergroups and channel chats */
382
+ invite_link?: string;
383
+ /** The most recent pinned message (by sending date) */
384
+ pinned_message?: Message;
385
+ /** Default chat member permissions, for groups and supergroups */
386
+ permissions?: ChatPermissions;
387
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
206
388
  slow_mode_delay?: number;
207
- /** 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. */
389
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
208
390
  unrestrict_boost_count?: number;
209
- /** True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat. */
210
- has_visible_history?: boolean;
211
- /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
391
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
392
+ message_auto_delete_time?: number;
393
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
212
394
  has_aggressive_anti_spam_enabled?: true;
213
- /** For supergroups, name of group sticker set. Returned only in getChat. */
395
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
396
+ has_hidden_members?: true;
397
+ /** True, if messages from the chat can't be forwarded to other chats */
398
+ has_protected_content?: true;
399
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
400
+ has_visible_history?: true;
401
+ /** For supergroups, name of the group sticker set */
214
402
  sticker_set_name?: string;
215
- /** True, if the bot can change the group sticker set. Returned only in getChat. */
403
+ /** True, if the bot can change the group sticker set */
216
404
  can_set_sticker_set?: true;
217
- /** 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. */
405
+ /** 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. */
218
406
  custom_emoji_sticker_set_name?: string;
219
- /** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
407
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
408
+ linked_chat_id?: number;
409
+ /** For supergroups, the location to which the supergroup is connected */
220
410
  location?: ChatLocation;
221
411
  }
222
- /** Internal type representing channel chats returned from `getChat`. */
223
- export interface ChannelGetChat
224
- extends ChannelChat,
225
- GetChat,
226
- NonGroupGetChat,
227
- NonPrivateGetChat,
228
- NonMultiUserGetChat,
229
- LargeGetChat {
230
- /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat. */
412
+ /** Internal type for channel chats */
413
+ export interface ChannelChat {
414
+ /** Unique identifier for this chat. */
415
+ id: number;
416
+ /** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
417
+ type: "channel";
418
+ /** Title, for supergroups, channels and group chats */
419
+ title?: string;
420
+ /** Username, for private chats, supergroups and channels if available */
421
+ username?: string;
422
+ /** First name of the other party in a private chat */
423
+ first_name?: undefined;
424
+ /** Last name of the other party in a private chat */
425
+ last_name?: undefined;
426
+ /** True, if the supergroup chat is a forum (has topics enabled) */
427
+ is_forum?: undefined;
428
+ /** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */
429
+ accent_color_id: number;
430
+ /** The maximum number of reactions that can be set on a message in the chat */
431
+ max_reaction_count: number;
432
+ /** Chat photo */
433
+ photo?: ChatPhoto;
434
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */
435
+ active_usernames?: string[];
436
+ /** For private chats, the date of birth of the user */
437
+ birthdate?: undefined;
438
+ /** For private chats with business accounts, the intro of the business */
439
+ business_intro?: undefined;
440
+ /** For private chats with business accounts, the location of the business */
441
+ business_location?: undefined;
442
+ /** For private chats with business accounts, the opening hours of the business */
443
+ business_opening_hours?: undefined;
444
+ /** For private chats, the personal channel of the user */
445
+ personal_chat?: undefined;
446
+ /** List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */
447
+ available_reactions?: ReactionType[];
448
+ /** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
449
+ background_custom_emoji_id?: string;
450
+ /** Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */
231
451
  profile_accent_color_id?: number;
232
- /** Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat. */
452
+ /** Custom emoji identifier of the emoji chosen by the chat for its profile background */
233
453
  profile_background_custom_emoji_id?: string;
454
+ /** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
455
+ emoji_status_custom_emoji_id?: string;
456
+ /** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
457
+ emoji_status_expiration_date?: number;
458
+ /** Bio of the other party in a private chat */
459
+ bio?: undefined;
460
+ /** 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 */
461
+ has_private_forwards?: undefined;
462
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
463
+ has_restricted_voice_and_video_messages?: undefined;
464
+ /** True, if users need to join the supergroup before they can send messages */
465
+ join_to_send_messages?: true;
466
+ /** True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
467
+ join_by_request?: undefined;
468
+ /** Description, for groups, supergroups and channel chats */
469
+ description?: string;
470
+ /** Primary invite link, for groups, supergroups and channel chats */
471
+ invite_link?: string;
472
+ /** The most recent pinned message (by sending date) */
473
+ pinned_message?: Message;
474
+ /** Default chat member permissions, for groups and supergroups */
475
+ permissions?: undefined;
476
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
477
+ slow_mode_delay?: undefined;
478
+ /** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
479
+ unrestrict_boost_count?: undefined;
480
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds */
481
+ message_auto_delete_time?: number;
482
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
483
+ has_aggressive_anti_spam_enabled?: undefined;
484
+ /** True, if non-administrators can only get the list of bots and administrators in the chat */
485
+ has_hidden_members?: undefined;
486
+ /** True, if messages from the chat can't be forwarded to other chats */
487
+ has_protected_content?: true;
488
+ /** True, if new chat members will have access to old messages; available only to chat administrators */
489
+ has_visible_history?: undefined;
490
+ /** For supergroups, name of the group sticker set */
491
+ sticker_set_name?: undefined;
492
+ /** True, if the bot can change the group sticker set */
493
+ can_set_sticker_set?: undefined;
494
+ /** 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. */
495
+ custom_emoji_sticker_set_name?: undefined;
496
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
497
+ linked_chat_id?: number;
498
+ /** For supergroups, the location to which the supergroup is connected */
499
+ location?: undefined;
234
500
  }
235
501
  }
236
502
 
237
- /** This object represents a chat. */
238
- export type Chat =
239
- | Chat.PrivateChat
240
- | Chat.GroupChat
241
- | Chat.SupergroupChat
242
- | Chat.ChannelChat;
243
-
244
- /** This object represents a Telegram user or bot that was returned by `getChat`. */
245
- export type ChatFromGetChat =
246
- | Chat.PrivateGetChat
247
- | Chat.GroupGetChat
248
- | Chat.SupergroupGetChat
249
- | Chat.ChannelGetChat;
503
+ /** This object contains full information about a chat. */
504
+ export type ChatFullInfo =
505
+ | ChatFullInfo.PrivateChat
506
+ | ChatFullInfo.GroupChat
507
+ | ChatFullInfo.SupergroupChat
508
+ | ChatFullInfo.ChannelChat;
509
+ /** @deprecated use ChatFullInfo instead */
510
+ export type ChatFromGetChat = ChatFullInfo;
250
511
 
251
512
  /** This object represent a user's profile pictures. */
252
513
  export interface UserProfilePhotos {
@@ -310,9 +571,9 @@ export interface ChatAdministratorRights {
310
571
  can_invite_users: boolean;
311
572
  /** True, if the administrator can post stories to the chat */
312
573
  can_post_stories: boolean;
313
- /** True, if the administrator can edit stories posted by other users */
574
+ /** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
314
575
  can_edit_stories: boolean;
315
- /** True, if the administrator can delete stories posted by other users; channels only */
576
+ /** True, if the administrator can delete stories posted by other users */
316
577
  can_delete_stories: boolean;
317
578
  /** True, if the administrator can post messages in the channel, or access channel statistics; for channels only */
318
579
  can_post_messages?: boolean;
@@ -338,6 +599,8 @@ export interface ChatMemberUpdated {
338
599
  new_chat_member: ChatMember;
339
600
  /** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
340
601
  invite_link?: ChatInviteLink;
602
+ /** True, if the user joined the chat after sending a direct join request without using an invite link without using an invite link and being approved by an administrator */
603
+ via_join_request?: boolean;
341
604
  /** True, if the user joined the chat via a chat folder invite link */
342
605
  via_chat_folder_invite_link?: boolean;
343
606
  }
@@ -395,7 +658,7 @@ export interface ChatMemberAdministrator {
395
658
  can_invite_users: boolean;
396
659
  /** True, if the administrator can post stories to the chat */
397
660
  can_post_stories: boolean;
398
- /** True, if the administrator can edit stories posted by other users */
661
+ /** True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
399
662
  can_edit_stories: boolean;
400
663
  /** True, if the administrator can delete stories posted by other users */
401
664
  can_delete_stories: boolean;
@@ -525,6 +788,7 @@ export interface ChatPermissions {
525
788
  can_manage_topics?: boolean;
526
789
  }
527
790
 
791
+ /** Describes the birthdate of a user. */
528
792
  export interface Birthdate {
529
793
  /** Day of the user's birth; 1-31 */
530
794
  day: number;
@@ -534,6 +798,7 @@ export interface Birthdate {
534
798
  year?: number;
535
799
  }
536
800
 
801
+ /** Contains information about the start page settings of a Telegram Business account. */
537
802
  export interface BusinessIntro {
538
803
  /** Title text of the business intro */
539
804
  title?: string;
@@ -543,6 +808,7 @@ export interface BusinessIntro {
543
808
  sticker?: Sticker;
544
809
  }
545
810
 
811
+ /** Contains information about the location of a Telegram Business account. */
546
812
  export interface BusinessLocation {
547
813
  /** Address of the business */
548
814
  address: string;
@@ -550,13 +816,15 @@ export interface BusinessLocation {
550
816
  location?: Location;
551
817
  }
552
818
 
819
+ /** Describes an interval of time during which a business is open. */
553
820
  export interface BusinessOpeningHoursInterval {
554
- /** 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 */
821
+ /** 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 */
555
822
  opening_minute: number;
556
- /** 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 */
823
+ /** 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 */
557
824
  closing_minute: number;
558
825
  }
559
826
 
827
+ /** Describes the opening hours of a business. */
560
828
  export interface BusinessOpeningHours {
561
829
  /** Unique name of the time zone for which the opening hours are defined */
562
830
  time_zone_name: string;
@@ -624,6 +892,10 @@ export interface ChatBoostSourceGiveaway {
624
892
  source: "giveaway";
625
893
  /** Identifier of a message in the chat with the giveaway; the message could have been deleted already */
626
894
  giveaway_message_id: number;
895
+ /** User that won the prize in the giveaway if any */
896
+ user?: User;
897
+ /** True, if the giveaway was completed, but there was no user to win the prize */
898
+ is_unclaimed?: true;
627
899
  }
628
900
 
629
901
  /** This object contains information about a chat boost. */
@@ -642,7 +914,7 @@ export interface ChatBoost {
642
914
  export interface ChatBoostUpdated {
643
915
  /** Chat which was boosted */
644
916
  chat: Chat;
645
- /** Infomation about the chat boost */
917
+ /** Information about the chat boost */
646
918
  boost: ChatBoost;
647
919
  }
648
920
 
@@ -686,6 +958,6 @@ export interface BusinessMessagesDeleted {
686
958
  business_connection_id: string;
687
959
  /** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
688
960
  chat: Chat.PrivateChat;
689
- /** A JSON-serialized list of identifiers of deleted messages in the chat of the business account */
961
+ /** The list of identifiers of deleted messages in the chat of the business account */
690
962
  message_ids: number[];
691
963
  }
@@ -17,11 +17,11 @@ export declare namespace InlineKeyboardButton {
17
17
  url: string;
18
18
  }
19
19
  export interface CallbackButton extends AbstractInlineKeyboardButton {
20
- /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
20
+ /** Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes. Not supported for messages sent on behalf of a Telegram Business account. */
21
21
  callback_data: string;
22
22
  }
23
23
  export interface WebAppButton extends AbstractInlineKeyboardButton {
24
- /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */
24
+ /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account. */
25
25
  web_app: WebAppInfo;
26
26
  }
27
27
  export interface LoginButton extends AbstractInlineKeyboardButton {
@@ -29,19 +29,19 @@ export declare namespace InlineKeyboardButton {
29
29
  login_url: LoginUrl;
30
30
  }
31
31
  export interface SwitchInlineButton extends AbstractInlineKeyboardButton {
32
- /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted. */
32
+ /** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent on behalf of a Telegram Business account. */
33
33
  switch_inline_query: string;
34
34
  }
35
35
  export interface SwitchInlineCurrentChatButton
36
36
  extends AbstractInlineKeyboardButton {
37
37
  /** If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.
38
38
 
39
- This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */
39
+ This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. Not supported in channels and for messages sent on behalf of a Telegram Business account. */
40
40
  switch_inline_query_current_chat: string;
41
41
  }
42
42
  export interface SwitchInlineChosenChatButton
43
43
  extends AbstractInlineKeyboardButton {
44
- /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field */
44
+ /** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent on behalf of a Telegram Business account. */
45
45
  switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat;
46
46
  }
47
47
  export interface GameButton extends AbstractInlineKeyboardButton {
@@ -122,7 +122,7 @@ export interface CallbackQuery {
122
122
  game_short_name?: string;
123
123
  }
124
124
 
125
- /** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). */
125
+ /** This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
126
126
  export interface ReplyKeyboardMarkup {
127
127
  /** Array of button rows, each represented by an Array of KeyboardButton objects */
128
128
  keyboard: KeyboardButton[][];
@@ -188,7 +188,7 @@ export interface KeyboardButtonPollType {
188
188
  type?: "quiz" | "regular";
189
189
  }
190
190
 
191
- /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). */
191
+ /** Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
192
192
  export interface ReplyKeyboardRemove {
193
193
  /** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */
194
194
  remove_keyboard: true;
@@ -198,7 +198,7 @@ export interface ReplyKeyboardRemove {
198
198
  selective?: boolean;
199
199
  }
200
200
 
201
- /** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
201
+ /** Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.
202
202
 
203
203
  Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
204
204
 
@@ -232,11 +232,11 @@ export interface KeyboardButtonRequestUsers {
232
232
  user_is_premium?: boolean;
233
233
  /** The maximum number of users to be selected; 1-10. Defaults to 1. */
234
234
  max_quantity?: boolean;
235
- /** Pass True to request the users' first and last name */
235
+ /** Pass True to request the users' first and last names */
236
236
  request_name?: boolean;
237
- /** Pass True to request the users' username */
237
+ /** Pass True to request the users' usernames */
238
238
  request_username?: boolean;
239
- /** Pass True to request the users' photo */
239
+ /** Pass True to request the users' photos */
240
240
  request_photo?: boolean;
241
241
  }
242
242
 
@@ -119,6 +119,8 @@ export declare namespace Message {
119
119
  export type ProximityAlertTriggeredMessage = ServiceMessage &
120
120
  MsgWith<"proximity_alert_triggered">;
121
121
  export type BoostAddedMessage = ServiceMessage & MsgWith<"boost_added">;
122
+ export type ChatBackgroundSetMessage = ServiceMessage &
123
+ MsgWith<"chat_background_set">;
122
124
  export type ForumTopicCreatedMessage = ServiceMessage &
123
125
  MsgWith<"forum_topic_created">;
124
126
  export type ForumTopicEditedMessage = ServiceMessage &
@@ -228,6 +230,8 @@ export interface Message extends Message.MediaMessage {
228
230
  proximity_alert_triggered?: ProximityAlertTriggered;
229
231
  /** Service message: user boosted the chat */
230
232
  boost_added?: ChatBoostAdded;
233
+ /* Service message: chat background set */
234
+ chat_background_set?: ChatBackground;
231
235
  /** Service message: forum topic created */
232
236
  forum_topic_created?: ForumTopicCreated;
233
237
  /** Service message: forum topic edited */
@@ -747,10 +751,22 @@ export interface Dice {
747
751
  export interface PollOption {
748
752
  /** Option text, 1-100 characters */
749
753
  text: string;
754
+ /** Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts */
755
+ text_entities?: MessageEntity[];
750
756
  /** Number of users that voted for this option */
751
757
  voter_count: number;
752
758
  }
753
759
 
760
+ /** This object contains information about one answer option in a poll to send. */
761
+ export interface InputPollOption {
762
+ /** Option text, 1-100 characters */
763
+ text: string;
764
+ /** Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed */
765
+ text_parse_mode?: string;
766
+ /** A list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode */
767
+ text_entities?: MessageEntity[];
768
+ }
769
+
754
770
  /** This object represents an answer of a user in a non-anonymous poll. */
755
771
  export interface PollAnswer {
756
772
  /** Unique poll identifier */
@@ -769,6 +785,8 @@ export interface Poll {
769
785
  id: string;
770
786
  /** Poll question, 1-300 characters */
771
787
  question: string;
788
+ /** Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions */
789
+ question_entities?: MessageEntity[];
772
790
  /** List of poll options */
773
791
  options: PollOption[];
774
792
  /** Total number of users that voted in the poll */
@@ -835,6 +853,14 @@ export interface Story {
835
853
  id: number;
836
854
  }
837
855
 
856
+ /** Describes data sent from a Web App to the bot. */
857
+ export interface WebAppData {
858
+ /** The data. Be aware that a bad client can send arbitrary data in this field. */
859
+ data: string;
860
+ /** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */
861
+ button_text: string;
862
+ }
863
+
838
864
  /** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
839
865
  export interface ProximityAlertTriggered {
840
866
  /** User that triggered the alert */
@@ -869,6 +895,115 @@ export interface ForumTopicEdited {
869
895
  icon_custom_emoji_id?: string;
870
896
  }
871
897
 
898
+ /** This object represents a service message about a user boosting a chat. */
899
+ export interface ChatBoostAdded {
900
+ /** Number of boosts added by the user */
901
+ boost_count: number;
902
+ }
903
+
904
+ /** This object describes the way a background is filled based on the selected colors. Currently, it can be one of
905
+ - BackgroundFillSolid
906
+ - BackgroundFillGradient
907
+ - BackgroundFillFreeformGradient */
908
+ export type BackgroundFill =
909
+ | BackgroundFillSolid
910
+ | BackgroundFillGradient
911
+ | BackgroundFillFreeformGradient;
912
+
913
+ /** The background is filled using the selected color. */
914
+ export interface BackgroundFillSolid {
915
+ /** Type of the background fill, always “solid” */
916
+ type: "solid";
917
+ /** The color of the background fill in the RGB24 format */
918
+ color: number;
919
+ }
920
+
921
+ /** The background is a gradient fill. */
922
+ export interface BackgroundFillGradient {
923
+ /** Type of the background fill, always “gradient” */
924
+ type: "gradient";
925
+ /** Top color of the gradient in the RGB24 format */
926
+ top_color: number;
927
+ /** Bottom color of the gradient in the RGB24 format */
928
+ bottom_color: number;
929
+ /** Clockwise rotation angle of the background fill in degrees; 0-359 */
930
+ rotation_angle: number;
931
+ }
932
+
933
+ /** The background is a freeform gradient that rotates after every message in the chat. */
934
+ export interface BackgroundFillFreeformGradient {
935
+ /** Type of the background fill, always “freeform_gradient” */
936
+ type: "freeform_gradient";
937
+ /** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
938
+ colors: number[];
939
+ }
940
+
941
+ /** This object describes the type of a background. Currently, it can be one of
942
+ - BackgroundTypeFill
943
+ - BackgroundTypeWallpaper
944
+ - BackgroundTypePattern
945
+ - BackgroundTypeChatTheme
946
+ - BackgroundTypeFill */
947
+ export type BackgroundType =
948
+ | BackgroundTypeFill
949
+ | BackgroundTypeWallpaper
950
+ | BackgroundTypePattern
951
+ | BackgroundTypeChatTheme;
952
+
953
+ /** The background is automatically filled based on the selected colors. */
954
+ export interface BackgroundTypeFill {
955
+ /** Type of the background, always “fill” */
956
+ type: "fill";
957
+ /** The background fill */
958
+ fill: BackgroundFill;
959
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
960
+ dark_theme_dimming: number;
961
+ }
962
+
963
+ /** The background is a wallpaper in the JPEG format. */
964
+ export interface BackgroundTypeWallpaper {
965
+ /** Type of the background, always “wallpaper” */
966
+ type: "wallpaper";
967
+ /** Document with the wallpaper */
968
+ document: Document;
969
+ /** Dimming of the background in dark themes, as a percentage; 0-100 */
970
+ dark_theme_dimming: number;
971
+ /** True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */
972
+ is_blurred?: true;
973
+ /** True, if the background moves slightly when the device is tilted */
974
+ is_moving?: true;
975
+ }
976
+
977
+ /** The background is a PNG or TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
978
+ export interface BackgroundTypePattern {
979
+ /** Type of the background, always “pattern” */
980
+ type: "pattern";
981
+ /** Document with the pattern */
982
+ document: Document;
983
+ /** The background fill that is combined with the pattern */
984
+ fill: BackgroundFill;
985
+ /** Intensity of the pattern when it is shown above the filled background; 0-100 */
986
+ intensity: number;
987
+ /** True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only */
988
+ is_inverted?: true;
989
+ /** True, if the background moves slightly when the device is tilted */
990
+ is_moving?: true;
991
+ }
992
+
993
+ /** The background is taken directly from a built-in chat theme. */
994
+ export interface BackgroundTypeChatTheme {
995
+ /** Type of the background, always “chat_theme” */
996
+ type: "chat_theme";
997
+ /** Name of the chat theme, which is usually an emoji */
998
+ theme_name: string;
999
+ }
1000
+
1001
+ /** This object represents a chat background. */
1002
+ export interface ChatBackground {
1003
+ /** Type of the background*/
1004
+ type: BackgroundType;
1005
+ }
1006
+
872
1007
  /** This object represents a service message about a forum topic closed in the chat. Currently holds no information. */
873
1008
  export interface ForumTopicClosed {}
874
1009
 
@@ -942,7 +1077,7 @@ export interface VideoChatParticipantsInvited {
942
1077
 
943
1078
  /** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button. */
944
1079
  export interface SharedUser {
945
- /** 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. */
1080
+ /** Identifier of the shared user. 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. */
946
1081
  user_id: number;
947
1082
  /** First name of the user, if the name was requested by the bot */
948
1083
  first_name?: string;
@@ -1131,7 +1266,9 @@ export interface File {
1131
1266
  file_path?: string;
1132
1267
  }
1133
1268
 
1134
- /** This object describes the type of a reaction. Currently, it can be one of */
1269
+ /** This object describes the type of a reaction. Currently, it can be one of
1270
+ - ReactionTypeEmoji
1271
+ - ReactionTypeCustomEmoji */
1135
1272
  export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
1136
1273
 
1137
1274
  /** The reaction is based on an emoji. */
@@ -89,7 +89,7 @@ export interface Update {
89
89
  /** The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot */
90
90
  business_connection?: BusinessConnection;
91
91
 
92
- /** New non-service message from a connected business account */
92
+ /** New message from a connected business account */
93
93
  business_message?: Message & Update.Private;
94
94
 
95
95
  /** New version of a message from a connected business account */