@im-more/dsh-telegram 0.0.0-stage → 0.1.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.
Files changed (122) hide show
  1. package/LICENSE +21 -0
  2. package/cordis.patch.yml +10 -0
  3. package/lib/index.js +2067 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/types/bot.d.ts +70 -0
  6. package/lib/types/bot.d.ts.map +1 -0
  7. package/lib/types/bot.js +231 -0
  8. package/lib/types/bot.js.map +1 -0
  9. package/lib/types/config.d.ts +34 -0
  10. package/lib/types/config.d.ts.map +1 -0
  11. package/lib/types/config.js +41 -0
  12. package/lib/types/config.js.map +1 -0
  13. package/lib/types/decode.d.ts +39 -0
  14. package/lib/types/decode.d.ts.map +1 -0
  15. package/lib/types/decode.js +382 -0
  16. package/lib/types/decode.js.map +1 -0
  17. package/lib/types/errors.d.ts +33 -0
  18. package/lib/types/errors.d.ts.map +1 -0
  19. package/lib/types/errors.js +89 -0
  20. package/lib/types/errors.js.map +1 -0
  21. package/lib/types/identity.d.ts +19 -0
  22. package/lib/types/identity.d.ts.map +1 -0
  23. package/lib/types/identity.js +34 -0
  24. package/lib/types/identity.js.map +1 -0
  25. package/lib/types/index.d.ts +10 -0
  26. package/lib/types/index.d.ts.map +1 -0
  27. package/lib/types/index.js +8 -0
  28. package/lib/types/index.js.map +1 -0
  29. package/lib/types/media.d.ts +38 -0
  30. package/lib/types/media.d.ts.map +1 -0
  31. package/lib/types/media.js +65 -0
  32. package/lib/types/media.js.map +1 -0
  33. package/lib/types/modes/html.d.ts +16 -0
  34. package/lib/types/modes/html.d.ts.map +1 -0
  35. package/lib/types/modes/html.js +155 -0
  36. package/lib/types/modes/html.js.map +1 -0
  37. package/lib/types/modes/plain.d.ts +14 -0
  38. package/lib/types/modes/plain.d.ts.map +1 -0
  39. package/lib/types/modes/plain.js +56 -0
  40. package/lib/types/modes/plain.js.map +1 -0
  41. package/lib/types/modes/shared.d.ts +140 -0
  42. package/lib/types/modes/shared.d.ts.map +1 -0
  43. package/lib/types/modes/shared.js +405 -0
  44. package/lib/types/modes/shared.js.map +1 -0
  45. package/lib/types/polling.d.ts +26 -0
  46. package/lib/types/polling.d.ts.map +1 -0
  47. package/lib/types/polling.js +149 -0
  48. package/lib/types/polling.js.map +1 -0
  49. package/lib/types/request.d.ts +67 -0
  50. package/lib/types/request.d.ts.map +1 -0
  51. package/lib/types/request.js +158 -0
  52. package/lib/types/request.js.map +1 -0
  53. package/lib/types/secret.d.ts +27 -0
  54. package/lib/types/secret.d.ts.map +1 -0
  55. package/lib/types/secret.js +39 -0
  56. package/lib/types/secret.js.map +1 -0
  57. package/lib/types/send.d.ts +48 -0
  58. package/lib/types/send.d.ts.map +1 -0
  59. package/lib/types/send.js +326 -0
  60. package/lib/types/send.js.map +1 -0
  61. package/lib/types/types/game.d.ts +102 -0
  62. package/lib/types/types/game.d.ts.map +1 -0
  63. package/lib/types/types/game.js +5 -0
  64. package/lib/types/types/game.js.map +1 -0
  65. package/lib/types/types/index.d.ts +2751 -0
  66. package/lib/types/types/index.d.ts.map +1 -0
  67. package/lib/types/types/index.js +88 -0
  68. package/lib/types/types/index.js.map +1 -0
  69. package/lib/types/types/inline.d.ts +796 -0
  70. package/lib/types/types/inline.d.ts.map +1 -0
  71. package/lib/types/types/inline.js +4 -0
  72. package/lib/types/types/inline.js.map +1 -0
  73. package/lib/types/types/internal.d.ts +32 -0
  74. package/lib/types/types/internal.d.ts.map +1 -0
  75. package/lib/types/types/internal.js +30 -0
  76. package/lib/types/types/internal.js.map +1 -0
  77. package/lib/types/types/passport.d.ts +229 -0
  78. package/lib/types/types/passport.d.ts.map +1 -0
  79. package/lib/types/types/passport.js +3 -0
  80. package/lib/types/types/passport.js.map +1 -0
  81. package/lib/types/types/payment.d.ts +285 -0
  82. package/lib/types/types/payment.d.ts.map +1 -0
  83. package/lib/types/types/payment.js +6 -0
  84. package/lib/types/types/payment.js.map +1 -0
  85. package/lib/types/types/sticker.d.ts +221 -0
  86. package/lib/types/types/sticker.d.ts.map +1 -0
  87. package/lib/types/types/sticker.js +11 -0
  88. package/lib/types/types/sticker.js.map +1 -0
  89. package/lib/types/types/update.d.ts +97 -0
  90. package/lib/types/types/update.d.ts.map +1 -0
  91. package/lib/types/types/update.js +6 -0
  92. package/lib/types/types/update.js.map +1 -0
  93. package/lib/types/webhook.d.ts +29 -0
  94. package/lib/types/webhook.d.ts.map +1 -0
  95. package/lib/types/webhook.js +129 -0
  96. package/lib/types/webhook.js.map +1 -0
  97. package/package.json +61 -3
  98. package/src/bot.ts +349 -0
  99. package/src/config.ts +73 -0
  100. package/src/decode.ts +472 -0
  101. package/src/errors.ts +103 -0
  102. package/src/identity.ts +41 -0
  103. package/src/index.ts +14 -0
  104. package/src/media.ts +79 -0
  105. package/src/modes/html.ts +193 -0
  106. package/src/modes/plain.ts +75 -0
  107. package/src/modes/shared.ts +505 -0
  108. package/src/polling.ts +176 -0
  109. package/src/request.ts +224 -0
  110. package/src/secret.ts +46 -0
  111. package/src/send.ts +454 -0
  112. package/src/types/.eslintrc.yml +2 -0
  113. package/src/types/game.ts +112 -0
  114. package/src/types/index.ts +3028 -0
  115. package/src/types/inline.ts +857 -0
  116. package/src/types/internal.ts +64 -0
  117. package/src/types/passport.ts +256 -0
  118. package/src/types/payment.ts +304 -0
  119. package/src/types/sticker.ts +244 -0
  120. package/src/types/update.ts +107 -0
  121. package/src/webhook.ts +168 -0
  122. package/README.md +0 -3
@@ -0,0 +1,3028 @@
1
+ // version: December 30, 2022
2
+ import { Internal } from './internal.ts'
3
+ import { CallbackGame, Game } from './game.ts'
4
+ import { Sticker } from './sticker.ts'
5
+
6
+ export * from './internal.ts'
7
+ export * from './inline.ts'
8
+ export * from './game.ts'
9
+ export * from './passport.ts'
10
+ export * from './payment.ts'
11
+ export * from './sticker.ts'
12
+ export * from './update.ts'
13
+
14
+ export type Integer = number
15
+ export type Float = number
16
+
17
+ declare module './update.ts' {
18
+ interface Update {
19
+ /** Optional. New incoming message of any kind — text, photo, sticker, etc. */
20
+ message?: Message
21
+ /** Optional. New version of a message that is known to the bot and was edited */
22
+ edited_message?: Message
23
+ /** Optional. New incoming channel post of any kind — text, photo, sticker, etc. */
24
+ channel_post?: Message
25
+ /** Optional. New version of a channel post that is known to the bot and was edited */
26
+ edited_channel_post?: Message
27
+ /** Optional. New incoming callback query */
28
+ callback_query?: CallbackQuery
29
+ /** Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot */
30
+ poll?: Poll
31
+ /** Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. */
32
+ poll_answer?: PollAnswer
33
+ /** Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. */
34
+ my_chat_member?: ChatMemberUpdated
35
+ /** Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify "chat_member" in the list of allowed_updates to receive these updates. */
36
+ chat_member?: ChatMemberUpdated
37
+ /** Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */
38
+ chat_join_request?: ChatJoinRequest
39
+ }
40
+ }
41
+
42
+ /**
43
+ * This object represents a Telegram user or bot.
44
+ * @see https://core.telegram.org/bots/api#user
45
+ */
46
+ export interface User {
47
+ /** 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. */
48
+ id?: Integer
49
+ /** True, if this user is a bot */
50
+ is_bot?: boolean
51
+ /** User's or bot's first name */
52
+ first_name?: string
53
+ /** Optional. User's or bot's last name */
54
+ last_name?: string
55
+ /** Optional. User's or bot's username */
56
+ username?: string
57
+ /** Optional. IETF language tag of the user's language */
58
+ language_code?: string
59
+ /** Optional. True, if this user is a Telegram Premium user */
60
+ is_premium?: boolean
61
+ /** Optional. True, if this user added the bot to the attachment menu */
62
+ added_to_attachment_menu?: boolean
63
+ /** Optional. True, if the bot can be invited to groups. Returned only in getMe. */
64
+ can_join_groups?: boolean
65
+ /** Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. */
66
+ can_read_all_group_messages?: boolean
67
+ /** Optional. True, if the bot supports inline queries. Returned only in getMe. */
68
+ supports_inline_queries?: boolean
69
+ }
70
+
71
+ /**
72
+ * This object represents a chat.
73
+ * @see https://core.telegram.org/bots/api#chat
74
+ */
75
+ export interface Chat {
76
+ /** 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. */
77
+ id?: Integer
78
+ /** Type of chat, can be either "private", "group", "supergroup" or "channel" */
79
+ type?: string
80
+ /** Optional. Title, for supergroups, channels and group chats */
81
+ title?: string
82
+ /** Optional. Username, for private chats, supergroups and channels if available */
83
+ username?: string
84
+ /** Optional. First name of the other party in a private chat */
85
+ first_name?: string
86
+ /** Optional. Last name of the other party in a private chat */
87
+ last_name?: string
88
+ /** Optional. True, if the supergroup chat is a forum (has topics enabled) */
89
+ is_forum?: true
90
+ /** Optional. Chat photo. Returned only in getChat. */
91
+ photo?: ChatPhoto
92
+ /** Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat. */
93
+ active_usernames?: string[]
94
+ /** Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in getChat. */
95
+ emoji_status_custom_emoji_id?: string
96
+ /** Optional. Bio of the other party in a private chat. Returned only in getChat. */
97
+ bio?: string
98
+ /** Optional. 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. */
99
+ has_private_forwards?: boolean
100
+ /** Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat. */
101
+ has_restricted_voice_and_video_messages?: boolean
102
+ /** Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat. */
103
+ join_to_send_messages?: boolean
104
+ /** Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. */
105
+ join_by_request?: boolean
106
+ /** Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. */
107
+ description?: string
108
+ /** Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */
109
+ invite_link?: string
110
+ /** Optional. The most recent pinned message (by sending date). Returned only in getChat. */
111
+ pinned_message?: Message
112
+ /** Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. */
113
+ permissions?: ChatPermissions
114
+ /** Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */
115
+ slow_mode_delay?: Integer
116
+ /** Optional. 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?: Integer
118
+ /** Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat. */
119
+ has_aggressive_anti_spam_enabled?: boolean
120
+ /** Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat. */
121
+ has_hidden_members?: boolean
122
+ /** Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */
123
+ has_protected_content?: boolean
124
+ /** Optional. For supergroups, name of group sticker set. Returned only in getChat. */
125
+ sticker_set_name?: string
126
+ /** Optional. True, if the bot can change the group sticker set. Returned only in getChat. */
127
+ can_set_sticker_set?: boolean
128
+ /** Optional. 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. */
129
+ linked_chat_id?: Integer
130
+ /** Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. */
131
+ location?: ChatLocation
132
+ }
133
+
134
+ /**
135
+ * This object represents a message.
136
+ * @see https://core.telegram.org/bots/api#message
137
+ */
138
+ export interface Message {
139
+ /** Unique message identifier inside this chat */
140
+ message_id?: Integer
141
+ /** Optional. Unique identifier of a message thread to which the message belongs; for supergroups only */
142
+ message_thread_id?: number
143
+ /** Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
144
+ from?: User
145
+ /** Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */
146
+ sender_chat?: Chat
147
+ /** Date the message was sent in Unix time */
148
+ date?: Integer
149
+ /** Conversation the message belongs to */
150
+ chat?: Chat
151
+ /** Optional. For forwarded messages, sender of the original message */
152
+ forward_from?: User
153
+ /** Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat */
154
+ forward_from_chat?: Chat
155
+ /** Optional. For messages forwarded from channels, identifier of the original message in the channel */
156
+ forward_from_message_id?: Integer
157
+ /** Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */
158
+ forward_signature?: string
159
+ /** Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */
160
+ forward_sender_name?: string
161
+ /** Optional. For forwarded messages, date the original message was sent in Unix time */
162
+ forward_date?: Integer
163
+ /** Optional. True, if the message is sent to a forum topic */
164
+ is_topic_message?: boolean
165
+ /** Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group */
166
+ is_automatic_forward?: boolean
167
+ /** Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */
168
+ reply_to_message?: Message
169
+ /** Optional. Bot through which the message was sent */
170
+ via_bot?: User
171
+ /** Optional. Date the message was last edited in Unix time */
172
+ edit_date?: Integer
173
+ /** Optional. True, if the message can't be forwarded */
174
+ has_protected_content?: boolean
175
+ /** Optional. The unique identifier of a media message group this message belongs to */
176
+ media_group_id?: string
177
+ /** Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
178
+ author_signature?: string
179
+ /** Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters */
180
+ text?: string
181
+ /** Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
182
+ entities?: MessageEntity[]
183
+ /** Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */
184
+ animation?: Animation
185
+ /** Optional. Message is an audio file, information about the file */
186
+ audio?: Audio
187
+ /** Optional. Message is a general file, information about the file */
188
+ document?: Document
189
+ /** Optional. Message is a photo, available sizes of the photo */
190
+ photo?: PhotoSize[]
191
+ /** Optional. Message is a video, information about the video */
192
+ video?: Video
193
+ /** Optional. Message is a video note, information about the video message */
194
+ video_note?: VideoNote
195
+ /** Optional. Message is a voice message, information about the file */
196
+ voice?: Voice
197
+ /** Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters */
198
+ caption?: string
199
+ /** Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
200
+ caption_entities?: MessageEntity[]
201
+ /** Optional. True, if the message media is covered by a spoiler animation */
202
+ has_media_spoiler?: boolean
203
+ /** Optional. Message is a shared contact, information about the contact */
204
+ contact?: Contact
205
+ /** Optional. Message is a dice with random value */
206
+ dice?: Dice
207
+ /** Optional. Message is a game, information about the game. More about games » */
208
+ game?: Game
209
+ /** Optional. Message is a native poll, information about the poll */
210
+ poll?: Poll
211
+ /** Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */
212
+ venue?: Venue
213
+ /** Optional. Message is a shared location, information about the location */
214
+ location?: Location
215
+ /** Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
216
+ new_chat_members?: User[]
217
+ /** Optional. A member was removed from the group, information about them (this member may be the bot itself) */
218
+ left_chat_member?: User
219
+ /** Optional. A chat title was changed to this value */
220
+ new_chat_title?: string
221
+ /** Optional. A chat photo was change to this value */
222
+ new_chat_photo?: PhotoSize[]
223
+ /** Optional. Service message: the chat photo was deleted */
224
+ delete_chat_photo?: boolean
225
+ /** Optional. Service message: the group has been created */
226
+ group_chat_created?: boolean
227
+ /** Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */
228
+ supergroup_chat_created?: boolean
229
+ /** Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */
230
+ channel_chat_created?: boolean
231
+ /** Optional. Service message: auto-delete timer settings changed in the chat */
232
+ message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged
233
+ /** Optional. The group has been migrated to a supergroup with the specified identifier. 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. */
234
+ migrate_to_chat_id?: Integer
235
+ /** Optional. The supergroup has been migrated from a group with the specified identifier. 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. */
236
+ migrate_from_chat_id?: Integer
237
+ /** Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */
238
+ pinned_message?: Message
239
+ /** Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */
240
+ connected_website?: string
241
+ /** Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
242
+ proximity_alert_triggered?: ProximityAlertTriggered
243
+ /** Optional. Service message: forum topic created */
244
+ forum_topic_created?: ForumTopicCreated
245
+ /** Optional. Service message: forum topic edited */
246
+ forum_topic_edited?: ForumTopicEdited
247
+ /** Optional. Service message: the 'General' forum topic hidden */
248
+ general_forum_topic_hidden?: GeneralForumTopicHidden
249
+ /** Optional. Service message: the 'General' forum topic unhidden */
250
+ general_forum_topic_unhidden?: GeneralForumTopicUnhidden
251
+ /** Optional. Service message: the user allowed the bot added to the attachment menu to write messages */
252
+ write_access_allowed?: WriteAccessAllowed
253
+ /** Optional. Service message: forum topic closed */
254
+ forum_topic_closed?: ForumTopicClosed
255
+ /** Optional. Service message: forum topic reopened */
256
+ forum_topic_reopened?: ForumTopicReopened
257
+ /**
258
+ * Optional. Service message: voice chat scheduled
259
+ * @deprecated
260
+ */
261
+ voice_chat_scheduled?: VoiceChatScheduled
262
+ /** Optional. Service message: voice chat scheduled */
263
+ video_chat_scheduled?: VoiceChatScheduled
264
+ /**
265
+ * Optional. Service message: voice chat started
266
+ * @deprecated
267
+ */
268
+ voice_chat_started?: VoiceChatStarted
269
+ /** Optional. Service message: voice chat started */
270
+ video_chat_started?: VoiceChatStarted
271
+ /**
272
+ * Optional. Service message: voice chat ended
273
+ * @deprecated
274
+ */
275
+ voice_chat_ended?: VoiceChatEnded
276
+ /** Optional. Service message: voice chat ended */
277
+ video_chat_ended?: VoiceChatEnded
278
+ /**
279
+ * Optional. Service message: new participants ivited to a voice chat
280
+ * @deprecated
281
+ */
282
+ voice_chat_participants_invited?: VoiceChatParticipantsInvited
283
+ /** Optional. Service message: new participants invited to a voice chat */
284
+ video_chat_participants_invited?: VoiceChatParticipantsInvited
285
+ /** Optional. Service message: data sent by a Web App */
286
+ web_app_data?: WebAppData
287
+ /** Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */
288
+ reply_markup?: InlineKeyboardMarkup
289
+ }
290
+
291
+ /**
292
+ * This object represents a unique message identifier.
293
+ * @see https://core.telegram.org/bots/api#messageid
294
+ */
295
+ export interface MessageId {
296
+ /** Unique message identifier */
297
+ message_id?: Integer
298
+ }
299
+
300
+ export type MessageEntityType =
301
+ | 'mention'
302
+ | 'hashtag'
303
+ | 'cashtag'
304
+ | 'bot_command'
305
+ | 'url'
306
+ | 'email'
307
+ | 'phone_number'
308
+ | 'bold'
309
+ | 'italic'
310
+ | 'underline'
311
+ | 'strikethrough'
312
+ | 'spoiler'
313
+ | 'code'
314
+ | 'pre'
315
+ | 'text_link'
316
+ | 'text_mention'
317
+ | 'blockquote'
318
+ | 'expandable_blockquote'
319
+ | 'custom_emoji'
320
+
321
+ /**
322
+ * This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
323
+ * @see https://core.telegram.org/bots/api#messageentity
324
+ */
325
+ export interface MessageEntity {
326
+ /** Type of the entity. Currently, can be:
327
+ * - "mention" (@username)
328
+ * - "hashtag" (#hashtag)
329
+ * - "cashtag" ($USD)
330
+ * - "bot_command" (/start@jobs_bot)
331
+ * - "url" (https://telegram.org)
332
+ * - "email" (do-not-reply@telegram.org)
333
+ * - "phone_number" (+1-212-555-0123)
334
+ * - "bold" (bold text)
335
+ * - "italic" (italic text)
336
+ * - "underline" (underlined text)
337
+ * - "strikethrough" (strikethrough text)
338
+ * - "spoiler" (spoiler message)
339
+ * - "code" (monowidth string)
340
+ * - "pre" (monowidth block)
341
+ * - "text_link" (for clickable text URLs)
342
+ * - "text_mention" (for users without usernames)
343
+ * - "custom_emoji" (for inline custom emoji stickers)
344
+ */
345
+ type?: MessageEntityType
346
+ /** Offset in UTF-16 code units to the start of the entity */
347
+ offset?: Integer
348
+ /** Length of the entity in UTF-16 code units */
349
+ length?: Integer
350
+ /** Optional. For "text_link" only, url that will be opened after user taps on the text */
351
+ url?: string
352
+ /** Optional. For "text_mention" only, the mentioned user */
353
+ user?: User
354
+ /** Optional. For "pre" only, the programming language of the entity text */
355
+ language?: string
356
+ /** Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */
357
+ custom_emoji_id?: string
358
+ }
359
+
360
+ /**
361
+ * This object represents one size of a photo or a file / sticker thumbnail.
362
+ * @see https://core.telegram.org/bots/api#photosize
363
+ */
364
+ export interface PhotoSize {
365
+ /** Identifier for this file, which can be used to download or reuse the file */
366
+ file_id?: string
367
+ /** 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. */
368
+ file_unique_id?: string
369
+ /** Photo width */
370
+ width?: Integer
371
+ /** Photo height */
372
+ height?: Integer
373
+ /** Optional. File size in bytes */
374
+ file_size?: Integer
375
+ }
376
+
377
+ /**
378
+ * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
379
+ * @see https://core.telegram.org/bots/api#animation
380
+ */
381
+ export interface Animation {
382
+ /** Identifier for this file, which can be used to download or reuse the file */
383
+ file_id?: string
384
+ /** 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. */
385
+ file_unique_id?: string
386
+ /** Video width as defined by sender */
387
+ width?: Integer
388
+ /** Video height as defined by sender */
389
+ height?: Integer
390
+ /** Duration of the video in seconds as defined by sender */
391
+ duration?: Integer
392
+ /** Optional. Animation thumbnail as defined by sender */
393
+ thumb?: PhotoSize
394
+ /** Optional. Original animation filename as defined by sender */
395
+ file_name?: string
396
+ /** Optional. MIME type of the file as defined by sender */
397
+ mime_type?: string
398
+ /** Optional. File size in bytes */
399
+ file_size?: Integer
400
+ }
401
+
402
+ /**
403
+ * This object represents an audio file to be treated as music by the Telegram clients.
404
+ * @see https://core.telegram.org/bots/api#audio
405
+ */
406
+ export interface Audio {
407
+ /** Identifier for this file, which can be used to download or reuse the file */
408
+ file_id?: string
409
+ /** 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. */
410
+ file_unique_id?: string
411
+ /** Duration of the audio in seconds as defined by sender */
412
+ duration?: Integer
413
+ /** Optional. Performer of the audio as defined by sender or by audio tags */
414
+ performer?: string
415
+ /** Optional. Title of the audio as defined by sender or by audio tags */
416
+ title?: string
417
+ /** Optional. Original filename as defined by sender */
418
+ file_name?: string
419
+ /** Optional. MIME type of the file as defined by sender */
420
+ mime_type?: string
421
+ /** Optional. File size in bytes */
422
+ file_size?: Integer
423
+ /** Optional. Thumbnail of the album cover to which the music file belongs */
424
+ thumb?: PhotoSize
425
+ }
426
+
427
+ /**
428
+ * This object represents a general file (as opposed to photos, voice messages and audio files).
429
+ * @see https://core.telegram.org/bots/api#document
430
+ */
431
+ export interface Document {
432
+ /** Identifier for this file, which can be used to download or reuse the file */
433
+ file_id?: string
434
+ /** 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. */
435
+ file_unique_id?: string
436
+ /** Optional. Document thumbnail as defined by sender */
437
+ thumb?: PhotoSize
438
+ /** Optional. Original filename as defined by sender */
439
+ file_name?: string
440
+ /** Optional. MIME type of the file as defined by sender */
441
+ mime_type?: string
442
+ /** Optional. File size in bytes */
443
+ file_size?: Integer
444
+ }
445
+
446
+ /**
447
+ * This object represents a video file.
448
+ * @see https://core.telegram.org/bots/api#video
449
+ */
450
+ export interface Video {
451
+ /** Identifier for this file, which can be used to download or reuse the file */
452
+ file_id?: string
453
+ /** 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. */
454
+ file_unique_id?: string
455
+ /** Video width as defined by sender */
456
+ width?: Integer
457
+ /** Video height as defined by sender */
458
+ height?: Integer
459
+ /** Duration of the video in seconds as defined by sender */
460
+ duration?: Integer
461
+ /** Optional. Video thumbnail */
462
+ thumb?: PhotoSize
463
+ /** Optional. Original filename as defined by sender */
464
+ file_name?: string
465
+ /** Optional. Mime type of a file as defined by sender */
466
+ mime_type?: string
467
+ /** Optional. File size in bytes */
468
+ file_size?: Integer
469
+ }
470
+
471
+ /**
472
+ * This object represents a video message (available in Telegram apps as of v.4.0).
473
+ * @see https://core.telegram.org/bots/api#videonote
474
+ */
475
+ export interface VideoNote {
476
+ /** Identifier for this file, which can be used to download or reuse the file */
477
+ file_id?: string
478
+ /** 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. */
479
+ file_unique_id?: string
480
+ /** Video width and height (diameter of the video message) as defined by sender */
481
+ length?: Integer
482
+ /** Duration of the video in seconds as defined by sender */
483
+ duration?: Integer
484
+ /** Optional. Video thumbnail */
485
+ thumb?: PhotoSize
486
+ /** Optional. File size in bytes */
487
+ file_size?: Integer
488
+ }
489
+
490
+ /**
491
+ * This object represents a voice note.
492
+ * @see https://core.telegram.org/bots/api#voice
493
+ */
494
+ export interface Voice {
495
+ /** Identifier for this file, which can be used to download or reuse the file */
496
+ file_id?: string
497
+ /** 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. */
498
+ file_unique_id?: string
499
+ /** Duration of the audio in seconds as defined by sender */
500
+ duration?: Integer
501
+ /** Optional. MIME type of the file as defined by sender */
502
+ mime_type?: string
503
+ /** Optional. File size in bytes */
504
+ file_size?: Integer
505
+ }
506
+
507
+ /**
508
+ * This object represents a phone contact.
509
+ * @see https://core.telegram.org/bots/api#contact
510
+ */
511
+ export interface Contact {
512
+ /** Contact's phone number */
513
+ phone_number?: string
514
+ /** Contact's first name */
515
+ first_name?: string
516
+ /** Optional. Contact's last name */
517
+ last_name?: string
518
+ /** Optional. Contact's user identifier in Telegram. 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. */
519
+ user_id?: Integer
520
+ /** Optional. Additional data about the contact in the form of a vCard */
521
+ vcard?: string
522
+ }
523
+
524
+ /**
525
+ * This object represents an animated emoji that displays a random value.
526
+ * @see https://core.telegram.org/bots/api#dice
527
+ */
528
+ export interface Dice {
529
+ /** Emoji on which the dice throw animation is based */
530
+ emoji?: string
531
+ /** Value of the dice, 1-6 for "", "" and "" base emoji, 1-5 for "" and "" base emoji, 1-64 for "" base emoji */
532
+ value?: Integer
533
+ }
534
+
535
+ /**
536
+ * This object contains information about one answer option in a poll.
537
+ * @see https://core.telegram.org/bots/api#polloption
538
+ */
539
+ export interface PollOption {
540
+ /** Option text, 1-100 characters */
541
+ text?: string
542
+ /** Number of users that voted for this option */
543
+ voter_count?: Integer
544
+ }
545
+
546
+ /**
547
+ * This object represents an answer of a user in a non-anonymous poll.
548
+ * @see https://core.telegram.org/bots/api#pollanswer
549
+ */
550
+ export interface PollAnswer {
551
+ /** Unique poll identifier */
552
+ poll_id?: string
553
+ /** The user, who changed the answer to the poll */
554
+ user?: User
555
+ /** 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. */
556
+ option_ids?: Integer[]
557
+ }
558
+
559
+ /**
560
+ * This object contains information about a poll.
561
+ * @see https://core.telegram.org/bots/api#poll
562
+ */
563
+ export interface Poll {
564
+ /** Unique poll identifier */
565
+ id?: string
566
+ /** Poll question, 1-300 characters */
567
+ question?: string
568
+ /** List of poll options */
569
+ options?: PollOption[]
570
+ /** Total number of users that voted in the poll */
571
+ total_voter_count?: Integer
572
+ /** True, if the poll is closed */
573
+ is_closed?: boolean
574
+ /** True, if the poll is anonymous */
575
+ is_anonymous?: boolean
576
+ /** Poll type, currently can be "regular" or "quiz" */
577
+ type?: string
578
+ /** True, if the poll allows multiple answers */
579
+ allows_multiple_answers?: boolean
580
+ /** Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */
581
+ correct_option_id?: Integer
582
+ /** Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */
583
+ explanation?: string
584
+ /** Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */
585
+ explanation_entities?: MessageEntity[]
586
+ /** Optional. Amount of time in seconds the poll will be active after creation */
587
+ open_period?: Integer
588
+ /** Optional. Point in time (Unix timestamp) when the poll will be automatically closed */
589
+ close_date?: Integer
590
+ }
591
+
592
+ /**
593
+ * This object represents a point on the map.
594
+ * @see https://core.telegram.org/bots/api#location
595
+ */
596
+ export interface Location {
597
+ /** Longitude as defined by sender */
598
+ longitude?: Float
599
+ /** Latitude as defined by sender */
600
+ latitude?: Float
601
+ /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */
602
+ horizontal_accuracy?: Float
603
+ /** Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
604
+ live_period?: Integer
605
+ /** Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. */
606
+ heading?: Integer
607
+ /** Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
608
+ proximity_alert_radius?: Integer
609
+ }
610
+
611
+ /**
612
+ * This object represents a venue.
613
+ * @see https://core.telegram.org/bots/api#venue
614
+ */
615
+ export interface Venue {
616
+ /** Venue location. Can't be a live location */
617
+ location?: Location
618
+ /** Name of the venue */
619
+ title?: string
620
+ /** Address of the venue */
621
+ address?: string
622
+ /** Optional. Foursquare identifier of the venue */
623
+ foursquare_id?: string
624
+ /** Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
625
+ foursquare_type?: string
626
+ /** Optional. Google Places identifier of the venue */
627
+ google_place_id?: string
628
+ /** Optional. Google Places type of the venue. (See supported types.) */
629
+ google_place_type?: string
630
+ }
631
+
632
+ /**
633
+ * Describes data sent from a Web App to the bot.
634
+ * @see https://core.telegram.org/bots/api#webappdata
635
+ */
636
+
637
+ export interface WebAppData {
638
+ /** The data. Be aware that a bad client can send arbitrary data in this field. */
639
+ data: string
640
+ /** 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. */
641
+ button_text: string
642
+ }
643
+
644
+ /**
645
+ * This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
646
+ * @see https://core.telegram.org/bots/api#proximityalerttriggered
647
+ */
648
+ export interface ProximityAlertTriggered {
649
+ /** User that triggered the alert */
650
+ traveler?: User
651
+ /** User that set the alert */
652
+ watcher?: User
653
+ /** The distance between the users */
654
+ distance?: Integer
655
+ }
656
+
657
+ /**
658
+ * This object represents a service message about a change in auto-delete timer settings.
659
+ * @see https://core.telegram.org/bots/api#messageautodeletetimerchanged
660
+ */
661
+ export interface MessageAutoDeleteTimerChanged {
662
+ /** New auto-delete time for messages in the chat; in seconds */
663
+ message_auto_delete_time?: Integer
664
+ }
665
+
666
+ /**
667
+ * This object represents a service message about a new forum topic created in the chat.
668
+ * @see https://core.telegram.org/bots/api#forumtopiccreated
669
+ */
670
+ export interface ForumTopicCreated {
671
+ /** Name of the topic */
672
+ name: string
673
+ /** Color of the topic icon in RGB format */
674
+ icon_color: number
675
+ /** Optional. Unique identifier of the custom emoji shown as the topic icon */
676
+ icon_custom_emoji_id?: string
677
+ }
678
+
679
+ /**
680
+ * This object represents a service message about a forum topic closed in the chat. Currently holds no information.
681
+ * @see https://core.telegram.org/bots/api#forumtopicclosed
682
+ */
683
+ export interface ForumTopicClosed {}
684
+
685
+ /**
686
+ * This object represents a service message about an edited forum topic.
687
+ * @see https://core.telegram.org/bots/api#forumtopicedited
688
+ */
689
+ export interface ForumTopicEdited {
690
+ /** Optional. New name of the topic, if it was edited */
691
+ name?: string
692
+ /** Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
693
+ icon_custom_emoji_id?: string
694
+ }
695
+
696
+ /**
697
+ * This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
698
+ * @see https://core.telegram.org/bots/api#forumtopicreopened
699
+ */
700
+ export interface ForumTopicReopened {}
701
+
702
+ /**
703
+ * This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
704
+ * @see https://core.telegram.org/bots/api#generalforumtopicunhidden
705
+ */
706
+ export interface GeneralForumTopicUnhidden {}
707
+
708
+ /**
709
+ * This object represents a service message about a user allowing a bot added to the attachment menu to write messages. Currently holds no information.
710
+ * @see https://core.telegram.org/bots/api#writeaccessallowed
711
+ */
712
+ export interface WriteAccessAllowed {}
713
+
714
+ /**
715
+ * This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
716
+ * @see https://core.telegram.org/bots/api#generalforumtopichidden
717
+ */
718
+ export interface GeneralForumTopicHidden {}
719
+
720
+ /**
721
+ * This object represents a service message about a voice chat scheduled in the chat.
722
+ * @see https://core.telegram.org/bots/api#voicechatscheduled
723
+ */
724
+ export interface VoiceChatScheduled {
725
+ /** Point in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator */
726
+ start_date?: Integer
727
+ }
728
+
729
+ /**
730
+ * This object represents a service message about a voice chat started in the chat. Currently holds no information.
731
+ * @see https://core.telegram.org/bots/api#voicechatstarted
732
+ */
733
+ export type VoiceChatStarted = any
734
+
735
+ /**
736
+ * This object represents a service message about a voice chat ended in the chat.
737
+ * @see https://core.telegram.org/bots/api#voicechatended
738
+ */
739
+ export interface VoiceChatEnded {
740
+ /** Voice chat duration in seconds */
741
+ duration?: Integer
742
+ }
743
+
744
+ /**
745
+ * This object represents a service message about new members invited to a voice chat.
746
+ * @see https://core.telegram.org/bots/api#voicechatparticipantsinvited
747
+ */
748
+ export interface VoiceChatParticipantsInvited {
749
+ /** Optional. New members that were invited to the voice chat */
750
+ users?: User[]
751
+ }
752
+
753
+ /**
754
+ * This object represent a user's profile pictures.
755
+ * @see https://core.telegram.org/bots/api#userprofilephotos
756
+ */
757
+ export interface UserProfilePhotos {
758
+ /** Total number of profile pictures the target user has */
759
+ total_count?: Integer
760
+ /** Requested profile pictures (in up to 4 sizes each) */
761
+ photos?: PhotoSize[][]
762
+ }
763
+
764
+ /**
765
+ * 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.
766
+ * Maximum file size to download is 20 MB
767
+ * @see https://core.telegram.org/bots/api#file
768
+ */
769
+ export interface File {
770
+ /** Identifier for this file, which can be used to download or reuse the file */
771
+ file_id?: string
772
+ /** 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. */
773
+ file_unique_id?: string
774
+ /** Optional. File size in bytes, if known */
775
+ file_size?: Integer
776
+ /** Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */
777
+ file_path?: string
778
+ }
779
+
780
+ /**
781
+ * Describes a Web App.
782
+ * @see https://core.telegram.org/bots/api#webappinfo
783
+ */
784
+ export interface WebAppInfo {
785
+ /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */
786
+ url: string
787
+ }
788
+
789
+ /**
790
+ * This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
791
+ * @see https://core.telegram.org/bots/api#replykeyboardmarkup
792
+ */
793
+ export interface ReplyKeyboardMarkup {
794
+ /** button rows, each represented by an Array of KeyboardButton objects */
795
+ keyboard?: KeyboardButton[][]
796
+ /** Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon. */
797
+ is_persistent?: boolean
798
+ /** Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */
799
+ resize_keyboard?: boolean
800
+ /** Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */
801
+ one_time_keyboard?: boolean
802
+ /** Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
803
+ input_field_placeholder?: string
804
+ /** Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
805
+
806
+ Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. */
807
+ selective?: boolean
808
+ }
809
+
810
+ /**
811
+ * This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive.
812
+ * @see https://core.telegram.org/bots/api#keyboardbutton
813
+ */
814
+ export interface KeyboardButton {
815
+ /** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
816
+ text?: string
817
+ /** Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only */
818
+ request_contact?: boolean
819
+ /** Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only */
820
+ request_location?: boolean
821
+ /** Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only */
822
+ request_poll?: KeyboardButtonPollType
823
+ /** Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */
824
+ web_app?: WebAppInfo
825
+ }
826
+
827
+ /**
828
+ * This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
829
+ * @see https://core.telegram.org/bots/api#keyboardbuttonpolltype
830
+ */
831
+ export interface KeyboardButtonPollType {
832
+ /** Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */
833
+ type?: string
834
+ }
835
+
836
+ /**
837
+ * 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).
838
+ * @see https://core.telegram.org/bots/api#replykeyboardremove
839
+ */
840
+ export interface ReplyKeyboardRemove {
841
+ /** 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) */
842
+ remove_keyboard?: boolean
843
+ /** Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
844
+
845
+ Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. */
846
+ selective?: boolean
847
+ }
848
+
849
+ /**
850
+ * This object represents an inline keyboard that appears right next to the message it belongs to.
851
+ * @see https://core.telegram.org/bots/api#inlinekeyboardmarkup
852
+ */
853
+ export interface InlineKeyboardMarkup {
854
+ /** button rows, each represented by an Array of InlineKeyboardButton objects */
855
+ inline_keyboard?: InlineKeyboardButton[][]
856
+ }
857
+
858
+ /** A reply to an existing message, addressed by id. */
859
+ export interface ReplyParameters {
860
+ /** Identifier of the message to reply to. */
861
+ message_id: Integer
862
+ /** Send the reply even if the original message is missing. */
863
+ allow_sending_without_reply?: boolean
864
+ }
865
+
866
+ /** Options for link previews in a text message. */
867
+ export interface LinkPreviewOptions {
868
+ /** Disable the link preview. */
869
+ is_disabled?: boolean
870
+ }
871
+
872
+ /** Telegram's JSON envelope for every Bot API method. */
873
+ export interface TelegramResponse<T> {
874
+ ok: boolean
875
+ result?: T
876
+ error_code?: Integer
877
+ description?: string
878
+ parameters?: { retry_after?: Integer }
879
+ }
880
+
881
+ /**
882
+ * This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
883
+ * @see https://core.telegram.org/bots/api#inlinekeyboardbutton
884
+ */
885
+ export interface InlineKeyboardButton {
886
+ /** Label text on the button */
887
+ text?: string
888
+ /** Optional. HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */
889
+ url?: string
890
+ /** Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */
891
+ login_url?: LoginUrl
892
+ /** Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */
893
+ callback_data?: string
894
+ /** Optional. 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. */
895
+ web_app?: WebAppInfo
896
+ /**
897
+ * Optional. 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.
898
+ *
899
+ * Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
900
+ */
901
+ switch_inline_query?: string
902
+ /**
903
+ * Optional. 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.
904
+ *
905
+ * 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.
906
+ */
907
+ switch_inline_query_current_chat?: string
908
+ /**
909
+ * Optional. Description of the game that will be launched when the user presses the button.
910
+ *
911
+ * NOTE: This type of button must always be the first button in the first row.
912
+ */
913
+ callback_game?: CallbackGame
914
+ /**
915
+ * Optional. Specify True, to send a Pay button.
916
+ *
917
+ * NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
918
+ */
919
+ pay?: boolean
920
+ }
921
+
922
+ /**
923
+ * This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:
924
+ *
925
+ * Telegram apps support these buttons as of version 5.7.
926
+ * Sample bot: @discussbot
927
+ * @see https://core.telegram.org/bots/api#loginurl
928
+ */
929
+ export interface LoginUrl {
930
+ /**
931
+ * An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.
932
+ *
933
+ * NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
934
+ */
935
+ url?: string
936
+ /** Optional. New text of the button in forwarded messages. */
937
+ forward_text?: string
938
+ /** Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */
939
+ bot_username?: string
940
+ /** Optional. Pass True to request the permission for your bot to send messages to the user. */
941
+ request_write_access?: boolean
942
+ }
943
+
944
+ /**
945
+ * This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
946
+ * @see https://core.telegram.org/bots/api#callbackquery
947
+ */
948
+ export interface CallbackQuery {
949
+ /** Unique identifier for this query */
950
+ id?: string
951
+ /** Sender */
952
+ from?: User
953
+ /** Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */
954
+ message?: Message
955
+ /** Optional. Identifier of the message sent via the bot in inline mode, that originated the query. */
956
+ inline_message_id?: string
957
+ /** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */
958
+ chat_instance?: string
959
+ /** Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */
960
+ data?: string
961
+ /** Optional. Short name of a Game to be returned, serves as the unique identifier for the game */
962
+ game_short_name?: string
963
+ }
964
+
965
+ /**
966
+ * 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.
967
+ * @see https://core.telegram.org/bots/api#forcereply
968
+ */
969
+ export interface ForceReply {
970
+ /** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
971
+ force_reply?: boolean
972
+ /** Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters */
973
+ input_field_placeholder?: string
974
+ /** Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */
975
+ selective?: boolean
976
+ }
977
+
978
+ /**
979
+ * This object represents a chat photo.
980
+ * @see https://core.telegram.org/bots/api#chatphoto
981
+ */
982
+ export interface ChatPhoto {
983
+ /** 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. */
984
+ small_file_id?: string
985
+ /** 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. */
986
+ small_file_unique_id?: string
987
+ /** 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. */
988
+ big_file_id?: string
989
+ /** 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. */
990
+ big_file_unique_id?: string
991
+ }
992
+
993
+ /**
994
+ * Represents an invite link for a chat.
995
+ * @see https://core.telegram.org/bots/api#chatinvitelink
996
+ */
997
+ export interface ChatInviteLink {
998
+ /** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with "...". */
999
+ invite_link?: string
1000
+ /** Creator of the link */
1001
+ creator?: User
1002
+ /** True, if users joining the chat via the link need to be approved by chat administrators */
1003
+ creates_join_request?: boolean
1004
+ /** True, if the link is primary */
1005
+ is_primary?: boolean
1006
+ /** True, if the link is revoked */
1007
+ is_revoked?: boolean
1008
+ /** Optional. Invite link name */
1009
+ name?: string
1010
+ /** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */
1011
+ expire_date?: Integer
1012
+ /** Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
1013
+ member_limit?: Integer
1014
+ /** Optional. Number of pending join requests created using this link */
1015
+ pending_join_request_count?: Integer
1016
+ }
1017
+
1018
+ /**
1019
+ * Represents the rights of an administrator in a chat.
1020
+ * @see https://core.telegram.org/bots/api#chatadministratorrights
1021
+ */
1022
+ export interface ChatAdministratorRights {
1023
+ /** True, if the user's presence in the chat is hidden */
1024
+ is_anonymous: boolean
1025
+ /** 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 */
1026
+ can_manage_chat: boolean
1027
+ /** True, if the administrator can delete messages of other users */
1028
+ can_delete_messages: boolean
1029
+ /** True, if the administrator can manage video chats */
1030
+ can_manage_video_chats: boolean
1031
+ /** True, if the administrator can restrict, ban or unban chat members */
1032
+ can_restrict_members: boolean
1033
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
1034
+ can_promote_members: boolean
1035
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1036
+ can_change_info: boolean
1037
+ /** True, if the user is allowed to invite new users to the chat */
1038
+ can_invite_users: boolean
1039
+ /** Optional. True, if the administrator can post in the channel; channels only */
1040
+ can_post_messages?: boolean
1041
+ /** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */
1042
+ can_edit_messages?: boolean
1043
+ /** Optional. True, if the user is allowed to pin messages; groups and supergroups only */
1044
+ can_pin_messages?: boolean
1045
+ /** Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
1046
+ can_manage_topics?: boolean
1047
+ }
1048
+
1049
+ /**
1050
+ * This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
1051
+ * - ChatMemberOwner
1052
+ * - ChatMemberAdministrator
1053
+ * - ChatMemberMember
1054
+ * - ChatMemberRestricted
1055
+ * - ChatMemberLeft
1056
+ * - ChatMemberBanned
1057
+ * @see https://core.telegram.org/bots/api#chatmember
1058
+ */
1059
+ export type ChatMember =
1060
+ | ChatMemberOwner
1061
+ | ChatMemberAdministrator
1062
+ | ChatMemberMember
1063
+ | ChatMemberRestricted
1064
+ | ChatMemberLeft
1065
+ | ChatMemberBanned
1066
+
1067
+ /**
1068
+ * Represents a chat member that owns the chat and has all administrator privileges.
1069
+ * @see https://core.telegram.org/bots/api#chatmemberowner
1070
+ */
1071
+ export interface ChatMemberOwner {
1072
+ /** The member's status in the chat, always "creator" */
1073
+ status?: 'creator'
1074
+ /** Information about the user */
1075
+ user?: User
1076
+ /** True, if the user's presence in the chat is hidden */
1077
+ is_anonymous?: boolean
1078
+ /** Optional. Custom title for this user */
1079
+ custom_title?: string
1080
+ }
1081
+
1082
+ /**
1083
+ * Represents a chat member that has some additional privileges.
1084
+ * @see https://core.telegram.org/bots/api#chatmemberadministrator
1085
+ */
1086
+ export interface ChatMemberAdministrator {
1087
+ /** The member's status in the chat, always "administrator" */
1088
+ status?: 'administrator'
1089
+ /** Information about the user */
1090
+ user?: User
1091
+ /** True, if the bot is allowed to edit administrator privileges of that user */
1092
+ can_be_edited?: boolean
1093
+ /** True, if the user's presence in the chat is hidden */
1094
+ is_anonymous?: boolean
1095
+ /** 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 */
1096
+ can_manage_chat?: boolean
1097
+ /** True, if the administrator can delete messages of other users */
1098
+ can_delete_messages?: boolean
1099
+ /**
1100
+ * True, if the administrator can manage voice chats
1101
+ * @deprecated
1102
+ */
1103
+ can_manage_voice_chats?: boolean
1104
+ /** True, if the administrator can manage voice chats */
1105
+ can_manage_video_chats?: boolean
1106
+ /** True, if the administrator can restrict, ban or unban chat members */
1107
+ can_restrict_members?: boolean
1108
+ /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
1109
+ can_promote_members?: boolean
1110
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1111
+ can_change_info?: boolean
1112
+ /** True, if the user is allowed to invite new users to the chat */
1113
+ can_invite_users?: boolean
1114
+ /** Optional. True, if the administrator can post in the channel; channels only */
1115
+ can_post_messages?: boolean
1116
+ /** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */
1117
+ can_edit_messages?: boolean
1118
+ /** Optional. True, if the user is allowed to pin messages; groups and supergroups only */
1119
+ can_pin_messages?: boolean
1120
+ /** Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only */
1121
+ can_manage_topics?: boolean
1122
+ /** Optional. Custom title for this user */
1123
+ custom_title?: string
1124
+ }
1125
+
1126
+ /**
1127
+ * Represents a chat member that has no additional privileges or restrictions.
1128
+ * @see https://core.telegram.org/bots/api#chatmembermember
1129
+ */
1130
+ export interface ChatMemberMember {
1131
+ /** The member's status in the chat, always "member" */
1132
+ status?: 'member'
1133
+ /** Information about the user */
1134
+ user?: User
1135
+ }
1136
+
1137
+ /**
1138
+ * Represents a chat member that is under certain restrictions in the chat. Supergroups only.
1139
+ * @see https://core.telegram.org/bots/api#chatmemberrestricted
1140
+ */
1141
+ export interface ChatMemberRestricted {
1142
+ /** The member's status in the chat, always "restricted" */
1143
+ status?: 'restricted'
1144
+ /** Information about the user */
1145
+ user?: User
1146
+ /** True, if the user is a member of the chat at the moment of the request */
1147
+ is_member?: boolean
1148
+ /** True, if the user is allowed to change the chat title, photo and other settings */
1149
+ can_change_info?: boolean
1150
+ /** True, if the user is allowed to invite new users to the chat */
1151
+ can_invite_users?: boolean
1152
+ /** True, if the user is allowed to pin messages */
1153
+ can_pin_messages?: boolean
1154
+ /** True, if the user is allowed to create forum topics */
1155
+ can_manage_topics: boolean
1156
+ /** True, if the user is allowed to send text messages, contacts, locations and venues */
1157
+ can_send_messages?: boolean
1158
+ /** True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes */
1159
+ can_send_media_messages?: boolean
1160
+ /** True, if the user is allowed to send polls */
1161
+ can_send_polls?: boolean
1162
+ /** True, if the user is allowed to send animations, games, stickers and use inline bots */
1163
+ can_send_other_messages?: boolean
1164
+ /** True, if the user is allowed to add web page previews to their messages */
1165
+ can_add_web_page_previews?: boolean
1166
+ /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */
1167
+ until_date?: Integer
1168
+ }
1169
+
1170
+ /**
1171
+ * Represents a chat member that isn't currently a member of the chat, but may join it themselves.
1172
+ * @see https://core.telegram.org/bots/api#chatmemberleft
1173
+ */
1174
+ export interface ChatMemberLeft {
1175
+ /** The member's status in the chat, always "left" */
1176
+ status?: 'left'
1177
+ /** Information about the user */
1178
+ user?: User
1179
+ }
1180
+
1181
+ /**
1182
+ * Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
1183
+ * @see https://core.telegram.org/bots/api#chatmemberbanned
1184
+ */
1185
+ export interface ChatMemberBanned {
1186
+ /** The member's status in the chat, always "kicked" */
1187
+ status?: 'kicked'
1188
+ /** Information about the user */
1189
+ user?: User
1190
+ /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */
1191
+ until_date?: Integer
1192
+ }
1193
+
1194
+ /**
1195
+ * This object represents changes in the status of a chat member.
1196
+ * @see https://core.telegram.org/bots/api#chatmemberupdated
1197
+ */
1198
+ export interface ChatMemberUpdated {
1199
+ /** Chat the user belongs to */
1200
+ chat?: Chat
1201
+ /** Performer of the action, which resulted in the change */
1202
+ from?: User
1203
+ /** Date the change was done in Unix time */
1204
+ date?: Integer
1205
+ /** Previous information about the chat member */
1206
+ old_chat_member?: ChatMember
1207
+ /** New information about the chat member */
1208
+ new_chat_member?: ChatMember
1209
+ /** Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
1210
+ invite_link?: ChatInviteLink
1211
+ }
1212
+
1213
+ /**
1214
+ * Represents a join request sent to a chat.
1215
+ * @see https://core.telegram.org/bots/api#chatjoinrequest
1216
+ */
1217
+ export interface ChatJoinRequest {
1218
+ /** Chat to which the request was sent */
1219
+ chat?: Chat
1220
+ /** User that sent the join request */
1221
+ from?: User
1222
+ /** Date the request was sent in Unix time */
1223
+ date?: Integer
1224
+ /** Optional. Bio of the user. */
1225
+ bio?: string
1226
+ /** Optional. Chat invite link that was used by the user to send the join request */
1227
+ invite_link?: ChatInviteLink
1228
+ }
1229
+
1230
+ /**
1231
+ * Describes actions that a non-administrator user is allowed to take in a chat.
1232
+ * @see https://core.telegram.org/bots/api#chatpermissions
1233
+ */
1234
+ export interface ChatPermissions {
1235
+ /** Optional. True, if the user is allowed to send text messages, contacts, locations and venues */
1236
+ can_send_messages?: boolean
1237
+ /** Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages */
1238
+ can_send_media_messages?: boolean
1239
+ /** Optional. True, if the user is allowed to send polls, implies can_send_messages */
1240
+ can_send_polls?: boolean
1241
+ /** Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages */
1242
+ can_send_other_messages?: boolean
1243
+ /** Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages */
1244
+ can_add_web_page_previews?: boolean
1245
+ /** Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
1246
+ can_change_info?: boolean
1247
+ /** Optional. True, if the user is allowed to invite new users to the chat */
1248
+ can_invite_users?: boolean
1249
+ /** Optional. True, if the user is allowed to pin messages. Ignored in public supergroups */
1250
+ can_pin_messages?: boolean
1251
+ /** Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages */
1252
+ can_manage_topics?: boolean
1253
+ }
1254
+
1255
+ /**
1256
+ * Represents a location to which a chat is connected.
1257
+ * @see https://core.telegram.org/bots/api#chatlocation
1258
+ */
1259
+ export interface ChatLocation {
1260
+ /** The location to which the supergroup is connected. Can't be a live location. */
1261
+ location?: Location
1262
+ /** Location address; 1-64 characters, as defined by the chat owner */
1263
+ address?: string
1264
+ }
1265
+
1266
+ export interface ForumTopic {
1267
+ /** Unique identifier of the forum topic */
1268
+ message_thread_id: number
1269
+ /** Name of the topic */
1270
+ name: string
1271
+ /** Color of the topic icon in RGB format */
1272
+ icon_color: number
1273
+ /** Optional. Unique identifier of the custom emoji shown as the topic icon */
1274
+ icon_custom_emoji_id?: string
1275
+ }
1276
+
1277
+ /**
1278
+ * This object represents a bot command.
1279
+ * @see https://core.telegram.org/bots/api#botcommand
1280
+ */
1281
+ export interface BotCommand {
1282
+ /** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
1283
+ command?: string
1284
+ /** Description of the command; 1-256 characters. */
1285
+ description?: string
1286
+ }
1287
+
1288
+ /**
1289
+ * This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
1290
+ * - BotCommandScopeDefault
1291
+ * - BotCommandScopeAllPrivateChats
1292
+ * - BotCommandScopeAllGroupChats
1293
+ * - BotCommandScopeAllChatAdministrators
1294
+ * - BotCommandScopeChat
1295
+ * - BotCommandScopeChatAdministrators
1296
+ * - BotCommandScopeChatMember
1297
+ * @see https://core.telegram.org/bots/api#botcommandscope
1298
+ */
1299
+ export type BotCommandScope =
1300
+ | BotCommandScopeDefault
1301
+ | BotCommandScopeAllPrivateChats
1302
+ | BotCommandScopeAllGroupChats
1303
+ | BotCommandScopeAllChatAdministrators
1304
+ | BotCommandScopeChat
1305
+ | BotCommandScopeChatAdministrators
1306
+ | BotCommandScopeChatMember
1307
+
1308
+ /**
1309
+ * Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
1310
+ * @see https://core.telegram.org/bots/api#botcommandscopedefault
1311
+ */
1312
+ export interface BotCommandScopeDefault {
1313
+ /** Scope type, must be default */
1314
+ type?: string
1315
+ }
1316
+
1317
+ /**
1318
+ * Represents the scope of bot commands, covering all private chats.
1319
+ * @see https://core.telegram.org/bots/api#botcommandscopeallprivatechats
1320
+ */
1321
+ export interface BotCommandScopeAllPrivateChats {
1322
+ /** Scope type, must be all_private_chats */
1323
+ type?: string
1324
+ }
1325
+
1326
+ /**
1327
+ * Represents the scope of bot commands, covering all group and supergroup chats.
1328
+ * @see https://core.telegram.org/bots/api#botcommandscopeallgroupchats
1329
+ */
1330
+ export interface BotCommandScopeAllGroupChats {
1331
+ /** Scope type, must be all_group_chats */
1332
+ type?: string
1333
+ }
1334
+
1335
+ /**
1336
+ * Represents the scope of bot commands, covering all group and supergroup chat administrators.
1337
+ * @see https://core.telegram.org/bots/api#botcommandscopeallchatadministrators
1338
+ */
1339
+ export interface BotCommandScopeAllChatAdministrators {
1340
+ /** Scope type, must be all_chat_administrators */
1341
+ type?: string
1342
+ }
1343
+
1344
+ /**
1345
+ * Represents the scope of bot commands, covering a specific chat.
1346
+ * @see https://core.telegram.org/bots/api#botcommandscopechat
1347
+ */
1348
+ export interface BotCommandScopeChat {
1349
+ /** Scope type, must be chat */
1350
+ type?: string
1351
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
1352
+ chat_id?: Integer | string
1353
+ }
1354
+
1355
+ /**
1356
+ * Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
1357
+ * @see https://core.telegram.org/bots/api#botcommandscopechatadministrators
1358
+ */
1359
+ export interface BotCommandScopeChatAdministrators {
1360
+ /** Scope type, must be chat_administrators */
1361
+ type?: string
1362
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
1363
+ chat_id?: Integer | string
1364
+ }
1365
+
1366
+ /**
1367
+ * Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
1368
+ * @see https://core.telegram.org/bots/api#botcommandscopechatmember
1369
+ */
1370
+ export interface BotCommandScopeChatMember {
1371
+ /** Scope type, must be chat_member */
1372
+ type?: string
1373
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
1374
+ chat_id?: Integer | string
1375
+ /** Unique identifier of the target user */
1376
+ user_id?: Integer
1377
+ }
1378
+
1379
+ /**
1380
+ * This object describes the bot's menu button in a private chat. It should be one of
1381
+ * - MenuButtonCommands
1382
+ * - MenuButtonWebApp
1383
+ * - MenuButtonDefault
1384
+ * If a menu button other than MenuButtonDefault is set for a private chat, then it is applied in the chat. Otherwise the default menu button is applied. By default, the menu button opens the list of bot commands.
1385
+ * @see https://core.telegram.org/bots/api#menubutton
1386
+ */
1387
+ export type MenuButton =
1388
+ | MenuButtonCommands
1389
+ | MenuButtonWebApp
1390
+ | MenuButtonDefault
1391
+
1392
+ /**
1393
+ * Represents a menu button, which opens the bot's list of commands.
1394
+ * @see https://core.telegram.org/bots/api#menubuttoncommands
1395
+ */
1396
+ export interface MenuButtonCommands {
1397
+ /** Type of the button, must be commands */
1398
+ type: string
1399
+ }
1400
+
1401
+ /**
1402
+ * Represents a menu button, which launches a Web App.
1403
+ * @see https://core.telegram.org/bots/api#menubuttonwebapp
1404
+ */
1405
+ export interface MenuButtonWebApp {
1406
+ /** Type of the button, must be web_app */
1407
+ type: string
1408
+ /** Text on the button */
1409
+ text: string
1410
+ /** 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. */
1411
+ web_app: WebAppInfo
1412
+ }
1413
+
1414
+ /**
1415
+ * Describes that no specific value for the menu button was set.
1416
+ * @see https://core.telegram.org/bots/api#menubuttondefault
1417
+ */
1418
+ export interface MenuButtonDefault {
1419
+ /** Type of the button, must be default */
1420
+ type: string
1421
+ }
1422
+
1423
+ /**
1424
+ * Contains information about why a request was unsuccessful.
1425
+ * @see https://core.telegram.org/bots/api#responseparameters
1426
+ */
1427
+ export interface ResponseParameters {
1428
+ /** Optional. The group has been migrated to a supergroup with the specified identifier. 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. */
1429
+ migrate_to_chat_id?: Integer
1430
+ /** Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
1431
+ retry_after?: Integer
1432
+ }
1433
+
1434
+ /**
1435
+ * This object represents the content of a media message to be sent. It should be one of
1436
+ * - InputMediaAnimation
1437
+ * - InputMediaDocument
1438
+ * - InputMediaAudio
1439
+ * - InputMediaPhoto
1440
+ * - InputMediaVideo
1441
+ * @see https://core.telegram.org/bots/api#inputmedia
1442
+ */
1443
+ export type InputMedia =
1444
+ | InputMediaAnimation
1445
+ | InputMediaDocument
1446
+ | InputMediaAudio
1447
+ | InputMediaPhoto
1448
+ | InputMediaVideo
1449
+
1450
+ /**
1451
+ * Represents a photo to be sent.
1452
+ * @see https://core.telegram.org/bots/api#inputmediaphoto
1453
+ */
1454
+ export interface InputMediaPhoto {
1455
+ /** Type of the result, must be photo */
1456
+ type?: string
1457
+ /** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files » */
1458
+ media?: string
1459
+ /** Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */
1460
+ caption?: string
1461
+ /** Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */
1462
+ parse_mode?: string
1463
+ /** Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */
1464
+ caption_entities?: MessageEntity[]
1465
+ /** Optional. Pass True if the photo needs to be covered with a spoiler animation */
1466
+ has_spoiler?: boolean
1467
+ }
1468
+
1469
+ /**
1470
+ * Represents a video to be sent.
1471
+ * @see https://core.telegram.org/bots/api#inputmediavideo
1472
+ */
1473
+ export interface InputMediaVideo {
1474
+ /** Type of the result, must be video */
1475
+ type?: string
1476
+ /** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files » */
1477
+ media?: string
1478
+ /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1479
+ thumb?: InputFile | string
1480
+ /** Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */
1481
+ caption?: string
1482
+ /** Optional. Mode for parsing entities in the video caption. See formatting options for more details. */
1483
+ parse_mode?: string
1484
+ /** Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */
1485
+ caption_entities?: MessageEntity[]
1486
+ /** Optional. Video width */
1487
+ width?: Integer
1488
+ /** Optional. Video height */
1489
+ height?: Integer
1490
+ /** Optional. Video duration in seconds */
1491
+ duration?: Integer
1492
+ /** Optional. Pass True, if the uploaded video is suitable for streaming */
1493
+ supports_streaming?: boolean
1494
+ /** Optional. Pass True if the video needs to be covered with a spoiler animation */
1495
+ has_spoiler?: boolean
1496
+ }
1497
+
1498
+ /**
1499
+ * Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
1500
+ * @see https://core.telegram.org/bots/api#inputmediaanimation
1501
+ */
1502
+ export interface InputMediaAnimation {
1503
+ /** Type of the result, must be animation */
1504
+ type?: string
1505
+ /** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files » */
1506
+ media?: string
1507
+ /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1508
+ thumb?: InputFile | string
1509
+ /** Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing */
1510
+ caption?: string
1511
+ /** Optional. Mode for parsing entities in the animation caption. See formatting options for more details. */
1512
+ parse_mode?: string
1513
+ /** Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */
1514
+ caption_entities?: MessageEntity[]
1515
+ /** Optional. Animation width */
1516
+ width?: Integer
1517
+ /** Optional. Animation height */
1518
+ height?: Integer
1519
+ /** Optional. Animation duration in seconds */
1520
+ duration?: Integer
1521
+ /** Optional. Pass True if the animation needs to be covered with a spoiler animation */
1522
+ has_spoiler?: boolean
1523
+ }
1524
+
1525
+ /**
1526
+ * Represents an audio file to be treated as music to be sent.
1527
+ * @see https://core.telegram.org/bots/api#inputmediaaudio
1528
+ */
1529
+ export interface InputMediaAudio {
1530
+ /** Type of the result, must be audio */
1531
+ type?: string
1532
+ /** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files » */
1533
+ media?: string
1534
+ /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1535
+ thumb?: InputFile | string
1536
+ /** Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing */
1537
+ caption?: string
1538
+ /** Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */
1539
+ parse_mode?: string
1540
+ /** Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */
1541
+ caption_entities?: MessageEntity[]
1542
+ /** Optional. Duration of the audio in seconds */
1543
+ duration?: Integer
1544
+ /** Optional. Performer of the audio */
1545
+ performer?: string
1546
+ /** Optional. Title of the audio */
1547
+ title?: string
1548
+ }
1549
+
1550
+ /**
1551
+ * Represents a general file to be sent.
1552
+ * @see https://core.telegram.org/bots/api#inputmediadocument
1553
+ */
1554
+ export interface InputMediaDocument {
1555
+ /** Type of the result, must be document */
1556
+ type?: string
1557
+ /** File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> name. More info on Sending Files » */
1558
+ media?: string
1559
+ /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1560
+ thumb?: InputFile | string
1561
+ /** Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */
1562
+ caption?: string
1563
+ /** Optional. Mode for parsing entities in the document caption. See formatting options for more details. */
1564
+ parse_mode?: string
1565
+ /** Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */
1566
+ caption_entities?: MessageEntity[]
1567
+ /** Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album. */
1568
+ disable_content_type_detection?: boolean
1569
+ }
1570
+
1571
+ /**
1572
+ * This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
1573
+ * @see https://core.telegram.org/bots/api#inputfile
1574
+ */
1575
+ export type InputFile = any
1576
+
1577
+ export interface SendMessagePayload {
1578
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1579
+ chat_id?: Integer | string
1580
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1581
+ message_thread_id?: number
1582
+ /** Text of the message to be sent, 1-4096 characters after entities parsing */
1583
+ text?: string
1584
+ /** Mode for parsing entities in the message text. See formatting options for more details. */
1585
+ parse_mode?: string
1586
+ /** A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode */
1587
+ entities?: MessageEntity[]
1588
+ /** Disables link previews for links in this message */
1589
+ disable_web_page_preview?: boolean
1590
+ /** Options for link previews. */
1591
+ link_preview_options?: LinkPreviewOptions
1592
+ /** Sends the message silently. Users will receive a notification with no sound. */
1593
+ disable_notification?: boolean
1594
+ /** Protects the contents of the sent message from forwarding and saving */
1595
+ protect_content?: boolean
1596
+ /** If the message is a reply, ID of the original message */
1597
+ reply_to_message_id?: Integer
1598
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1599
+ allow_sending_without_reply?: boolean
1600
+ /** Parameters for replying to another message. */
1601
+ reply_parameters?: ReplyParameters
1602
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1603
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1604
+ }
1605
+
1606
+ export interface ForwardMessagePayload {
1607
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1608
+ chat_id?: Integer | string
1609
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1610
+ message_thread_id?: number
1611
+ /** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
1612
+ from_chat_id?: Integer | string
1613
+ /** Sends the message silently. Users will receive a notification with no sound. */
1614
+ disable_notification?: boolean
1615
+ /** Protects the contents of the forwarded message from forwarding and saving */
1616
+ protect_content?: boolean
1617
+ /** Message identifier in the chat specified in from_chat_id */
1618
+ message_id?: Integer
1619
+ }
1620
+
1621
+ export interface CopyMessagePayload {
1622
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1623
+ chat_id?: Integer | string
1624
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1625
+ message_thread_id?: number
1626
+ /** Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) */
1627
+ from_chat_id?: Integer | string
1628
+ /** Message identifier in the chat specified in from_chat_id */
1629
+ message_id?: Integer
1630
+ /** New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept */
1631
+ caption?: string
1632
+ /** Mode for parsing entities in the new caption. See formatting options for more details. */
1633
+ parse_mode?: string
1634
+ /** A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode */
1635
+ caption_entities?: MessageEntity[]
1636
+ /** Sends the message silently. Users will receive a notification with no sound. */
1637
+ disable_notification?: boolean
1638
+ /** Protects the contents of the sent message from forwarding and saving */
1639
+ protect_content?: boolean
1640
+ /** If the message is a reply, ID of the original message */
1641
+ reply_to_message_id?: Integer
1642
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1643
+ allow_sending_without_reply?: boolean
1644
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1645
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1646
+ }
1647
+
1648
+ export interface SendPhotoPayload {
1649
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1650
+ chat_id?: Integer | string
1651
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1652
+ message_thread_id?: number
1653
+ /** Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More info on Sending Files » */
1654
+ photo?: InputFile | string
1655
+ /** Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing */
1656
+ caption?: string
1657
+ /** Mode for parsing entities in the photo caption. See formatting options for more details. */
1658
+ parse_mode?: string
1659
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1660
+ caption_entities?: MessageEntity[]
1661
+ /** Pass True if the photo needs to be covered with a spoiler animation */
1662
+ has_spoiler?: boolean
1663
+ /** Sends the message silently. Users will receive a notification with no sound. */
1664
+ disable_notification?: boolean
1665
+ /** Protects the contents of the sent message from forwarding and saving */
1666
+ protect_content?: boolean
1667
+ /** If the message is a reply, ID of the original message */
1668
+ reply_to_message_id?: Integer
1669
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1670
+ allow_sending_without_reply?: boolean
1671
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1672
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1673
+ }
1674
+
1675
+ export interface SendAudioPayload {
1676
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1677
+ chat_id?: Integer | string
1678
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1679
+ message_thread_id?: number
1680
+ /** Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » */
1681
+ audio?: InputFile | string
1682
+ /** Audio caption, 0-1024 characters after entities parsing */
1683
+ caption?: string
1684
+ /** Mode for parsing entities in the audio caption. See formatting options for more details. */
1685
+ parse_mode?: string
1686
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1687
+ caption_entities?: MessageEntity[]
1688
+ /** Duration of the audio in seconds */
1689
+ duration?: Integer
1690
+ /** Performer */
1691
+ performer?: string
1692
+ /** Track name */
1693
+ title?: string
1694
+ /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1695
+ thumb?: InputFile | string
1696
+ /** Sends the message silently. Users will receive a notification with no sound. */
1697
+ disable_notification?: boolean
1698
+ /** Protects the contents of the sent message from forwarding and saving */
1699
+ protect_content?: boolean
1700
+ /** If the message is a reply, ID of the original message */
1701
+ reply_to_message_id?: Integer
1702
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1703
+ allow_sending_without_reply?: boolean
1704
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1705
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1706
+ }
1707
+
1708
+ export interface SendDocumentPayload {
1709
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1710
+ chat_id?: Integer | string
1711
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1712
+ message_thread_id?: number
1713
+ /** File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » */
1714
+ document?: InputFile | string
1715
+ /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1716
+ thumb?: InputFile | string
1717
+ /** Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing */
1718
+ caption?: string
1719
+ /** Mode for parsing entities in the document caption. See formatting options for more details. */
1720
+ parse_mode?: string
1721
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1722
+ caption_entities?: MessageEntity[]
1723
+ /** Disables automatic server-side content type detection for files uploaded using multipart/form-data */
1724
+ disable_content_type_detection?: boolean
1725
+ /** Sends the message silently. Users will receive a notification with no sound. */
1726
+ disable_notification?: boolean
1727
+ /** Protects the contents of the sent message from forwarding and saving */
1728
+ protect_content?: boolean
1729
+ /** If the message is a reply, ID of the original message */
1730
+ reply_to_message_id?: Integer
1731
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1732
+ allow_sending_without_reply?: boolean
1733
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1734
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1735
+ }
1736
+
1737
+ export interface SendVideoPayload {
1738
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1739
+ chat_id?: Integer | string
1740
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1741
+ message_thread_id?: number
1742
+ /** Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files » */
1743
+ video?: InputFile | string
1744
+ /** Duration of sent video in seconds */
1745
+ duration?: Integer
1746
+ /** Video width */
1747
+ width?: Integer
1748
+ /** Video height */
1749
+ height?: Integer
1750
+ /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1751
+ thumb?: InputFile | string
1752
+ /** Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing */
1753
+ caption?: string
1754
+ /** Mode for parsing entities in the video caption. See formatting options for more details. */
1755
+ parse_mode?: string
1756
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1757
+ caption_entities?: MessageEntity[]
1758
+ /** Pass True if the video needs to be covered with a spoiler animation */
1759
+ has_spoiler?: boolean
1760
+ /** Pass True, if the uploaded video is suitable for streaming */
1761
+ supports_streaming?: boolean
1762
+ /** Sends the message silently. Users will receive a notification with no sound. */
1763
+ disable_notification?: boolean
1764
+ /** Protects the contents of the sent message from forwarding and saving */
1765
+ protect_content?: boolean
1766
+ /** If the message is a reply, ID of the original message */
1767
+ reply_to_message_id?: Integer
1768
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1769
+ allow_sending_without_reply?: boolean
1770
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1771
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1772
+ }
1773
+
1774
+ export interface SendAnimationPayload {
1775
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1776
+ chat_id?: Integer | string
1777
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1778
+ message_thread_id?: number
1779
+ /** Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files » */
1780
+ animation?: InputFile | string
1781
+ /** Duration of sent animation in seconds */
1782
+ duration?: Integer
1783
+ /** Animation width */
1784
+ width?: Integer
1785
+ /** Animation height */
1786
+ height?: Integer
1787
+ /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1788
+ thumb?: InputFile | string
1789
+ /** Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing */
1790
+ caption?: string
1791
+ /** Mode for parsing entities in the animation caption. See formatting options for more details. */
1792
+ parse_mode?: string
1793
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1794
+ caption_entities?: MessageEntity[]
1795
+ /** Pass True if the animation needs to be covered with a spoiler animation */
1796
+ has_spoiler?: boolean
1797
+ /** Sends the message silently. Users will receive a notification with no sound. */
1798
+ disable_notification?: boolean
1799
+ /** Protects the contents of the sent message from forwarding and saving */
1800
+ protect_content?: boolean
1801
+ /** If the message is a reply, ID of the original message */
1802
+ reply_to_message_id?: Integer
1803
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1804
+ allow_sending_without_reply?: boolean
1805
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1806
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1807
+ }
1808
+
1809
+ export interface SendVoicePayload {
1810
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1811
+ chat_id?: Integer | string
1812
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1813
+ message_thread_id?: number
1814
+ /** Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files » */
1815
+ voice?: InputFile | string
1816
+ /** Voice message caption, 0-1024 characters after entities parsing */
1817
+ caption?: string
1818
+ /** Mode for parsing entities in the voice message caption. See formatting options for more details. */
1819
+ parse_mode?: string
1820
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
1821
+ caption_entities?: MessageEntity[]
1822
+ /** Duration of the voice message in seconds */
1823
+ duration?: Integer
1824
+ /** Sends the message silently. Users will receive a notification with no sound. */
1825
+ disable_notification?: boolean
1826
+ /** Protects the contents of the sent message from forwarding and saving */
1827
+ protect_content?: boolean
1828
+ /** If the message is a reply, ID of the original message */
1829
+ reply_to_message_id?: Integer
1830
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1831
+ allow_sending_without_reply?: boolean
1832
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1833
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1834
+ }
1835
+
1836
+ export interface SendVideoNotePayload {
1837
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1838
+ chat_id?: Integer | string
1839
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1840
+ message_thread_id?: number
1841
+ /** Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported */
1842
+ video_note?: InputFile | string
1843
+ /** Duration of sent video in seconds */
1844
+ duration?: Integer
1845
+ /** Video width and height, i.e. diameter of the video message */
1846
+ length?: Integer
1847
+ /** Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files » */
1848
+ thumb?: InputFile | string
1849
+ /** Sends the message silently. Users will receive a notification with no sound. */
1850
+ disable_notification?: boolean
1851
+ /** Protects the contents of the sent message from forwarding and saving */
1852
+ protect_content?: boolean
1853
+ /** If the message is a reply, ID of the original message */
1854
+ reply_to_message_id?: Integer
1855
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1856
+ allow_sending_without_reply?: boolean
1857
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1858
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1859
+ }
1860
+
1861
+ export interface SendMediaGroupPayload {
1862
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1863
+ chat_id?: Integer | string
1864
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1865
+ message_thread_id?: number
1866
+ /** A JSON-serialized array describing messages to be sent, must include 2-10 items */
1867
+ media?: (InputMediaAudio | InputMediaDocument | InputMediaPhoto | InputMediaVideo)[]
1868
+ /** Sends messages silently. Users will receive a notification with no sound. */
1869
+ disable_notification?: boolean
1870
+ /** Protects the contents of the sent messages from forwarding and saving */
1871
+ protect_content?: boolean
1872
+ /** If the messages are a reply, ID of the original message */
1873
+ reply_to_message_id?: Integer
1874
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1875
+ allow_sending_without_reply?: boolean
1876
+ /** Parameters for replying to another message. */
1877
+ reply_parameters?: ReplyParameters
1878
+ }
1879
+
1880
+ export interface SendLocationPayload {
1881
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1882
+ chat_id?: Integer | string
1883
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1884
+ message_thread_id?: number
1885
+ /** Latitude of the location */
1886
+ latitude?: Float
1887
+ /** Longitude of the location */
1888
+ longitude?: Float
1889
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
1890
+ horizontal_accuracy?: Float
1891
+ /** Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. */
1892
+ live_period?: Integer
1893
+ /** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
1894
+ heading?: Integer
1895
+ /** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
1896
+ proximity_alert_radius?: Integer
1897
+ /** Sends the message silently. Users will receive a notification with no sound. */
1898
+ disable_notification?: boolean
1899
+ /** Protects the contents of the sent message from forwarding and saving */
1900
+ protect_content?: boolean
1901
+ /** If the message is a reply, ID of the original message */
1902
+ reply_to_message_id?: Integer
1903
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1904
+ allow_sending_without_reply?: boolean
1905
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1906
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1907
+ }
1908
+
1909
+ export interface EditMessageLiveLocationPayload {
1910
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1911
+ chat_id?: Integer | string
1912
+ /** Required if inline_message_id is not specified. Identifier of the message to edit */
1913
+ message_id?: Integer
1914
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
1915
+ inline_message_id?: string
1916
+ /** Latitude of new location */
1917
+ latitude?: Float
1918
+ /** Longitude of new location */
1919
+ longitude?: Float
1920
+ /** The radius of uncertainty for the location, measured in meters; 0-1500 */
1921
+ horizontal_accuracy?: Float
1922
+ /** Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
1923
+ heading?: Integer
1924
+ /** Maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
1925
+ proximity_alert_radius?: Integer
1926
+ /** A JSON-serialized object for a new inline keyboard. */
1927
+ reply_markup?: InlineKeyboardMarkup
1928
+ }
1929
+
1930
+ export interface StopMessageLiveLocationPayload {
1931
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1932
+ chat_id?: Integer | string
1933
+ /** Required if inline_message_id is not specified. Identifier of the message with live location to stop */
1934
+ message_id?: Integer
1935
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
1936
+ inline_message_id?: string
1937
+ /** A JSON-serialized object for a new inline keyboard. */
1938
+ reply_markup?: InlineKeyboardMarkup
1939
+ }
1940
+
1941
+ export interface SendVenuePayload {
1942
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1943
+ chat_id?: Integer | string
1944
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1945
+ message_thread_id?: number
1946
+ /** Latitude of the venue */
1947
+ latitude?: Float
1948
+ /** Longitude of the venue */
1949
+ longitude?: Float
1950
+ /** Name of the venue */
1951
+ title?: string
1952
+ /** Address of the venue */
1953
+ address?: string
1954
+ /** Foursquare identifier of the venue */
1955
+ foursquare_id?: string
1956
+ /** Foursquare type of the venue, if known. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".) */
1957
+ foursquare_type?: string
1958
+ /** Google Places identifier of the venue */
1959
+ google_place_id?: string
1960
+ /** Google Places type of the venue. (See supported types.) */
1961
+ google_place_type?: string
1962
+ /** Sends the message silently. Users will receive a notification with no sound. */
1963
+ disable_notification?: boolean
1964
+ /** Protects the contents of the sent message from forwarding and saving */
1965
+ protect_content?: boolean
1966
+ /** If the message is a reply, ID of the original message */
1967
+ reply_to_message_id?: Integer
1968
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1969
+ allow_sending_without_reply?: boolean
1970
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
1971
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1972
+ }
1973
+
1974
+ export interface SendContactPayload {
1975
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
1976
+ chat_id?: Integer | string
1977
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
1978
+ message_thread_id?: number
1979
+ /** Contact's phone number */
1980
+ phone_number?: string
1981
+ /** Contact's first name */
1982
+ first_name?: string
1983
+ /** Contact's last name */
1984
+ last_name?: string
1985
+ /** Additional data about the contact in the form of a vCard, 0-2048 bytes */
1986
+ vcard?: string
1987
+ /** Sends the message silently. Users will receive a notification with no sound. */
1988
+ disable_notification?: boolean
1989
+ /** Protects the contents of the sent message from forwarding and saving */
1990
+ protect_content?: boolean
1991
+ /** If the message is a reply, ID of the original message */
1992
+ reply_to_message_id?: Integer
1993
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
1994
+ allow_sending_without_reply?: boolean
1995
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. */
1996
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
1997
+ }
1998
+
1999
+ export interface SendPollPayload {
2000
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2001
+ chat_id?: Integer | string
2002
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
2003
+ message_thread_id?: number
2004
+ /** Poll question, 1-300 characters */
2005
+ question?: string
2006
+ /** A JSON-serialized list of answer options, 2-10 strings 1-100 characters each */
2007
+ options?: string[]
2008
+ /** True, if the poll needs to be anonymous, defaults to True */
2009
+ is_anonymous?: boolean
2010
+ /** Poll type, "quiz" or "regular", defaults to "regular" */
2011
+ type?: string
2012
+ /** True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False */
2013
+ allows_multiple_answers?: boolean
2014
+ /** 0-based identifier of the correct answer option, required for polls in quiz mode */
2015
+ correct_option_id?: Integer
2016
+ /** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing */
2017
+ explanation?: string
2018
+ /** Mode for parsing entities in the explanation. See formatting options for more details. */
2019
+ explanation_parse_mode?: string
2020
+ /** A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode */
2021
+ explanation_entities?: MessageEntity[]
2022
+ /** Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. */
2023
+ open_period?: Integer
2024
+ /** Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period. */
2025
+ close_date?: Integer
2026
+ /** Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. */
2027
+ is_closed?: boolean
2028
+ /** Sends the message silently. Users will receive a notification with no sound. */
2029
+ disable_notification?: boolean
2030
+ /** Protects the contents of the sent message from forwarding and saving */
2031
+ protect_content?: boolean
2032
+ /** If the message is a reply, ID of the original message */
2033
+ reply_to_message_id?: Integer
2034
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
2035
+ allow_sending_without_reply?: boolean
2036
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
2037
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
2038
+ }
2039
+
2040
+ export interface SendDicePayload {
2041
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2042
+ chat_id?: Integer | string
2043
+ /** Unique identifier for the target message thread (topic) of the forum; for forum supergroups only */
2044
+ message_thread_id?: number
2045
+ /** Emoji on which the dice throw animation is based. Currently, must be one of "", "", "", "", "", or "". Dice can have values 1-6 for "", "" and "", values 1-5 for "" and "", and values 1-64 for "". Defaults to "" */
2046
+ emoji?: string
2047
+ /** Sends the message silently. Users will receive a notification with no sound. */
2048
+ disable_notification?: boolean
2049
+ /** Protects the contents of the sent message from forwarding */
2050
+ protect_content?: boolean
2051
+ /** If the message is a reply, ID of the original message */
2052
+ reply_to_message_id?: Integer
2053
+ /** Pass True, if the message should be sent even if the specified replied-to message is not found */
2054
+ allow_sending_without_reply?: boolean
2055
+ /** Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. */
2056
+ reply_markup?: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
2057
+ }
2058
+
2059
+ export interface SendChatActionPayload {
2060
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2061
+ chat_id?: Integer | string
2062
+ /** Unique identifier for the target message thread; supergroups only */
2063
+ message_thread_id?: number
2064
+ /** Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes. */
2065
+ action?: string
2066
+ }
2067
+
2068
+ export interface GetUserProfilePhotosPayload {
2069
+ /** Unique identifier of the target user */
2070
+ user_id?: Integer
2071
+ /** Sequential number of the first photo to be returned. By default, all photos are returned. */
2072
+ offset?: Integer
2073
+ /** Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. */
2074
+ limit?: Integer
2075
+ }
2076
+
2077
+ export interface GetFilePayload {
2078
+ /** File identifier to get info about */
2079
+ file_id?: string
2080
+ }
2081
+
2082
+ export interface BanChatMemberPayload {
2083
+ /** Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) */
2084
+ chat_id?: Integer | string
2085
+ /** Unique identifier of the target user */
2086
+ user_id?: Integer
2087
+ /** Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only. */
2088
+ until_date?: Integer
2089
+ /** Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels. */
2090
+ revoke_messages?: boolean
2091
+ }
2092
+
2093
+ export interface UnbanChatMemberPayload {
2094
+ /** Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) */
2095
+ chat_id?: Integer | string
2096
+ /** Unique identifier of the target user */
2097
+ user_id?: Integer
2098
+ /** Do nothing if the user is not banned */
2099
+ only_if_banned?: boolean
2100
+ }
2101
+
2102
+ export interface RestrictChatMemberPayload {
2103
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2104
+ chat_id?: Integer | string
2105
+ /** Unique identifier of the target user */
2106
+ user_id?: Integer
2107
+ /** A JSON-serialized object for new user permissions */
2108
+ permissions?: ChatPermissions
2109
+ /** Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever */
2110
+ until_date?: Integer
2111
+ }
2112
+
2113
+ export interface PromoteChatMemberPayload {
2114
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2115
+ chat_id?: Integer | string
2116
+ /** Unique identifier of the target user */
2117
+ user_id?: Integer
2118
+ /** Pass True, if the administrator's presence in the chat is hidden */
2119
+ is_anonymous?: boolean
2120
+ /** Pass 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 */
2121
+ can_manage_chat?: boolean
2122
+ /** Pass True, if the administrator can create channel posts, channels only */
2123
+ can_post_messages?: boolean
2124
+ /** Pass True, if the administrator can edit messages of other users and can pin messages, channels only */
2125
+ can_edit_messages?: boolean
2126
+ /** Pass True, if the administrator can delete messages of other users */
2127
+ can_delete_messages?: boolean
2128
+ /**
2129
+ * Pass True, if the administrator can manage voice chats
2130
+ * @deprecated
2131
+ */
2132
+ can_manage_voice_chats?: boolean
2133
+ /** Pass True, if the administrator can manage voice chats */
2134
+ can_manage_video_chats?: boolean
2135
+ /** Pass True, if the administrator can restrict, ban or unban chat members */
2136
+ can_restrict_members?: boolean
2137
+ /** Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) */
2138
+ can_promote_members?: boolean
2139
+ /** Pass True, if the administrator can change chat title, photo and other settings */
2140
+ can_change_info?: boolean
2141
+ /** Pass True, if the administrator can invite new users to the chat */
2142
+ can_invite_users?: boolean
2143
+ /** Pass True, if the administrator can pin messages, supergroups only */
2144
+ can_pin_messages?: boolean
2145
+ /** Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only */
2146
+ can_manage_topics?: boolean
2147
+ }
2148
+
2149
+ export interface SetChatAdministratorCustomTitlePayload {
2150
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2151
+ chat_id?: Integer | string
2152
+ /** Unique identifier of the target user */
2153
+ user_id?: Integer
2154
+ /** New custom title for the administrator; 0-16 characters, emoji are not allowed */
2155
+ custom_title?: string
2156
+ }
2157
+
2158
+ export interface BanChatSenderChatPayload {
2159
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2160
+ chat_id?: Integer | string
2161
+ /** Unique identifier of the target sender chat */
2162
+ sender_chat_id?: Integer
2163
+ }
2164
+
2165
+ export interface UnbanChatSenderChatPayload {
2166
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2167
+ chat_id?: Integer | string
2168
+ /** Unique identifier of the target sender chat */
2169
+ sender_chat_id?: Integer
2170
+ }
2171
+
2172
+ export interface SetChatPermissionsPayload {
2173
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2174
+ chat_id?: Integer | string
2175
+ /** A JSON-serialized object for new default chat permissions */
2176
+ permissions?: ChatPermissions
2177
+ }
2178
+
2179
+ export interface ExportChatInviteLinkPayload {
2180
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2181
+ chat_id?: Integer | string
2182
+ }
2183
+
2184
+ export interface CreateChatInviteLinkPayload {
2185
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2186
+ chat_id?: Integer | string
2187
+ /** Invite link name; 0-32 characters */
2188
+ name?: string
2189
+ /** Point in time (Unix timestamp) when the link will expire */
2190
+ expire_date?: Integer
2191
+ /** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
2192
+ member_limit?: Integer
2193
+ /** True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified */
2194
+ creates_join_request?: boolean
2195
+ }
2196
+
2197
+ export interface EditChatInviteLinkPayload {
2198
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2199
+ chat_id?: Integer | string
2200
+ /** The invite link to edit */
2201
+ invite_link?: string
2202
+ /** Invite link name; 0-32 characters */
2203
+ name?: string
2204
+ /** Point in time (Unix timestamp) when the link will expire */
2205
+ expire_date?: Integer
2206
+ /** Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
2207
+ member_limit?: Integer
2208
+ /** True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified */
2209
+ creates_join_request?: boolean
2210
+ }
2211
+
2212
+ export interface RevokeChatInviteLinkPayload {
2213
+ /** Unique identifier of the target chat or username of the target channel (in the format @channelusername) */
2214
+ chat_id?: Integer | string
2215
+ /** The invite link to revoke */
2216
+ invite_link?: string
2217
+ }
2218
+
2219
+ export interface ApproveChatJoinRequestPayload {
2220
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2221
+ chat_id?: Integer | string
2222
+ /** Unique identifier of the target user */
2223
+ user_id?: Integer
2224
+ }
2225
+
2226
+ export interface DeclineChatJoinRequestPayload {
2227
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2228
+ chat_id?: Integer | string
2229
+ /** Unique identifier of the target user */
2230
+ user_id?: Integer
2231
+ }
2232
+
2233
+ export interface SetChatPhotoPayload {
2234
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2235
+ chat_id?: Integer | string
2236
+ /** New chat photo, uploaded using multipart/form-data */
2237
+ photo?: InputFile
2238
+ }
2239
+
2240
+ export interface DeleteChatPhotoPayload {
2241
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2242
+ chat_id?: Integer | string
2243
+ }
2244
+
2245
+ export interface SetChatTitlePayload {
2246
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2247
+ chat_id?: Integer | string
2248
+ /** New chat title, 1-255 characters */
2249
+ title?: string
2250
+ }
2251
+
2252
+ export interface SetChatDescriptionPayload {
2253
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2254
+ chat_id?: Integer | string
2255
+ /** New chat description, 0-255 characters */
2256
+ description?: string
2257
+ }
2258
+
2259
+ export interface PinChatMessagePayload {
2260
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2261
+ chat_id?: Integer | string
2262
+ /** Identifier of a message to pin */
2263
+ message_id?: Integer
2264
+ /** Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. */
2265
+ disable_notification?: boolean
2266
+ }
2267
+
2268
+ export interface UnpinChatMessagePayload {
2269
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2270
+ chat_id?: Integer | string
2271
+ /** Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. */
2272
+ message_id?: Integer
2273
+ }
2274
+
2275
+ export interface UnpinAllChatMessagesPayload {
2276
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2277
+ chat_id?: Integer | string
2278
+ }
2279
+
2280
+ export interface EditGeneralForumTopicPayload {
2281
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2282
+ chat_id: Integer | string
2283
+ /** New topic name, 1-128 characters */
2284
+ name: string
2285
+ }
2286
+
2287
+ export interface CloseGeneralForumTopicPayload {
2288
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2289
+ chat_id: Integer | string
2290
+ }
2291
+
2292
+ export interface ReopenGeneralForumTopicPayload {
2293
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2294
+ chat_id: Integer | string
2295
+ }
2296
+
2297
+ export interface HideGeneralForumTopicPayload {
2298
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2299
+ chat_id: Integer | string
2300
+ }
2301
+
2302
+ export interface UnhideGeneralForumTopicPaylad {
2303
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2304
+ chat_id: Integer | string
2305
+ }
2306
+
2307
+ export interface LeaveChatPayload {
2308
+ /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
2309
+ chat_id?: Integer | string
2310
+ }
2311
+
2312
+ export interface GetChatPayload {
2313
+ /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
2314
+ chat_id?: Integer | string
2315
+ }
2316
+
2317
+ export interface GetChatAdministratorsPayload {
2318
+ /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
2319
+ chat_id?: Integer | string
2320
+ }
2321
+
2322
+ export interface GetChatMemberCountPayload {
2323
+ /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
2324
+ chat_id?: Integer | string
2325
+ }
2326
+
2327
+ export interface GetChatMemberPayload {
2328
+ /** Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) */
2329
+ chat_id?: Integer | string
2330
+ /** Unique identifier of the target user */
2331
+ user_id?: Integer
2332
+ }
2333
+
2334
+ export interface SetChatStickerSetPayload {
2335
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2336
+ chat_id?: Integer | string
2337
+ /** Name of the sticker set to be set as the group sticker set */
2338
+ sticker_set_name?: string
2339
+ }
2340
+
2341
+ export interface DeleteChatStickerSetPayload {
2342
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2343
+ chat_id?: Integer | string
2344
+ }
2345
+
2346
+ export interface CreateForumTopicPayload {
2347
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2348
+ chat_id: number | string
2349
+ /** Topic name, 1-128 characters */
2350
+ name: string
2351
+ /** Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F) */
2352
+ icon_color?: number
2353
+ /** Unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. */
2354
+ icon_custom_emoji_id?: string
2355
+ }
2356
+
2357
+ export interface EditForumTopicPayload {
2358
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2359
+ chat_id: number | string
2360
+ /** Unique identifier for the target message thread of the forum topic */
2361
+ message_thread_id: number
2362
+ /** New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept */
2363
+ name?: string
2364
+ /** New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept */
2365
+ icon_custom_emoji_id?: string
2366
+ }
2367
+
2368
+ export interface CloseForumTopicPayload {
2369
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2370
+ chat_id: number | string
2371
+ /** Unique identifier for the target message thread of the forum topic */
2372
+ message_thread_id: number
2373
+ }
2374
+
2375
+ export interface ReopenForumTopicPayload {
2376
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2377
+ chat_id: number | string
2378
+ /** Unique identifier for the target message thread of the forum topic */
2379
+ message_thread_id: number
2380
+ }
2381
+
2382
+ export interface DeleteForumTopicPayload {
2383
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2384
+ chat_id: number | string
2385
+ /** Unique identifier for the target message thread of the forum topic */
2386
+ message_thread_id: number
2387
+ }
2388
+
2389
+ export interface UnpinAllForumTopicMessagesPayload {
2390
+ /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */
2391
+ chat_id: number | string
2392
+ /** Unique identifier for the target message thread of the forum topic */
2393
+ message_thread_id: number
2394
+ }
2395
+
2396
+ export interface AnswerCallbackQueryPayload {
2397
+ /** Unique identifier for the query to be answered */
2398
+ callback_query_id?: string
2399
+ /** Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters */
2400
+ text?: string
2401
+ /** If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. */
2402
+ show_alert?: boolean
2403
+ /**
2404
+ * URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.
2405
+ *
2406
+ * Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
2407
+ */
2408
+ url?: string
2409
+ /** The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. */
2410
+ cache_time?: Integer
2411
+ }
2412
+
2413
+ export interface SetMyCommandsPayload {
2414
+ /** A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. */
2415
+ commands?: BotCommand[]
2416
+ /** A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
2417
+ scope?: BotCommandScope
2418
+ /** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
2419
+ language_code?: string
2420
+ }
2421
+
2422
+ export interface DeleteMyCommandsPayload {
2423
+ /** A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. */
2424
+ scope?: BotCommandScope
2425
+ /** A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands */
2426
+ language_code?: string
2427
+ }
2428
+
2429
+ export interface GetMyCommandsPayload {
2430
+ /** A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. */
2431
+ scope?: BotCommandScope
2432
+ /** A two-letter ISO 639-1 language code or an empty string */
2433
+ language_code?: string
2434
+ }
2435
+
2436
+ export interface SetChatMenuButtonPayload {
2437
+ /** Unique identifier for the target private chat. If not specified, default bot's menu button will be changed */
2438
+ chat_id?: number
2439
+ /** A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault */
2440
+ menu_button?: MenuButton
2441
+ }
2442
+
2443
+ export interface GetChatMenuButtonPayload {
2444
+ /** Unique identifier for the target private chat. If not specified, default bot's menu button will be returned */
2445
+ getChatMenuButton?: number
2446
+ }
2447
+
2448
+ export interface SetMyDefaultAdministratorRightsPayload {
2449
+ /** A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared. */
2450
+ rights?: ChatAdministratorRights
2451
+ /** Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed. */
2452
+ for_channels?: boolean
2453
+ }
2454
+
2455
+ export interface GetMyDefaultAdministratorRightsPayload {
2456
+ /** Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned. */
2457
+ for_channels?: boolean
2458
+ }
2459
+
2460
+ export interface EditMessageTextPayload {
2461
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2462
+ chat_id?: Integer | string
2463
+ /** Required if inline_message_id is not specified. Identifier of the message to edit */
2464
+ message_id?: Integer
2465
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
2466
+ inline_message_id?: string
2467
+ /** New text of the message, 1-4096 characters after entities parsing */
2468
+ text?: string
2469
+ /** Mode for parsing entities in the message text. See formatting options for more details. */
2470
+ parse_mode?: string
2471
+ /** A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode */
2472
+ entities?: MessageEntity[]
2473
+ /** Disables link previews for links in this message */
2474
+ disable_web_page_preview?: boolean
2475
+ /** Options for link previews. */
2476
+ link_preview_options?: LinkPreviewOptions
2477
+ /** Parameters for replying to another message. */
2478
+ reply_parameters?: ReplyParameters
2479
+ /** A JSON-serialized object for an inline keyboard. */
2480
+ reply_markup?: InlineKeyboardMarkup
2481
+ }
2482
+
2483
+ export interface EditMessageCaptionPayload {
2484
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2485
+ chat_id?: Integer | string
2486
+ /** Required if inline_message_id is not specified. Identifier of the message to edit */
2487
+ message_id?: Integer
2488
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
2489
+ inline_message_id?: string
2490
+ /** New caption of the message, 0-1024 characters after entities parsing */
2491
+ caption?: string
2492
+ /** Mode for parsing entities in the message caption. See formatting options for more details. */
2493
+ parse_mode?: string
2494
+ /** A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode */
2495
+ caption_entities?: MessageEntity[]
2496
+ /** A JSON-serialized object for an inline keyboard. */
2497
+ reply_markup?: InlineKeyboardMarkup
2498
+ }
2499
+
2500
+ export interface EditMessageMediaPayload {
2501
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2502
+ chat_id?: Integer | string
2503
+ /** Required if inline_message_id is not specified. Identifier of the message to edit */
2504
+ message_id?: Integer
2505
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
2506
+ inline_message_id?: string
2507
+ /** A JSON-serialized object for a new media content of the message */
2508
+ media?: InputMedia
2509
+ /** A JSON-serialized object for a new inline keyboard. */
2510
+ reply_markup?: InlineKeyboardMarkup
2511
+ }
2512
+
2513
+ export interface EditMessageReplyMarkupPayload {
2514
+ /** Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2515
+ chat_id?: Integer | string
2516
+ /** Required if inline_message_id is not specified. Identifier of the message to edit */
2517
+ message_id?: Integer
2518
+ /** Required if chat_id and message_id are not specified. Identifier of the inline message */
2519
+ inline_message_id?: string
2520
+ /** A JSON-serialized object for an inline keyboard. */
2521
+ reply_markup?: InlineKeyboardMarkup
2522
+ }
2523
+
2524
+ export interface StopPollPayload {
2525
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2526
+ chat_id?: Integer | string
2527
+ /** Identifier of the original message with the poll */
2528
+ message_id?: Integer
2529
+ /** A JSON-serialized object for a new message inline keyboard. */
2530
+ reply_markup?: InlineKeyboardMarkup
2531
+ }
2532
+
2533
+ export interface DeleteMessagePayload {
2534
+ /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */
2535
+ chat_id?: Integer | string
2536
+ /** Identifier of the message to delete */
2537
+ message_id?: Integer
2538
+ }
2539
+
2540
+ declare module './internal.ts' {
2541
+ export interface Internal {
2542
+ /**
2543
+ * A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.
2544
+ * @see https://core.telegram.org/bots/api#getme
2545
+ */
2546
+ getMe(): Promise<User>
2547
+ /**
2548
+ * Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
2549
+ * @see https://core.telegram.org/bots/api#logout
2550
+ */
2551
+ logOut(): Promise<boolean>
2552
+ /**
2553
+ * Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
2554
+ * @see https://core.telegram.org/bots/api#close
2555
+ */
2556
+ close(): Promise<boolean>
2557
+ /**
2558
+ * Use this method to send text messages. On success, the sent Message is returned.
2559
+ * @see https://core.telegram.org/bots/api#sendmessage
2560
+ */
2561
+ sendMessage(payload: SendMessagePayload): Promise<Message>
2562
+ /**
2563
+ * Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.
2564
+ * @see https://core.telegram.org/bots/api#forwardmessage
2565
+ */
2566
+ forwardMessage(payload: ForwardMessagePayload): Promise<Message>
2567
+ /**
2568
+ * Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
2569
+ * @see https://core.telegram.org/bots/api#copymessage
2570
+ */
2571
+ copyMessage(payload: CopyMessagePayload): Promise<Integer>
2572
+ /**
2573
+ * Use this method to send photos. On success, the sent Message is returned.
2574
+ * @see https://core.telegram.org/bots/api#sendphoto
2575
+ */
2576
+ sendPhoto(payload: SendPhotoPayload): Promise<Message>
2577
+ /**
2578
+ * 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.
2579
+ *
2580
+ * For sending voice messages, use the sendVoice method instead.
2581
+ * @see https://core.telegram.org/bots/api#sendaudio
2582
+ */
2583
+ sendAudio(payload: SendAudioPayload): Promise<Message>
2584
+ /**
2585
+ * Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
2586
+ * @see https://core.telegram.org/bots/api#senddocument
2587
+ */
2588
+ sendDocument(payload: SendDocumentPayload): Promise<Message>
2589
+ /**
2590
+ * Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
2591
+ * @see https://core.telegram.org/bots/api#sendvideo
2592
+ */
2593
+ sendVideo(payload: SendVideoPayload): Promise<Message>
2594
+ /**
2595
+ * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
2596
+ * @see https://core.telegram.org/bots/api#sendanimation
2597
+ */
2598
+ sendAnimation(payload: SendAnimationPayload): Promise<Message>
2599
+ /**
2600
+ * Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
2601
+ * @see https://core.telegram.org/bots/api#sendvoice
2602
+ */
2603
+ sendVoice(payload: SendVoicePayload): Promise<Message>
2604
+ /**
2605
+ * As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
2606
+ * @see https://core.telegram.org/bots/api#sendvideonote
2607
+ */
2608
+ sendVideoNote(payload: SendVideoNotePayload): Promise<Message>
2609
+ /**
2610
+ * Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.
2611
+ * @see https://core.telegram.org/bots/api#sendmediagroup
2612
+ */
2613
+ sendMediaGroup(payload: SendMediaGroupPayload): Promise<Message[]>
2614
+ /**
2615
+ * Use this method to send point on the map. On success, the sent Message is returned.
2616
+ * @see https://core.telegram.org/bots/api#sendlocation
2617
+ */
2618
+ sendLocation(payload: SendLocationPayload): Promise<Message>
2619
+ /**
2620
+ * Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
2621
+ * @see https://core.telegram.org/bots/api#editmessagelivelocation
2622
+ */
2623
+ editMessageLiveLocation(payload: EditMessageLiveLocationPayload): Promise<Message | boolean>
2624
+ /**
2625
+ * Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.
2626
+ * @see https://core.telegram.org/bots/api#stopmessagelivelocation
2627
+ */
2628
+ stopMessageLiveLocation(payload: StopMessageLiveLocationPayload): Promise<Message | boolean>
2629
+ /**
2630
+ * Use this method to send information about a venue. On success, the sent Message is returned.
2631
+ * @see https://core.telegram.org/bots/api#sendvenue
2632
+ */
2633
+ sendVenue(payload: SendVenuePayload): Promise<Message>
2634
+ /**
2635
+ * Use this method to send phone contacts. On success, the sent Message is returned.
2636
+ * @see https://core.telegram.org/bots/api#sendcontact
2637
+ */
2638
+ sendContact(payload: SendContactPayload): Promise<Message>
2639
+ /**
2640
+ * Use this method to send a native poll. On success, the sent Message is returned.
2641
+ * @see https://core.telegram.org/bots/api#sendpoll
2642
+ */
2643
+ sendPoll(payload: SendPollPayload): Promise<Message>
2644
+ /**
2645
+ * Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
2646
+ * @see https://core.telegram.org/bots/api#senddice
2647
+ */
2648
+ sendDice(payload: SendDicePayload): Promise<Message>
2649
+ /**
2650
+ * Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
2651
+ *
2652
+ * Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of "Retrieving image, please wait...", the bot may use sendChatAction with action = upload_photo. The user will see a "sending photo" status for the bot.
2653
+ *
2654
+ * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
2655
+ * @see https://core.telegram.org/bots/api#sendchataction
2656
+ */
2657
+ sendChatAction(payload: SendChatActionPayload): Promise<boolean>
2658
+ /**
2659
+ * Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
2660
+ * @see https://core.telegram.org/bots/api#getuserprofilephotos
2661
+ */
2662
+ getUserProfilePhotos(payload: GetUserProfilePhotosPayload): Promise<UserProfilePhotos>
2663
+ /**
2664
+ * Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. 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 again.
2665
+ * @see https://core.telegram.org/bots/api#getfile
2666
+ */
2667
+ getFile(payload: GetFilePayload): Promise<File>
2668
+ /**
2669
+ * Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
2670
+ * @see https://core.telegram.org/bots/api#banchatmember
2671
+ */
2672
+ banChatMember(payload: BanChatMemberPayload): Promise<boolean>
2673
+ /**
2674
+ * Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.
2675
+ * @see https://core.telegram.org/bots/api#unbanchatmember
2676
+ */
2677
+ unbanChatMember(payload: UnbanChatMemberPayload): Promise<boolean>
2678
+ /**
2679
+ * Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
2680
+ * @see https://core.telegram.org/bots/api#restrictchatmember
2681
+ */
2682
+ restrictChatMember(payload: RestrictChatMemberPayload): Promise<boolean>
2683
+ /**
2684
+ * Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.
2685
+ * @see https://core.telegram.org/bots/api#promotechatmember
2686
+ */
2687
+ promoteChatMember(payload: PromoteChatMemberPayload): Promise<boolean>
2688
+ /**
2689
+ * Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
2690
+ * @see https://core.telegram.org/bots/api#setchatadministratorcustomtitle
2691
+ */
2692
+ setChatAdministratorCustomTitle(payload: SetChatAdministratorCustomTitlePayload): Promise<boolean>
2693
+ /**
2694
+ * Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.
2695
+ * @see https://core.telegram.org/bots/api#banchatsenderchat
2696
+ */
2697
+ banChatSenderChat(payload: BanChatSenderChatPayload): Promise<boolean>
2698
+ /**
2699
+ * Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.
2700
+ * @see https://core.telegram.org/bots/api#unbanchatsenderchat
2701
+ */
2702
+ unbanChatSenderChat(payload: UnbanChatSenderChatPayload): Promise<boolean>
2703
+ /**
2704
+ * Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.
2705
+ * @see https://core.telegram.org/bots/api#setchatpermissions
2706
+ */
2707
+ setChatPermissions(payload: SetChatPermissionsPayload): Promise<boolean>
2708
+ /**
2709
+ * Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.
2710
+ * @see https://core.telegram.org/bots/api#exportchatinvitelink
2711
+ */
2712
+ exportChatInviteLink(payload: ExportChatInviteLinkPayload): Promise<string>
2713
+ /**
2714
+ * Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.
2715
+ * @see https://core.telegram.org/bots/api#createchatinvitelink
2716
+ */
2717
+ createChatInviteLink(payload: CreateChatInviteLinkPayload): Promise<ChatInviteLink>
2718
+ /**
2719
+ * Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.
2720
+ * @see https://core.telegram.org/bots/api#editchatinvitelink
2721
+ */
2722
+ editChatInviteLink(payload: EditChatInviteLinkPayload): Promise<ChatInviteLink>
2723
+ /**
2724
+ * Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.
2725
+ * @see https://core.telegram.org/bots/api#revokechatinvitelink
2726
+ */
2727
+ revokeChatInviteLink(payload: RevokeChatInviteLinkPayload): Promise<ChatInviteLink>
2728
+ /**
2729
+ * Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
2730
+ * @see https://core.telegram.org/bots/api#approvechatjoinrequest
2731
+ */
2732
+ approveChatJoinRequest(payload: ApproveChatJoinRequestPayload): Promise<boolean>
2733
+ /**
2734
+ * Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.
2735
+ * @see https://core.telegram.org/bots/api#declinechatjoinrequest
2736
+ */
2737
+ declineChatJoinRequest(payload: DeclineChatJoinRequestPayload): Promise<boolean>
2738
+ /**
2739
+ * Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
2740
+ * @see https://core.telegram.org/bots/api#setchatphoto
2741
+ */
2742
+ setChatPhoto(payload: SetChatPhotoPayload): Promise<boolean>
2743
+ /**
2744
+ * Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
2745
+ * @see https://core.telegram.org/bots/api#deletechatphoto
2746
+ */
2747
+ deleteChatPhoto(payload: DeleteChatPhotoPayload): Promise<boolean>
2748
+ /**
2749
+ * Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
2750
+ * @see https://core.telegram.org/bots/api#setchattitle
2751
+ */
2752
+ setChatTitle(payload: SetChatTitlePayload): Promise<boolean>
2753
+ /**
2754
+ * Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.
2755
+ * @see https://core.telegram.org/bots/api#setchatdescription
2756
+ */
2757
+ setChatDescription(payload: SetChatDescriptionPayload): Promise<boolean>
2758
+ /**
2759
+ * Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
2760
+ * @see https://core.telegram.org/bots/api#pinchatmessage
2761
+ */
2762
+ pinChatMessage(payload: PinChatMessagePayload): Promise<boolean>
2763
+ /**
2764
+ * Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
2765
+ * @see https://core.telegram.org/bots/api#unpinchatmessage
2766
+ */
2767
+ unpinChatMessage(payload: UnpinChatMessagePayload): Promise<boolean>
2768
+ /**
2769
+ * Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
2770
+ * @see https://core.telegram.org/bots/api#unpinallchatmessages
2771
+ */
2772
+ unpinAllChatMessages(payload: UnpinAllChatMessagesPayload): Promise<boolean>
2773
+ /**
2774
+ * Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
2775
+ * @see https://core.telegram.org/bots/api#leavechat
2776
+ */
2777
+ leaveChat(payload: LeaveChatPayload): Promise<boolean>
2778
+ /**
2779
+ * Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
2780
+ * @see https://core.telegram.org/bots/api#getchat
2781
+ */
2782
+ getChat(payload: GetChatPayload): Promise<Chat>
2783
+ /**
2784
+ * Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
2785
+ * @see https://core.telegram.org/bots/api#getchatadministrators
2786
+ */
2787
+ getChatAdministrators(payload: GetChatAdministratorsPayload): Promise<ChatMember[]>
2788
+ /**
2789
+ * Use this method to get the number of members in a chat. Returns Int on success.
2790
+ * @see https://core.telegram.org/bots/api#getchatmembercount
2791
+ */
2792
+ getChatMemberCount(payload: GetChatMemberCountPayload): Promise<Integer>
2793
+ /**
2794
+ * Use this method to get information about a member of a chat. Returns a ChatMember object on success.
2795
+ * @see https://core.telegram.org/bots/api#getchatmember
2796
+ */
2797
+ getChatMember(payload: GetChatMemberPayload): Promise<ChatMember>
2798
+ /**
2799
+ * Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
2800
+ * @see https://core.telegram.org/bots/api#setchatstickerset
2801
+ */
2802
+ setChatStickerSet(payload: SetChatStickerSetPayload): Promise<boolean>
2803
+ /**
2804
+ * Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
2805
+ * @see https://core.telegram.org/bots/api#deletechatstickerset
2806
+ */
2807
+ deleteChatStickerSet(payload: DeleteChatStickerSetPayload): Promise<boolean>
2808
+ /**
2809
+ * Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.
2810
+ * @see https://core.telegram.org/bots/api#getforumtopiciconstickers
2811
+ */
2812
+ getForumTopicIconStickers(): Promise<Sticker[]>
2813
+ /**
2814
+ * Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.
2815
+ * @see https://core.telegram.org/bots/api#createforumtopic
2816
+ */
2817
+ createForumTopic(payload: CreateForumTopicPayload): Promise<ForumTopic>
2818
+ /**
2819
+ * Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
2820
+ * @see https://core.telegram.org/bots/api#editforumtopic
2821
+ */
2822
+ editForumTopic(payload: EditForumTopicPayload): Promise<boolean>
2823
+ /**
2824
+ * Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
2825
+ * @see https://core.telegram.org/bots/api#closeforumtopic
2826
+ */
2827
+ closeForumTopic(payload: CloseForumTopicPayload): Promise<boolean>
2828
+ /**
2829
+ * Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.
2830
+ * @see https://core.telegram.org/bots/api#reopenforumtopic
2831
+ */
2832
+ reopenForumTopic(payload: ReopenForumTopicPayload): Promise<boolean>
2833
+ /**
2834
+ * Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.
2835
+ * @see https://core.telegram.org/bots/api#deleteforumtopic
2836
+ */
2837
+ deleteForumTopic(payload: DeleteForumTopicPayload): Promise<boolean>
2838
+ /**
2839
+ * Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.
2840
+ * @see https://core.telegram.org/bots/api#unpinallforumtopicmessages
2841
+ */
2842
+ unpinAllForumTopicMessages(payload: UnpinAllChatMessagesPayload): Promise<boolean>
2843
+ /**
2844
+ * Use this method to edit the name of the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.
2845
+ * @see https://core.telegram.org/bots/api#editgeneralforumtopic
2846
+ */
2847
+ editGeneralForumTopic(payload: EditGeneralForumTopicPayload): Promise<boolean>
2848
+ /**
2849
+ * Use this method to close an open 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
2850
+ * @see https://core.telegram.org/bots/api#closegeneralforumtopic
2851
+ */
2852
+ closeGeneralForumTopic(payload: CloseGeneralForumTopicPayload): Promise<boolean>
2853
+ /**
2854
+ * Use this method to reopen a closed 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.
2855
+ * @see https://core.telegram.org/bots/api#reopengeneralforumtopic
2856
+ */
2857
+ reopenGeneralForumTopic(payload: ReopenForumTopicPayload): Promise<boolean>
2858
+ /**
2859
+ * Use this method to hide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.
2860
+ * @see https://core.telegram.org/bots/api#hidegeneralforumtopic
2861
+ */
2862
+ hideGeneralForumTopic(payload: HideGeneralForumTopicPayload): Promise<boolean>
2863
+ /**
2864
+ * Use this method to unhide the 'General' topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.
2865
+ * @see https://core.telegram.org/bots/api#unhidegeneralforumtopic
2866
+ */
2867
+ unhideGeneralForumTopic(payload: UnhideGeneralForumTopicPaylad): Promise<boolean>
2868
+ /**
2869
+ * Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
2870
+ *
2871
+ * Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
2872
+ * @see https://core.telegram.org/bots/api#answercallbackquery
2873
+ */
2874
+ answerCallbackQuery(payload: AnswerCallbackQueryPayload): Promise<boolean>
2875
+ /**
2876
+ * Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.
2877
+ * @see https://core.telegram.org/bots/api#setmycommands
2878
+ */
2879
+ setMyCommands(payload: SetMyCommandsPayload): Promise<boolean>
2880
+ /**
2881
+ * Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.
2882
+ * @see https://core.telegram.org/bots/api#deletemycommands
2883
+ */
2884
+ deleteMyCommands(payload: DeleteMyCommandsPayload): Promise<boolean>
2885
+ /**
2886
+ * Use this method to get the current list of the bot's commands for the given scope and user language. Returns BotCommand on success. If commands aren't set, an empty list is returned.
2887
+ * @see https://core.telegram.org/bots/api#getmycommands
2888
+ */
2889
+ getMyCommands(payload: GetMyCommandsPayload): Promise<BotCommand[]>
2890
+ /**
2891
+ * Use this method to change the bot's menu button in a private chat, or the default menu button. Returns True on success.
2892
+ * @see https://core.telegram.org/bots/api#setchatmenubutton
2893
+ */
2894
+ setChatMenuButton(payload: SetChatMenuButtonPayload): Promise<boolean>
2895
+ /**
2896
+ * Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.
2897
+ * @see https://core.telegram.org/bots/api#getchatmenubutton
2898
+ */
2899
+ getChatMenuButton(payload: GetChatMenuButtonPayload): Promise<MenuButton>
2900
+ /**
2901
+ * Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns True on success.
2902
+ * @see https://core.telegram.org/bots/api#setmydefaultadministratorrights
2903
+ */
2904
+ setMyDefaultAdministratorRights(payload: SetMyDefaultAdministratorRightsPayload): Promise<boolean>
2905
+ /**
2906
+ * Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.
2907
+ * @see https://core.telegram.org/bots/api#getmydefaultadministratorrights
2908
+ */
2909
+ getMyDefaultAdministratorRights(payload: GetMyDefaultAdministratorRightsPayload): Promise<ChatAdministratorRights>
2910
+ /**
2911
+ * Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
2912
+ * @see https://core.telegram.org/bots/api#editmessagetext
2913
+ */
2914
+ editMessageText(payload: EditMessageTextPayload): Promise<Message | boolean>
2915
+ /**
2916
+ * Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
2917
+ * @see https://core.telegram.org/bots/api#editmessagecaption
2918
+ */
2919
+ editMessageCaption(payload: EditMessageCaptionPayload): Promise<Message | boolean>
2920
+ /**
2921
+ * Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
2922
+ * @see https://core.telegram.org/bots/api#editmessagemedia
2923
+ */
2924
+ editMessageMedia(payload: EditMessageMediaPayload): Promise<Message | boolean>
2925
+ /**
2926
+ * Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
2927
+ * @see https://core.telegram.org/bots/api#editmessagereplymarkup
2928
+ */
2929
+ editMessageReplyMarkup(payload: EditMessageReplyMarkupPayload): Promise<Message | boolean>
2930
+ /**
2931
+ * Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.
2932
+ * @see https://core.telegram.org/bots/api#stoppoll
2933
+ */
2934
+ stopPoll(payload: StopPollPayload): Promise<Poll>
2935
+ /**
2936
+ * Use this method to delete a message, including service messages, with the following limitations:
2937
+ * - A message can only be deleted if it was sent less than 48 hours ago.
2938
+ * - A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
2939
+ * - Bots can delete outgoing messages in private chats, groups, and supergroups.
2940
+ * - Bots can delete incoming messages in private chats.
2941
+ * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
2942
+ * - If the bot is an administrator of a group, it can delete any message there.
2943
+ * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
2944
+ * Returns True on success.
2945
+ * @see https://core.telegram.org/bots/api#deletemessage
2946
+ */
2947
+ deleteMessage(payload: DeleteMessagePayload): Promise<boolean>
2948
+ }
2949
+ }
2950
+
2951
+ Internal.define('getMe')
2952
+ Internal.define('logOut')
2953
+ Internal.define('close')
2954
+ Internal.define('sendMessage')
2955
+ Internal.define('forwardMessage')
2956
+ Internal.define('copyMessage')
2957
+ Internal.define('sendPhoto')
2958
+ Internal.define('sendAudio')
2959
+ Internal.define('sendDocument')
2960
+ Internal.define('sendVideo')
2961
+ Internal.define('sendAnimation')
2962
+ Internal.define('sendVoice')
2963
+ Internal.define('sendVideoNote')
2964
+ Internal.define('sendMediaGroup')
2965
+ Internal.define('sendLocation')
2966
+ Internal.define('editMessageLiveLocation')
2967
+ Internal.define('stopMessageLiveLocation')
2968
+ Internal.define('sendVenue')
2969
+ Internal.define('sendContact')
2970
+ Internal.define('sendPoll')
2971
+ Internal.define('sendDice')
2972
+ Internal.define('sendChatAction')
2973
+ Internal.define('getUserProfilePhotos')
2974
+ Internal.define('getFile')
2975
+ Internal.define('banChatMember')
2976
+ Internal.define('unbanChatMember')
2977
+ Internal.define('restrictChatMember')
2978
+ Internal.define('promoteChatMember')
2979
+ Internal.define('setChatAdministratorCustomTitle')
2980
+ Internal.define('banChatSenderChat')
2981
+ Internal.define('unbanChatSenderChat')
2982
+ Internal.define('setChatPermissions')
2983
+ Internal.define('exportChatInviteLink')
2984
+ Internal.define('createChatInviteLink')
2985
+ Internal.define('editChatInviteLink')
2986
+ Internal.define('revokeChatInviteLink')
2987
+ Internal.define('approveChatJoinRequest')
2988
+ Internal.define('declineChatJoinRequest')
2989
+ Internal.define('setChatPhoto')
2990
+ Internal.define('deleteChatPhoto')
2991
+ Internal.define('setChatTitle')
2992
+ Internal.define('setChatDescription')
2993
+ Internal.define('pinChatMessage')
2994
+ Internal.define('unpinChatMessage')
2995
+ Internal.define('unpinAllChatMessages')
2996
+ Internal.define('leaveChat')
2997
+ Internal.define('getChat')
2998
+ Internal.define('getChatAdministrators')
2999
+ Internal.define('getChatMemberCount')
3000
+ Internal.define('getChatMember')
3001
+ Internal.define('setChatStickerSet')
3002
+ Internal.define('deleteChatStickerSet')
3003
+ Internal.define('getForumTopicIconStickers')
3004
+ Internal.define('createForumTopic')
3005
+ Internal.define('editForumTopic')
3006
+ Internal.define('closeForumTopic')
3007
+ Internal.define('reopenForumTopic')
3008
+ Internal.define('deleteForumTopic')
3009
+ Internal.define('unpinAllForumTopicMessages')
3010
+ Internal.define('editGeneralForumTopic')
3011
+ Internal.define('closeGeneralForumTopic')
3012
+ Internal.define('reopenGeneralForumTopic')
3013
+ Internal.define('hideGeneralForumTopic')
3014
+ Internal.define('unhideGeneralForumTopic')
3015
+ Internal.define('answerCallbackQuery')
3016
+ Internal.define('setMyCommands')
3017
+ Internal.define('deleteMyCommands')
3018
+ Internal.define('getMyCommands')
3019
+ Internal.define('setChatMenuButton')
3020
+ Internal.define('getChatMenuButton')
3021
+ Internal.define('setMyDefaultAdministratorRights')
3022
+ Internal.define('getMyDefaultAdministratorRights')
3023
+ Internal.define('editMessageText')
3024
+ Internal.define('editMessageCaption')
3025
+ Internal.define('editMessageMedia')
3026
+ Internal.define('editMessageReplyMarkup')
3027
+ Internal.define('stopPoll')
3028
+ Internal.define('deleteMessage')