@grammyjs/types 2.12.0 → 3.0.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,264 +1,235 @@
1
- import { Location, Message, PhotoSize } from "./message";
2
- import { Update } from "./update";
3
-
1
+ import type { Location, Message, PhotoSize } from "./message.js";
2
+ import type { Update } from "./update.js";
4
3
  /** Describes the current status of a webhook. */
5
4
  export interface WebhookInfo {
6
- /** Webhook URL, may be empty if webhook is not set up */
7
- url?: string;
8
- /** True, if a custom certificate was provided for webhook certificate checks */
9
- has_custom_certificate: boolean;
10
- /** Number of updates awaiting delivery */
11
- pending_update_count: number;
12
- /** Currently used webhook IP address */
13
- ip_address?: string;
14
- /** Unix time for the most recent error that happened when trying to deliver an update via webhook */
15
- last_error_date: number;
16
- /** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
17
- last_error_message: string;
18
- /** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
19
- last_synchronization_error_date?: number;
20
- /** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
21
- max_connections: number;
22
- /** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
23
- allowed_updates: Array<Exclude<keyof Update, "update_id">>;
5
+ /** Webhook URL, may be empty if webhook is not set up */
6
+ url?: string;
7
+ /** True, if a custom certificate was provided for webhook certificate checks */
8
+ has_custom_certificate: boolean;
9
+ /** Number of updates awaiting delivery */
10
+ pending_update_count: number;
11
+ /** Currently used webhook IP address */
12
+ ip_address?: string;
13
+ /** Unix time for the most recent error that happened when trying to deliver an update via webhook */
14
+ last_error_date: number;
15
+ /** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
16
+ last_error_message: string;
17
+ /** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
18
+ last_synchronization_error_date?: number;
19
+ /** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
20
+ max_connections: number;
21
+ /** A list of update types the bot is subscribed to. Defaults to all update types except chat_member */
22
+ allowed_updates: Array<Exclude<keyof Update, "update_id">>;
24
23
  }
25
-
26
24
  /** This object represents a Telegram user or bot. */
27
25
  export interface User {
28
- /** Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */
29
- id: number;
30
- /** True, if this user is a bot */
31
- is_bot: boolean;
32
- /** User's or bot's first name */
33
- first_name: string;
34
- /** User's or bot's last name */
35
- last_name?: string;
36
- /** User's or bot's username */
37
- username?: string;
38
- /** IETF language tag of the user's language */
39
- language_code?: string;
40
- /** True, if this user is a Telegram Premium user */
41
- is_premium?: true;
42
- /** True, if this user added the bot to the attachment menu */
43
- added_to_attachment_menu?: true;
26
+ /** Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */
27
+ id: number;
28
+ /** True, if this user is a bot */
29
+ is_bot: boolean;
30
+ /** User's or bot's first name */
31
+ first_name: string;
32
+ /** User's or bot's last name */
33
+ last_name?: string;
34
+ /** User's or bot's username */
35
+ username?: string;
36
+ /** IETF language tag of the user's language */
37
+ language_code?: string;
38
+ /** True, if this user is a Telegram Premium user */
39
+ is_premium?: true;
40
+ /** True, if this user added the bot to the attachment menu */
41
+ added_to_attachment_menu?: true;
44
42
  }
45
-
46
43
  /** This object represents a Telegram user or bot that was returned by `getMe`. */
47
44
  export interface UserFromGetMe extends User {
48
- is_bot: true;
49
- username: string;
50
- /** True, if the bot can be invited to groups. Returned only in getMe. */
51
- can_join_groups: boolean;
52
- /** True, if privacy mode is disabled for the bot. Returned only in getMe. */
53
- can_read_all_group_messages: boolean;
54
- /** True, if the bot supports inline queries. Returned only in getMe. */
55
- supports_inline_queries: boolean;
45
+ is_bot: true;
46
+ username: string;
47
+ /** True, if the bot can be invited to groups. Returned only in getMe. */
48
+ can_join_groups: boolean;
49
+ /** True, if privacy mode is disabled for the bot. Returned only in getMe. */
50
+ can_read_all_group_messages: boolean;
51
+ /** True, if the bot supports inline queries. Returned only in getMe. */
52
+ supports_inline_queries: boolean;
56
53
  }
57
-
58
- export namespace Chat {
59
- // ABSTRACT
60
- /** Internal type holding properties that all kinds of chats share. */
61
- interface AbstractChat {
62
- /** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
63
- id: number;
64
- /** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
65
- type: string;
66
- }
67
-
68
- // HELPERS
69
- /** Internal type holding properties that those chats with user names share. */
70
- interface UserNameChat {
71
- /** Username, for private chats, supergroups and channels if available */
72
- username?: string;
73
- }
74
- /** Internal type holding properties that those chats with titles share. */
75
- interface TitleChat {
76
- /** Title, for supergroups, channels and group chats */
77
- title: string;
78
- }
79
-
80
- // ==> CHATS
81
- /** Internal type representing private chats. */
82
- export interface PrivateChat extends AbstractChat, UserNameChat {
83
- type: "private";
84
- /** First name of the other party in a private chat */
85
- first_name: string;
86
- /** Last name of the other party in a private chat */
87
- last_name?: string;
88
- }
89
- /** Internal type representing group chats. */
90
- export interface GroupChat extends AbstractChat, TitleChat {
91
- type: "group";
92
- }
93
- /** Internal type representing super group chats. */
94
- export interface SupergroupChat
95
- extends AbstractChat, UserNameChat, TitleChat {
96
- type: "supergroup";
97
- /** True, if the supergroup chat is a forum (has topics enabled) */
98
- is_forum?: true;
99
- }
100
- /** Internal type representing channel chats. */
101
- export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
102
- type: "channel";
103
- }
104
-
105
- // GET CHAT HELPERS
106
- /** Internal type holding properties that those chats returned from `getChat` share. */
107
- interface GetChat {
108
- /** Chat photo. Returned only in getChat. */
109
- photo?: ChatPhoto;
110
- /** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */
111
- join_to_send_messages?: true;
112
- /** True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */
113
- join_by_request?: true;
114
- /** The most recent pinned message (by sending date). Returned only in getChat. */
115
- pinned_message?: Message;
116
- /** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
117
- message_auto_delete_time?: number;
118
- /** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
119
- has_protected_content?: true;
120
- }
121
- /** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
122
- interface NonGroupGetChat extends GetChat {
123
- /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
124
- active_usernames?: string[];
125
- }
126
- /** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
127
- interface NonPrivateGetChat extends GetChat {
128
- /** Description, for groups, supergroups and channel chats. Returned only in getChat. */
129
- description?: string;
130
- /** Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
131
- invite_link?: string;
132
- }
133
- /** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
134
- interface MultiUserGetChat extends NonPrivateGetChat {
135
- /** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
136
- permissions?: ChatPermissions;
137
- /** True, if the bot can change the group sticker set. Returned only in getChat. */
138
- can_set_sticker_set?: true;
139
- }
140
- /** Internal type holding properties that those supergroup and channel chats returned from `getChat` share. */
141
- interface LargeGetChat extends NonPrivateGetChat {
142
- /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */
143
- linked_chat_id?: number;
144
- }
145
-
146
- // ==> GET CHATS
147
- /** Internal type representing private chats returned from `getChat`. */
148
- export interface PrivateGetChat
149
- extends PrivateChat, NonGroupGetChat, GetChat {
150
- /** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
151
- emoji_status_custom_emoji_id?: string;
152
- /** Bio of the other party in a private chat. Returned only in getChat. */
153
- bio?: string;
154
- /** 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. */
155
- has_private_forwards?: true;
156
- /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
157
- has_restricted_voice_and_video_messages?: true;
158
- }
159
- /** Internal type representing group chats returned from `getChat`. */
160
- export interface GroupGetChat extends GroupChat, MultiUserGetChat {}
161
- /** Internal type representing supergroup chats returned from `getChat`. */
162
- export interface SupergroupGetChat
163
- extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat {
164
- /** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
165
- slow_mode_delay?: number;
166
- /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
167
- has_aggressive_anti_spam_enabled?: true;
168
- /** For supergroups, name of group sticker set. Returned only in getChat. */
169
- sticker_set_name?: string;
170
- /** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
171
- location?: ChatLocation;
172
- }
173
- /** Internal type representing channel chats returned from `getChat`. */
174
- export interface ChannelGetChat
175
- extends ChannelChat, NonGroupGetChat, LargeGetChat {}
54
+ export declare namespace Chat {
55
+ /** Internal type holding properties that all kinds of chats share. */
56
+ interface AbstractChat {
57
+ /** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */
58
+ id: number;
59
+ /** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */
60
+ type: string;
61
+ }
62
+ /** Internal type holding properties that those chats with user names share. */
63
+ interface UserNameChat {
64
+ /** Username, for private chats, supergroups and channels if available */
65
+ username?: string;
66
+ }
67
+ /** Internal type holding properties that those chats with titles share. */
68
+ interface TitleChat {
69
+ /** Title, for supergroups, channels and group chats */
70
+ title: string;
71
+ }
72
+ /** Internal type representing private chats. */
73
+ export interface PrivateChat extends AbstractChat, UserNameChat {
74
+ type: "private";
75
+ /** First name of the other party in a private chat */
76
+ first_name: string;
77
+ /** Last name of the other party in a private chat */
78
+ last_name?: string;
79
+ }
80
+ /** Internal type representing group chats. */
81
+ export interface GroupChat extends AbstractChat, TitleChat {
82
+ type: "group";
83
+ }
84
+ /** Internal type representing super group chats. */
85
+ export interface SupergroupChat extends AbstractChat, UserNameChat, TitleChat {
86
+ type: "supergroup";
87
+ /** True, if the supergroup chat is a forum (has topics enabled) */
88
+ is_forum?: true;
89
+ }
90
+ /** Internal type representing channel chats. */
91
+ export interface ChannelChat extends AbstractChat, UserNameChat, TitleChat {
92
+ type: "channel";
93
+ }
94
+ /** Internal type holding properties that those chats returned from `getChat` share. */
95
+ interface GetChat {
96
+ /** Chat photo. Returned only in getChat. */
97
+ photo?: ChatPhoto;
98
+ /** The most recent pinned message (by sending date). Returned only in getChat. */
99
+ pinned_message?: Message;
100
+ /** The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */
101
+ message_auto_delete_time?: number;
102
+ /** True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
103
+ has_protected_content?: true;
104
+ }
105
+ /** Internal type holding properties that those private, supergroup, and channel chats returned from `getChat` share. */
106
+ interface NonGroupGetChat extends GetChat {
107
+ /** If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
108
+ active_usernames?: string[];
109
+ }
110
+ /** Internal type holding properties that those group, supergroup, and channel chats returned from `getChat` share. */
111
+ interface NonPrivateGetChat extends GetChat {
112
+ /** Description, for groups, supergroups and channel chats. Returned only in getChat. */
113
+ description?: string;
114
+ /** Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
115
+ invite_link?: string;
116
+ }
117
+ /** Internal type holding properties that those group and supergroup chats returned from `getChat` share. */
118
+ interface MultiUserGetChat extends NonPrivateGetChat {
119
+ /** Default chat member permissions, for groups and supergroups. Returned only in getChat. */
120
+ permissions?: ChatPermissions;
121
+ /** True, if the bot can change the group sticker set. Returned only in getChat. */
122
+ can_set_sticker_set?: true;
123
+ }
124
+ /** Internal type holding properties that those supergroup and channel chats returned from `getChat` share. */
125
+ interface LargeGetChat extends NonPrivateGetChat {
126
+ /** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */
127
+ linked_chat_id?: number;
128
+ }
129
+ /** Internal type representing private chats returned from `getChat`. */
130
+ export interface PrivateGetChat extends PrivateChat, NonGroupGetChat, GetChat {
131
+ /** Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
132
+ emoji_status_custom_emoji_id?: string;
133
+ /** Bio of the other party in a private chat. Returned only in getChat. */
134
+ bio?: string;
135
+ /** 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. */
136
+ has_private_forwards?: true;
137
+ /** True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
138
+ has_restricted_voice_and_video_messages?: true;
139
+ }
140
+ /** Internal type representing group chats returned from `getChat`. */
141
+ export interface GroupGetChat extends GroupChat, MultiUserGetChat {
142
+ }
143
+ /** Internal type representing supergroup chats returned from `getChat`. */
144
+ export interface SupergroupGetChat extends SupergroupChat, NonGroupGetChat, MultiUserGetChat, LargeGetChat {
145
+ /** For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
146
+ slow_mode_delay?: number;
147
+ /** True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
148
+ has_aggressive_anti_spam_enabled?: true;
149
+ /** For supergroups, name of group sticker set. Returned only in getChat. */
150
+ sticker_set_name?: string;
151
+ /** For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
152
+ location?: ChatLocation;
153
+ /** True, if users need to join the supergroup before they can send messages. Returned only in getChat. */
154
+ join_to_send_messages?: true;
155
+ /** True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */
156
+ join_by_request?: true;
157
+ }
158
+ /** Internal type representing channel chats returned from `getChat`. */
159
+ export interface ChannelGetChat extends ChannelChat, NonGroupGetChat, LargeGetChat {
160
+ }
161
+ export {};
176
162
  }
177
-
178
163
  /** This object represents a chat. */
179
- export type Chat =
180
- | Chat.PrivateChat
181
- | Chat.GroupChat
182
- | Chat.SupergroupChat
183
- | Chat.ChannelChat;
184
-
164
+ export type Chat = Chat.PrivateChat | Chat.GroupChat | Chat.SupergroupChat | Chat.ChannelChat;
185
165
  /** This object represents a Telegram user or bot that was returned by `getChat`. */
186
- export type ChatFromGetChat =
187
- | Chat.PrivateGetChat
188
- | Chat.GroupGetChat
189
- | Chat.SupergroupGetChat
190
- | Chat.ChannelGetChat;
191
-
166
+ export type ChatFromGetChat = Chat.PrivateGetChat | Chat.GroupGetChat | Chat.SupergroupGetChat | Chat.ChannelGetChat;
192
167
  /** This object represent a user's profile pictures. */
193
168
  export interface UserProfilePhotos {
194
- /** Total number of profile pictures the target user has */
195
- total_count: number;
196
- /** Requested profile pictures (in up to 4 sizes each) */
197
- photos: PhotoSize[][];
169
+ /** Total number of profile pictures the target user has */
170
+ total_count: number;
171
+ /** Requested profile pictures (in up to 4 sizes each) */
172
+ photos: PhotoSize[][];
198
173
  }
199
-
200
174
  /** This object represents a chat photo. */
201
175
  export interface ChatPhoto {
202
- /** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
203
- small_file_id: string;
204
- /** Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
205
- small_file_unique_id: string;
206
- /** File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
207
- big_file_id: string;
208
- /** Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
209
- big_file_unique_id: string;
176
+ /** File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
177
+ small_file_id: string;
178
+ /** Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
179
+ small_file_unique_id: string;
180
+ /** File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. */
181
+ big_file_id: string;
182
+ /** Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
183
+ big_file_unique_id: string;
210
184
  }
211
-
212
185
  /** Represents an invite link for a chat. */
213
186
  export interface ChatInviteLink {
214
- /** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
215
- invite_link: string;
216
- /** Creator of the link */
217
- creator: User;
218
- /** True, if users joining the chat via the link need to be approved by chat administrators */
219
- creates_join_request: boolean;
220
- /** True, if the link is primary */
221
- is_primary: boolean;
222
- /** True, if the link is revoked */
223
- is_revoked: boolean;
224
- /** Invite link name */
225
- name?: string;
226
- /** Point in time (Unix timestamp) when the link will expire or has been expired */
227
- expire_date?: number;
228
- /** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
229
- member_limit?: number;
230
- /** Number of pending join requests created using this link */
231
- pending_join_request_count?: number;
187
+ /** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
188
+ invite_link: string;
189
+ /** Creator of the link */
190
+ creator: User;
191
+ /** True, if users joining the chat via the link need to be approved by chat administrators */
192
+ creates_join_request: boolean;
193
+ /** True, if the link is primary */
194
+ is_primary: boolean;
195
+ /** True, if the link is revoked */
196
+ is_revoked: boolean;
197
+ /** Invite link name */
198
+ name?: string;
199
+ /** Point in time (Unix timestamp) when the link will expire or has been expired */
200
+ expire_date?: number;
201
+ /** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
202
+ member_limit?: number;
203
+ /** Number of pending join requests created using this link */
204
+ pending_join_request_count?: number;
232
205
  }
233
-
234
206
  /** Represents the rights of an administrator in a chat. */
235
207
  export interface ChatAdministratorRights {
236
- /** True, if the user's presence in the chat is hidden */
237
- is_anonymous: boolean;
238
- /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
239
- can_manage_chat: boolean;
240
- /** True, if the administrator can delete messages of other users */
241
- can_delete_messages: boolean;
242
- /** True, if the administrator can manage video chats */
243
- can_manage_video_chats: boolean;
244
- /** True, if the administrator can restrict, ban or unban chat members */
245
- can_restrict_members: boolean;
246
- /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
247
- can_promote_members: boolean;
248
- /** True, if the user is allowed to change the chat title, photo and other settings */
249
- can_change_info: boolean;
250
- /** True, if the user is allowed to invite new users to the chat */
251
- can_invite_users: boolean;
252
- /** True, if the administrator can post in the channel; channels only */
253
- can_post_messages?: boolean;
254
- /** True, if the administrator can edit messages of other users and can pin messages; channels only */
255
- can_edit_messages?: boolean;
256
- /** True, if the user is allowed to pin messages; groups and supergroups only */
257
- can_pin_messages?: boolean;
258
- /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
259
- can_manage_topics?: boolean;
208
+ /** True, if the user's presence in the chat is hidden */
209
+ is_anonymous: boolean;
210
+ /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
211
+ can_manage_chat: boolean;
212
+ /** True, if the administrator can delete messages of other users */
213
+ can_delete_messages: boolean;
214
+ /** True, if the administrator can manage video chats */
215
+ can_manage_video_chats: boolean;
216
+ /** True, if the administrator can restrict, ban or unban chat members */
217
+ can_restrict_members: boolean;
218
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
219
+ can_promote_members: boolean;
220
+ /** True, if the user is allowed to change the chat title, photo and other settings */
221
+ can_change_info: boolean;
222
+ /** True, if the user is allowed to invite new users to the chat */
223
+ can_invite_users: boolean;
224
+ /** True, if the administrator can post in the channel; channels only */
225
+ can_post_messages?: boolean;
226
+ /** True, if the administrator can edit messages of other users and can pin messages; channels only */
227
+ can_edit_messages?: boolean;
228
+ /** True, if the user is allowed to pin messages; groups and supergroups only */
229
+ can_pin_messages?: boolean;
230
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
231
+ can_manage_topics?: boolean;
260
232
  }
261
-
262
233
  /** This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
263
234
  - ChatMemberOwner
264
235
  - ChatMemberAdministrator
@@ -266,228 +237,209 @@ export interface ChatAdministratorRights {
266
237
  - ChatMemberRestricted
267
238
  - ChatMemberLeft
268
239
  - ChatMemberBanned */
269
- export type ChatMember =
270
- | ChatMemberOwner
271
- | ChatMemberAdministrator
272
- | ChatMemberMember
273
- | ChatMemberRestricted
274
- | ChatMemberLeft
275
- | ChatMemberBanned;
276
-
240
+ export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned;
277
241
  /** Represents a chat member that owns the chat and has all administrator privileges. */
278
242
  export interface ChatMemberOwner {
279
- /** The member's status in the chat, always “creator” */
280
- status: "creator";
281
- /** Information about the user */
282
- user: User;
283
- /** True, if the user's presence in the chat is hidden */
284
- is_anonymous: boolean;
285
- /** Custom title for this user */
286
- custom_title?: string;
243
+ /** The member's status in the chat, always “creator” */
244
+ status: "creator";
245
+ /** Information about the user */
246
+ user: User;
247
+ /** True, if the user's presence in the chat is hidden */
248
+ is_anonymous: boolean;
249
+ /** Custom title for this user */
250
+ custom_title?: string;
287
251
  }
288
-
289
252
  /** Represents a chat member that has some additional privileges. */
290
253
  export interface ChatMemberAdministrator {
291
- /** The member's status in the chat, always “administrator” */
292
- status: "administrator";
293
- /** Information about the user */
294
- user: User;
295
- /** True, if the bot is allowed to edit administrator privileges of that user */
296
- can_be_edited: boolean;
297
- /** True, if the user's presence in the chat is hidden */
298
- is_anonymous: boolean;
299
- /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
300
- can_manage_chat: boolean;
301
- /** True, if the administrator can delete messages of other users */
302
- can_delete_messages: boolean;
303
- /** True, if the administrator can manage video chats */
304
- can_manage_video_chats: boolean;
305
- /** True, if the administrator can restrict, ban or unban chat members */
306
- can_restrict_members: boolean;
307
- /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
308
- can_promote_members: boolean;
309
- /** True, if the user is allowed to change the chat title, photo and other settings */
310
- can_change_info: boolean;
311
- /** True, if the user is allowed to invite new users to the chat */
312
- can_invite_users: boolean;
313
- /** True, if the administrator can post in the channel; channels only */
314
- can_post_messages?: boolean;
315
- /** True, if the administrator can edit messages of other users and can pin messages; channels only */
316
- can_edit_messages?: boolean;
317
- /** True, if the user is allowed to pin messages; groups and supergroups only */
318
- can_pin_messages?: boolean;
319
- /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
320
- can_manage_topics?: boolean;
321
- /** Custom title for this user */
322
- custom_title?: string;
254
+ /** The member's status in the chat, always “administrator” */
255
+ status: "administrator";
256
+ /** Information about the user */
257
+ user: User;
258
+ /** True, if the bot is allowed to edit administrator privileges of that user */
259
+ can_be_edited: boolean;
260
+ /** True, if the user's presence in the chat is hidden */
261
+ is_anonymous: boolean;
262
+ /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */
263
+ can_manage_chat: boolean;
264
+ /** True, if the administrator can delete messages of other users */
265
+ can_delete_messages: boolean;
266
+ /** True, if the administrator can manage video chats */
267
+ can_manage_video_chats: boolean;
268
+ /** True, if the administrator can restrict, ban or unban chat members */
269
+ can_restrict_members: boolean;
270
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
271
+ can_promote_members: boolean;
272
+ /** True, if the user is allowed to change the chat title, photo and other settings */
273
+ can_change_info: boolean;
274
+ /** True, if the user is allowed to invite new users to the chat */
275
+ can_invite_users: boolean;
276
+ /** True, if the administrator can post in the channel; channels only */
277
+ can_post_messages?: boolean;
278
+ /** True, if the administrator can edit messages of other users and can pin messages; channels only */
279
+ can_edit_messages?: boolean;
280
+ /** True, if the user is allowed to pin messages; groups and supergroups only */
281
+ can_pin_messages?: boolean;
282
+ /** True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
283
+ can_manage_topics?: boolean;
284
+ /** Custom title for this user */
285
+ custom_title?: string;
323
286
  }
324
-
325
287
  /** Represents a chat member that has no additional privileges or restrictions. */
326
288
  export interface ChatMemberMember {
327
- /** The member's status in the chat, always “member” */
328
- status: "member";
329
- /** Information about the user */
330
- user: User;
289
+ /** The member's status in the chat, always “member” */
290
+ status: "member";
291
+ /** Information about the user */
292
+ user: User;
331
293
  }
332
-
333
294
  /** Represents a chat member that is under certain restrictions in the chat. Supergroups only. */
334
295
  export interface ChatMemberRestricted {
335
- /** The member's status in the chat, always “restricted” */
336
- status: "restricted";
337
- /** Information about the user */
338
- user: User;
339
- /** True, if the user is a member of the chat at the moment of the request */
340
- is_member: boolean;
341
- /** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
342
- can_send_messages: boolean;
343
- /** True, if the user is allowed to send audios */
344
- can_send_audios: boolean;
345
- /** True, if the user is allowed to send documents */
346
- can_send_documents: boolean;
347
- /** True, if the user is allowed to send photos */
348
- can_send_photos: boolean;
349
- /** True, if the user is allowed to send videos */
350
- can_send_videos: boolean;
351
- /** True, if the user is allowed to send video notes */
352
- can_send_video_notes: boolean;
353
- /** True, if the user is allowed to send voice notes */
354
- can_send_voice_notes: boolean;
355
- /** True, if the user is allowed to send polls */
356
- can_send_polls: boolean;
357
- /** True, if the user is allowed to send animations, games, stickers and use inline bots */
358
- can_send_other_messages: boolean;
359
- /** True, if the user is allowed to add web page previews to their messages */
360
- can_add_web_page_previews: boolean;
361
- /** True, if the user is allowed to change the chat title, photo and other settings */
362
- can_change_info: boolean;
363
- /** True, if the user is allowed to invite new users to the chat */
364
- can_invite_users: boolean;
365
- /** True, if the user is allowed to pin messages */
366
- can_pin_messages: boolean;
367
- /** True, if the user is allowed to create forum topics */
368
- can_manage_topics: boolean;
369
- /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
370
- until_date: number;
296
+ /** The member's status in the chat, always “restricted” */
297
+ status: "restricted";
298
+ /** Information about the user */
299
+ user: User;
300
+ /** True, if the user is a member of the chat at the moment of the request */
301
+ is_member: boolean;
302
+ /** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
303
+ can_send_messages: boolean;
304
+ /** True, if the user is allowed to send audios */
305
+ can_send_audios: boolean;
306
+ /** True, if the user is allowed to send documents */
307
+ can_send_documents: boolean;
308
+ /** True, if the user is allowed to send photos */
309
+ can_send_photos: boolean;
310
+ /** True, if the user is allowed to send videos */
311
+ can_send_videos: boolean;
312
+ /** True, if the user is allowed to send video notes */
313
+ can_send_video_notes: boolean;
314
+ /** True, if the user is allowed to send voice notes */
315
+ can_send_voice_notes: boolean;
316
+ /** True, if the user is allowed to send polls */
317
+ can_send_polls: boolean;
318
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
319
+ can_send_other_messages: boolean;
320
+ /** True, if the user is allowed to add web page previews to their messages */
321
+ can_add_web_page_previews: boolean;
322
+ /** True, if the user is allowed to change the chat title, photo and other settings */
323
+ can_change_info: boolean;
324
+ /** True, if the user is allowed to invite new users to the chat */
325
+ can_invite_users: boolean;
326
+ /** True, if the user is allowed to pin messages */
327
+ can_pin_messages: boolean;
328
+ /** True, if the user is allowed to create forum topics */
329
+ can_manage_topics: boolean;
330
+ /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
331
+ until_date: number;
371
332
  }
372
-
373
333
  /** Represents a chat member that isn't currently a member of the chat, but may join it themselves. */
374
334
  export interface ChatMemberLeft {
375
- /** The member's status in the chat, always “left” */
376
- status: "left";
377
- /** Information about the user */
378
- user: User;
335
+ /** The member's status in the chat, always “left” */
336
+ status: "left";
337
+ /** Information about the user */
338
+ user: User;
379
339
  }
380
-
381
340
  /** Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. */
382
341
  export interface ChatMemberBanned {
383
- /** The member's status in the chat, always “kicked” */
384
- status: "kicked";
385
- /** Information about the user */
386
- user: User;
387
- /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */
388
- until_date: number;
342
+ /** The member's status in the chat, always “kicked” */
343
+ status: "kicked";
344
+ /** Information about the user */
345
+ user: User;
346
+ /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */
347
+ until_date: number;
389
348
  }
390
-
391
349
  /** This object represents changes in the status of a chat member. */
392
350
  export interface ChatMemberUpdated {
393
- /** Chat the user belongs to */
394
- chat: Chat;
395
- /** Performer of the action, which resulted in the change */
396
- from: User;
397
- /** Date the change was done in Unix time */
398
- date: number;
399
- /** Previous information about the chat member */
400
- old_chat_member: ChatMember;
401
- /** New information about the chat member */
402
- new_chat_member: ChatMember;
403
- /** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
404
- invite_link?: ChatInviteLink;
351
+ /** Chat the user belongs to */
352
+ chat: Chat;
353
+ /** Performer of the action, which resulted in the change */
354
+ from: User;
355
+ /** Date the change was done in Unix time */
356
+ date: number;
357
+ /** Previous information about the chat member */
358
+ old_chat_member: ChatMember;
359
+ /** New information about the chat member */
360
+ new_chat_member: ChatMember;
361
+ /** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
362
+ invite_link?: ChatInviteLink;
405
363
  }
406
-
407
364
  /** Represents a join request sent to a chat. */
408
365
  export interface ChatJoinRequest {
409
- /** Chat to which the request was sent */
410
- chat: Chat.SupergroupChat | Chat.ChannelChat;
411
- /** User that sent the join request */
412
- from: User;
413
- /** Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. */
414
- user_chat_id: number;
415
- /** Date the request was sent in Unix time */
416
- date: number;
417
- /** Bio of the user. */
418
- bio?: string;
419
- /** Chat invite link that was used by the user to send the join request */
420
- invite_link?: ChatInviteLink;
366
+ /** Chat to which the request was sent */
367
+ chat: Chat.SupergroupChat | Chat.ChannelChat;
368
+ /** User that sent the join request */
369
+ from: User;
370
+ /** Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 24 hours to send messages until the join request is processed, assuming no other administrator contacted the user. */
371
+ user_chat_id: number;
372
+ /** Date the request was sent in Unix time */
373
+ date: number;
374
+ /** Bio of the user. */
375
+ bio?: string;
376
+ /** Chat invite link that was used by the user to send the join request */
377
+ invite_link?: ChatInviteLink;
421
378
  }
422
-
423
379
  /** Describes actions that a non-administrator user is allowed to take in a chat. */
424
380
  export interface ChatPermissions {
425
- /** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
426
- can_send_messages?: boolean;
427
- /** True, if the user is allowed to send audios */
428
- can_send_audios?: boolean;
429
- /** True, if the user is allowed to send documents */
430
- can_send_documents?: boolean;
431
- /** True, if the user is allowed to send photos */
432
- can_send_photos?: boolean;
433
- /** True, if the user is allowed to send videos */
434
- can_send_videos?: boolean;
435
- /** True, if the user is allowed to send video notes */
436
- can_send_video_notes?: boolean;
437
- /** True, if the user is allowed to send voice notes */
438
- can_send_voice_notes?: boolean;
439
- /** True, if the user is allowed to send polls */
440
- can_send_polls?: boolean;
441
- /** True, if the user is allowed to send animations, games, stickers and use inline bots */
442
- can_send_other_messages?: boolean;
443
- /** True, if the user is allowed to add web page previews to their messages */
444
- can_add_web_page_previews?: boolean;
445
- /** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
446
- can_change_info?: boolean;
447
- /** True, if the user is allowed to invite new users to the chat */
448
- can_invite_users?: boolean;
449
- /** True, if the user is allowed to pin messages. Ignored in public supergroups */
450
- can_pin_messages?: boolean;
451
- /** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
452
- can_manage_topics?: boolean;
381
+ /** True, if the user is allowed to send text messages, contacts, invoices, locations and venues */
382
+ can_send_messages?: boolean;
383
+ /** True, if the user is allowed to send audios */
384
+ can_send_audios?: boolean;
385
+ /** True, if the user is allowed to send documents */
386
+ can_send_documents?: boolean;
387
+ /** True, if the user is allowed to send photos */
388
+ can_send_photos?: boolean;
389
+ /** True, if the user is allowed to send videos */
390
+ can_send_videos?: boolean;
391
+ /** True, if the user is allowed to send video notes */
392
+ can_send_video_notes?: boolean;
393
+ /** True, if the user is allowed to send voice notes */
394
+ can_send_voice_notes?: boolean;
395
+ /** True, if the user is allowed to send polls */
396
+ can_send_polls?: boolean;
397
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
398
+ can_send_other_messages?: boolean;
399
+ /** True, if the user is allowed to add web page previews to their messages */
400
+ can_add_web_page_previews?: boolean;
401
+ /** True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
402
+ can_change_info?: boolean;
403
+ /** True, if the user is allowed to invite new users to the chat */
404
+ can_invite_users?: boolean;
405
+ /** True, if the user is allowed to pin messages. Ignored in public supergroups */
406
+ can_pin_messages?: boolean;
407
+ /** True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
408
+ can_manage_topics?: boolean;
453
409
  }
454
-
455
410
  /** Represents a location to which a chat is connected. */
456
411
  export interface ChatLocation {
457
- /** The location to which the supergroup is connected. Can't be a live location. */
458
- location: Location;
459
- /** Location address; 1-64 characters, as defined by the chat owner */
460
- address: string;
412
+ /** The location to which the supergroup is connected. Can't be a live location. */
413
+ location: Location;
414
+ /** Location address; 1-64 characters, as defined by the chat owner */
415
+ address: string;
461
416
  }
462
-
463
417
  /** This object represents a forum topic. */
464
418
  export interface ForumTopic {
465
- /** Unique identifier of the forum topic */
466
- message_thread_id: number;
467
- /** Name of the topic */
468
- name: string;
469
- /** Color of the topic icon in RGB format */
470
- icon_color: number;
471
- /** Unique identifier of the custom emoji shown as the topic icon */
472
- icon_custom_emoji_id?: string;
419
+ /** Unique identifier of the forum topic */
420
+ message_thread_id: number;
421
+ /** Name of the topic */
422
+ name: string;
423
+ /** Color of the topic icon in RGB format */
424
+ icon_color: number;
425
+ /** Unique identifier of the custom emoji shown as the topic icon */
426
+ icon_custom_emoji_id?: string;
473
427
  }
474
-
475
428
  /** This object represents a bot command. */
476
429
  export interface BotCommand {
477
- /** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
478
- command: string;
479
- /** Description of the command; 1-256 characters. */
480
- description: string;
430
+ /** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
431
+ command: string;
432
+ /** Description of the command; 1-256 characters. */
433
+ description: string;
481
434
  }
482
-
483
435
  /** This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. */
484
436
  export interface File {
485
- /** Identifier for this file, which can be used to download or reuse the file */
486
- file_id: string;
487
- /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
488
- file_unique_id: string;
489
- /** File size in bytes */
490
- file_size?: number;
491
- /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
492
- file_path?: string;
437
+ /** Identifier for this file, which can be used to download or reuse the file */
438
+ file_id: string;
439
+ /** Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */
440
+ file_unique_id: string;
441
+ /** File size in bytes */
442
+ file_size?: number;
443
+ /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
444
+ file_path?: string;
493
445
  }