@grom.js/effect-tg 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Bot.d.ts +13 -0
- package/dist/Bot.d.ts.map +1 -0
- package/dist/Bot.js +5 -0
- package/dist/Bot.js.map +1 -0
- package/dist/BotApi.d.ts +12 -3
- package/dist/BotApi.d.ts.map +1 -1
- package/dist/BotApi.js +7 -2
- package/dist/BotApi.js.map +1 -0
- package/dist/BotApiTransport.d.ts +11 -10
- package/dist/BotApiTransport.d.ts.map +1 -1
- package/dist/BotApiTransport.js +6 -8
- package/dist/BotApiTransport.js.map +1 -0
- package/dist/BotApiUrl.d.ts +14 -0
- package/dist/BotApiUrl.d.ts.map +1 -0
- package/dist/BotApiUrl.js +13 -0
- package/dist/BotApiUrl.js.map +1 -0
- package/dist/Content.d.ts +288 -16
- package/dist/Content.d.ts.map +1 -1
- package/dist/Content.js +189 -28
- package/dist/Content.js.map +1 -0
- package/dist/Dialog.d.ts +61 -0
- package/dist/Dialog.d.ts.map +1 -0
- package/dist/Dialog.js +35 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/File.d.ts +23 -0
- package/dist/File.d.ts.map +1 -0
- package/dist/File.js +24 -0
- package/dist/File.js.map +1 -0
- package/dist/LinkPreview.d.ts +2 -2
- package/dist/LinkPreview.d.ts.map +1 -1
- package/dist/LinkPreview.js +17 -16
- package/dist/LinkPreview.js.map +1 -0
- package/dist/Markup.d.ts +41 -0
- package/dist/Markup.d.ts.map +1 -0
- package/dist/Markup.js +10 -0
- package/dist/Markup.js.map +1 -0
- package/dist/Runner.d.ts +18 -0
- package/dist/Runner.d.ts.map +1 -0
- package/dist/Runner.js +7 -0
- package/dist/Runner.js.map +1 -0
- package/dist/Send.d.ts +177 -13
- package/dist/Send.d.ts.map +1 -1
- package/dist/Send.js +187 -18
- package/dist/Send.js.map +1 -0
- package/dist/Text.d.ts +26 -10
- package/dist/Text.d.ts.map +1 -1
- package/dist/Text.js +11 -12
- package/dist/Text.js.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -0
- package/dist/internal/botApi.d.ts +3 -4
- package/dist/internal/botApi.d.ts.map +1 -1
- package/dist/internal/botApi.js +18 -22
- package/dist/internal/botApi.js.map +1 -0
- package/dist/internal/botApiMethods.gen.d.ts +19 -19
- package/dist/internal/botApiMethods.gen.d.ts.map +1 -1
- package/dist/internal/botApiMethods.gen.js +1 -0
- package/dist/internal/botApiMethods.gen.js.map +1 -0
- package/dist/internal/botApiShape.gen.d.ts +159 -159
- package/dist/internal/botApiShape.gen.d.ts.map +1 -1
- package/dist/internal/botApiShape.gen.js +1 -0
- package/dist/internal/botApiShape.gen.js.map +1 -0
- package/dist/internal/botApiTransport.d.ts +4 -6
- package/dist/internal/botApiTransport.d.ts.map +1 -1
- package/dist/internal/botApiTransport.js +89 -17
- package/dist/internal/botApiTransport.js.map +1 -0
- package/dist/internal/botApiTypes.gen.js +1 -0
- package/dist/internal/botApiTypes.gen.js.map +1 -0
- package/dist/internal/dialog.d.ts +12 -0
- package/dist/internal/dialog.d.ts.map +1 -0
- package/dist/internal/dialog.js +19 -0
- package/dist/internal/dialog.js.map +1 -0
- package/dist/internal/runner.d.ts +8 -0
- package/dist/internal/runner.d.ts.map +1 -0
- package/dist/internal/runner.js +38 -0
- package/dist/internal/runner.js.map +1 -0
- package/dist/internal/send.d.ts +13 -0
- package/dist/internal/send.d.ts.map +1 -0
- package/dist/internal/send.js +220 -0
- package/dist/internal/send.js.map +1 -0
- package/package.json +14 -10
- package/src/Bot.ts +16 -0
- package/src/BotApi.ts +68 -0
- package/src/BotApiTransport.ts +55 -0
- package/src/BotApiUrl.ts +28 -0
- package/src/Content.ts +410 -0
- package/src/Dialog.ts +54 -0
- package/src/File.ts +45 -0
- package/src/LinkPreview.ts +26 -0
- package/src/Markup.ts +33 -0
- package/src/Runner.ts +22 -0
- package/src/Send.ts +330 -0
- package/src/Text.ts +42 -0
- package/src/index.ts +12 -0
- package/src/internal/botApi.ts +31 -0
- package/src/internal/botApiMethods.gen.ts +2027 -0
- package/src/internal/botApiShape.gen.ts +398 -0
- package/src/internal/botApiTransport.ts +118 -0
- package/src/internal/botApiTypes.gen.ts +4178 -0
- package/src/internal/dialog.ts +33 -0
- package/src/internal/runner.ts +57 -0
- package/src/internal/send.ts +318 -0
- package/dist/BotApiWebhook.d.ts +0 -41
- package/dist/BotApiWebhook.d.ts.map +0 -1
- package/dist/BotApiWebhook.js +0 -43
- package/dist/Chat.d.ts +0 -96
- package/dist/Chat.d.ts.map +0 -1
- package/dist/Chat.js +0 -48
- package/dist/InputFile.d.ts +0 -4
- package/dist/InputFile.d.ts.map +0 -1
- package/dist/InputFile.js +0 -3
- package/dist/internal/botApiMethod.d.ts +0 -8
- package/dist/internal/botApiMethod.d.ts.map +0 -1
- package/dist/internal/botApiMethod.js +0 -1
- package/dist/internal/chat.d.ts +0 -14
- package/dist/internal/chat.d.ts.map +0 -1
- package/dist/internal/chat.js +0 -20
|
@@ -0,0 +1,4178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This [object](https://core.telegram.org/bots/api#available-types) represents an incoming update.
|
|
3
|
+
*
|
|
4
|
+
* At most **one** of the optional parameters can be present in any given update.
|
|
5
|
+
*/
|
|
6
|
+
export interface Update {
|
|
7
|
+
/** The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using [webhooks](https://core.telegram.org/bots/api#setwebhook), since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. */
|
|
8
|
+
update_id: number
|
|
9
|
+
/** New incoming message of any kind - text, photo, sticker, etc. */
|
|
10
|
+
message?: Message
|
|
11
|
+
/** New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. */
|
|
12
|
+
edited_message?: Message
|
|
13
|
+
/** New incoming channel post of any kind - text, photo, sticker, etc. */
|
|
14
|
+
channel_post?: Message
|
|
15
|
+
/** New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot. */
|
|
16
|
+
edited_channel_post?: Message
|
|
17
|
+
/** The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot */
|
|
18
|
+
business_connection?: BusinessConnection
|
|
19
|
+
/** New message from a connected business account */
|
|
20
|
+
business_message?: Message
|
|
21
|
+
/** New version of a message from a connected business account */
|
|
22
|
+
edited_business_message?: Message
|
|
23
|
+
/** Messages were deleted from a connected business account */
|
|
24
|
+
deleted_business_messages?: BusinessMessagesDeleted
|
|
25
|
+
/** A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify `"message_reaction"` in the list of _allowed\_updates_ to receive these updates. The update isn't received for reactions set by bots. */
|
|
26
|
+
message_reaction?: MessageReactionUpdated
|
|
27
|
+
/** Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify `"message_reaction_count"` in the list of _allowed\_updates_ to receive these updates. The updates are grouped and can be sent with delay up to a few minutes. */
|
|
28
|
+
message_reaction_count?: MessageReactionCountUpdated
|
|
29
|
+
/** New incoming [inline](https://core.telegram.org/bots/api#inline-mode) query */
|
|
30
|
+
inline_query?: InlineQuery
|
|
31
|
+
/** The result of an [inline](https://core.telegram.org/bots/api#inline-mode) query that was chosen by a user and sent to their chat partner. Please see our documentation on the [feedback collecting](https://core.telegram.org/bots/inline#collecting-feedback) for details on how to enable these updates for your bot. */
|
|
32
|
+
chosen_inline_result?: ChosenInlineResult
|
|
33
|
+
/** New incoming callback query */
|
|
34
|
+
callback_query?: CallbackQuery
|
|
35
|
+
/** New incoming shipping query. Only for invoices with flexible price */
|
|
36
|
+
shipping_query?: ShippingQuery
|
|
37
|
+
/** New incoming pre-checkout query. Contains full information about checkout */
|
|
38
|
+
pre_checkout_query?: PreCheckoutQuery
|
|
39
|
+
/** A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat */
|
|
40
|
+
purchased_paid_media?: PaidMediaPurchased
|
|
41
|
+
/** New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot */
|
|
42
|
+
poll?: Poll
|
|
43
|
+
/** A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. */
|
|
44
|
+
poll_answer?: PollAnswer
|
|
45
|
+
/** 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. */
|
|
46
|
+
my_chat_member?: ChatMemberUpdated
|
|
47
|
+
/** 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. */
|
|
48
|
+
chat_member?: ChatMemberUpdated
|
|
49
|
+
/** 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. */
|
|
50
|
+
chat_join_request?: ChatJoinRequest
|
|
51
|
+
/** A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates. */
|
|
52
|
+
chat_boost?: ChatBoostUpdated
|
|
53
|
+
/** A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates. */
|
|
54
|
+
removed_chat_boost?: ChatBoostRemoved
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Describes the current status of a webhook. */
|
|
58
|
+
export interface WebhookInfo {
|
|
59
|
+
/** Webhook URL, may be empty if webhook is not set up */
|
|
60
|
+
url: string
|
|
61
|
+
/** _True_, if a custom certificate was provided for webhook certificate checks */
|
|
62
|
+
has_custom_certificate: boolean
|
|
63
|
+
/** Number of updates awaiting delivery */
|
|
64
|
+
pending_update_count: number
|
|
65
|
+
/** Currently used webhook IP address */
|
|
66
|
+
ip_address?: string
|
|
67
|
+
/** Unix time for the most recent error that happened when trying to deliver an update via webhook */
|
|
68
|
+
last_error_date?: number
|
|
69
|
+
/** Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */
|
|
70
|
+
last_error_message?: string
|
|
71
|
+
/** Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */
|
|
72
|
+
last_synchronization_error_date?: number
|
|
73
|
+
/** The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */
|
|
74
|
+
max_connections?: number
|
|
75
|
+
/** A list of update types the bot is subscribed to. Defaults to all update types except _chat\_member_ */
|
|
76
|
+
allowed_updates?: Array<string>
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** This object represents a Telegram user or bot. */
|
|
80
|
+
export interface User {
|
|
81
|
+
/** Unique identifier for this user or bot. */
|
|
82
|
+
id: number
|
|
83
|
+
/** _True_, if this user is a bot */
|
|
84
|
+
is_bot: boolean
|
|
85
|
+
/** User's or bot's first name */
|
|
86
|
+
first_name: string
|
|
87
|
+
/** User's or bot's last name */
|
|
88
|
+
last_name?: string
|
|
89
|
+
/** User's or bot's username */
|
|
90
|
+
username?: string
|
|
91
|
+
/** [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the user's language */
|
|
92
|
+
language_code?: string
|
|
93
|
+
/** _True_, if this user is a Telegram Premium user */
|
|
94
|
+
is_premium?: true
|
|
95
|
+
/** _True_, if this user added the bot to the attachment menu */
|
|
96
|
+
added_to_attachment_menu?: true
|
|
97
|
+
/** _True_, if the bot can be invited to groups. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
|
|
98
|
+
can_join_groups?: boolean
|
|
99
|
+
/** _True_, if [privacy mode](https://core.telegram.org/bots/features#privacy-mode) is disabled for the bot. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
|
|
100
|
+
can_read_all_group_messages?: boolean
|
|
101
|
+
/** _True_, if the bot supports inline queries. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
|
|
102
|
+
supports_inline_queries?: boolean
|
|
103
|
+
/** _True_, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
|
|
104
|
+
can_connect_to_business?: boolean
|
|
105
|
+
/** _True_, if the bot has a main Web App. Returned only in [getMe](https://core.telegram.org/bots/api#getme). */
|
|
106
|
+
has_main_web_app?: boolean
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** This object represents a chat. */
|
|
110
|
+
export interface Chat {
|
|
111
|
+
/** Unique identifier for this chat. */
|
|
112
|
+
id: number
|
|
113
|
+
/** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
|
|
114
|
+
type: string
|
|
115
|
+
/** Title, for supergroups, channels and group chats */
|
|
116
|
+
title?: string
|
|
117
|
+
/** Username, for private chats, supergroups and channels if available */
|
|
118
|
+
username?: string
|
|
119
|
+
/** First name of the other party in a private chat */
|
|
120
|
+
first_name?: string
|
|
121
|
+
/** Last name of the other party in a private chat */
|
|
122
|
+
last_name?: string
|
|
123
|
+
/** _True_, if the supergroup chat is a forum (has [topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups) enabled) */
|
|
124
|
+
is_forum?: true
|
|
125
|
+
/** _True_, if the chat is the direct messages chat of a channel */
|
|
126
|
+
is_direct_messages?: true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** This object contains full information about a chat. */
|
|
130
|
+
export interface ChatFullInfo {
|
|
131
|
+
/** Unique identifier for this chat. */
|
|
132
|
+
id: number
|
|
133
|
+
/** Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */
|
|
134
|
+
type: string
|
|
135
|
+
/** Title, for supergroups, channels and group chats */
|
|
136
|
+
title?: string
|
|
137
|
+
/** Username, for private chats, supergroups and channels if available */
|
|
138
|
+
username?: string
|
|
139
|
+
/** First name of the other party in a private chat */
|
|
140
|
+
first_name?: string
|
|
141
|
+
/** Last name of the other party in a private chat */
|
|
142
|
+
last_name?: string
|
|
143
|
+
/** _True_, if the supergroup chat is a forum (has [topics](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups) enabled) */
|
|
144
|
+
is_forum?: true
|
|
145
|
+
/** _True_, if the chat is the direct messages chat of a channel */
|
|
146
|
+
is_direct_messages?: true
|
|
147
|
+
/** Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See [accent colors](https://core.telegram.org/bots/api#accent-colors) for more details. */
|
|
148
|
+
accent_color_id: number
|
|
149
|
+
/** The maximum number of reactions that can be set on a message in the chat */
|
|
150
|
+
max_reaction_count: number
|
|
151
|
+
/** Chat photo */
|
|
152
|
+
photo?: ChatPhoto
|
|
153
|
+
/** If non-empty, the list of all [active chat usernames](https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames); for private chats, supergroups and channels */
|
|
154
|
+
active_usernames?: Array<string>
|
|
155
|
+
/** For private chats, the date of birth of the user */
|
|
156
|
+
birthdate?: Birthdate
|
|
157
|
+
/** For private chats with business accounts, the intro of the business */
|
|
158
|
+
business_intro?: BusinessIntro
|
|
159
|
+
/** For private chats with business accounts, the location of the business */
|
|
160
|
+
business_location?: BusinessLocation
|
|
161
|
+
/** For private chats with business accounts, the opening hours of the business */
|
|
162
|
+
business_opening_hours?: BusinessOpeningHours
|
|
163
|
+
/** For private chats, the personal channel of the user */
|
|
164
|
+
personal_chat?: Chat
|
|
165
|
+
/** Information about the corresponding channel chat; for direct messages chats only */
|
|
166
|
+
parent_chat?: Chat
|
|
167
|
+
/** List of available reactions allowed in the chat. If omitted, then all [emoji reactions](https://core.telegram.org/bots/api#reactiontypeemoji) are allowed. */
|
|
168
|
+
available_reactions?: Array<ReactionType>
|
|
169
|
+
/** Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */
|
|
170
|
+
background_custom_emoji_id?: string
|
|
171
|
+
/** Identifier of the accent color for the chat's profile background. See [profile accent colors](https://core.telegram.org/bots/api#profile-accent-colors) for more details. */
|
|
172
|
+
profile_accent_color_id?: number
|
|
173
|
+
/** Custom emoji identifier of the emoji chosen by the chat for its profile background */
|
|
174
|
+
profile_background_custom_emoji_id?: string
|
|
175
|
+
/** Custom emoji identifier of the emoji status of the chat or the other party in a private chat */
|
|
176
|
+
emoji_status_custom_emoji_id?: string
|
|
177
|
+
/** Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */
|
|
178
|
+
emoji_status_expiration_date?: number
|
|
179
|
+
/** Bio of the other party in a private chat */
|
|
180
|
+
bio?: string
|
|
181
|
+
/** _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 */
|
|
182
|
+
has_private_forwards?: true
|
|
183
|
+
/** _True_, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */
|
|
184
|
+
has_restricted_voice_and_video_messages?: true
|
|
185
|
+
/** _True_, if users need to join the supergroup before they can send messages */
|
|
186
|
+
join_to_send_messages?: true
|
|
187
|
+
/** _True_, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */
|
|
188
|
+
join_by_request?: true
|
|
189
|
+
/** Description, for groups, supergroups and channel chats */
|
|
190
|
+
description?: string
|
|
191
|
+
/** Primary invite link, for groups, supergroups and channel chats */
|
|
192
|
+
invite_link?: string
|
|
193
|
+
/** The most recent pinned message (by sending date) */
|
|
194
|
+
pinned_message?: Message
|
|
195
|
+
/** Default chat member permissions, for groups and supergroups */
|
|
196
|
+
permissions?: ChatPermissions
|
|
197
|
+
/** Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */
|
|
198
|
+
accepted_gift_types: AcceptedGiftTypes
|
|
199
|
+
/** _True_, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */
|
|
200
|
+
can_send_paid_media?: true
|
|
201
|
+
/** For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */
|
|
202
|
+
slow_mode_delay?: number
|
|
203
|
+
/** For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */
|
|
204
|
+
unrestrict_boost_count?: number
|
|
205
|
+
/** The time after which all messages sent to the chat will be automatically deleted; in seconds */
|
|
206
|
+
message_auto_delete_time?: number
|
|
207
|
+
/** _True_, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */
|
|
208
|
+
has_aggressive_anti_spam_enabled?: true
|
|
209
|
+
/** _True_, if non-administrators can only get the list of bots and administrators in the chat */
|
|
210
|
+
has_hidden_members?: true
|
|
211
|
+
/** _True_, if messages from the chat can't be forwarded to other chats */
|
|
212
|
+
has_protected_content?: true
|
|
213
|
+
/** _True_, if new chat members will have access to old messages; available only to chat administrators */
|
|
214
|
+
has_visible_history?: true
|
|
215
|
+
/** For supergroups, name of the group sticker set */
|
|
216
|
+
sticker_set_name?: string
|
|
217
|
+
/** _True_, if the bot can change the group sticker set */
|
|
218
|
+
can_set_sticker_set?: true
|
|
219
|
+
/** For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. */
|
|
220
|
+
custom_emoji_sticker_set_name?: string
|
|
221
|
+
/** Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. */
|
|
222
|
+
linked_chat_id?: number
|
|
223
|
+
/** For supergroups, the location to which the supergroup is connected */
|
|
224
|
+
location?: ChatLocation
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** This object represents a message. */
|
|
228
|
+
export interface Message {
|
|
229
|
+
/** Unique message identifier inside this chat. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
|
|
230
|
+
message_id: number
|
|
231
|
+
/** Unique identifier of a message thread to which the message belongs; for supergroups only */
|
|
232
|
+
message_thread_id?: number
|
|
233
|
+
/** Information about the direct messages chat topic that contains the message */
|
|
234
|
+
direct_messages_topic?: DirectMessagesTopic
|
|
235
|
+
/** Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats */
|
|
236
|
+
from?: User
|
|
237
|
+
/** Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field _from_ contains a fake sender user in non-channel chats. */
|
|
238
|
+
sender_chat?: Chat
|
|
239
|
+
/** If the sender of the message boosted the chat, the number of boosts added by the user */
|
|
240
|
+
sender_boost_count?: number
|
|
241
|
+
/** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */
|
|
242
|
+
sender_business_bot?: User
|
|
243
|
+
/** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */
|
|
244
|
+
date: number
|
|
245
|
+
/** Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. */
|
|
246
|
+
business_connection_id?: string
|
|
247
|
+
/** Chat the message belongs to */
|
|
248
|
+
chat: Chat
|
|
249
|
+
/** Information about the original message for forwarded messages */
|
|
250
|
+
forward_origin?: MessageOrigin
|
|
251
|
+
/** _True_, if the message is sent to a forum topic */
|
|
252
|
+
is_topic_message?: true
|
|
253
|
+
/** _True_, if the message is a channel post that was automatically forwarded to the connected discussion group */
|
|
254
|
+
is_automatic_forward?: true
|
|
255
|
+
/** For replies in the same chat and message thread, the original message. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain further _reply\_to\_message_ fields even if it itself is a reply. */
|
|
256
|
+
reply_to_message?: Message
|
|
257
|
+
/** Information about the message that is being replied to, which may come from another chat or forum topic */
|
|
258
|
+
external_reply?: ExternalReplyInfo
|
|
259
|
+
/** For replies that quote part of the original message, the quoted part of the message */
|
|
260
|
+
quote?: TextQuote
|
|
261
|
+
/** For replies to a story, the original story */
|
|
262
|
+
reply_to_story?: Story
|
|
263
|
+
/** Identifier of the specific checklist task that is being replied to */
|
|
264
|
+
reply_to_checklist_task_id?: number
|
|
265
|
+
/** Bot through which the message was sent */
|
|
266
|
+
via_bot?: User
|
|
267
|
+
/** Date the message was last edited in Unix time */
|
|
268
|
+
edit_date?: number
|
|
269
|
+
/** _True_, if the message can't be forwarded */
|
|
270
|
+
has_protected_content?: true
|
|
271
|
+
/** _True_, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */
|
|
272
|
+
is_from_offline?: true
|
|
273
|
+
/** _True_, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited. */
|
|
274
|
+
is_paid_post?: true
|
|
275
|
+
/** The unique identifier of a media message group this message belongs to */
|
|
276
|
+
media_group_id?: string
|
|
277
|
+
/** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */
|
|
278
|
+
author_signature?: string
|
|
279
|
+
/** The number of Telegram Stars that were paid by the sender of the message to send it */
|
|
280
|
+
paid_star_count?: number
|
|
281
|
+
/** For text messages, the actual UTF-8 text of the message */
|
|
282
|
+
text?: string
|
|
283
|
+
/** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */
|
|
284
|
+
entities?: Array<MessageEntity>
|
|
285
|
+
/** Options used for link preview generation for the message, if it is a text message and link preview options were changed */
|
|
286
|
+
link_preview_options?: LinkPreviewOptions
|
|
287
|
+
/** Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited. */
|
|
288
|
+
suggested_post_info?: SuggestedPostInfo
|
|
289
|
+
/** Unique identifier of the message effect added to the message */
|
|
290
|
+
effect_id?: string
|
|
291
|
+
/** Message is an animation, information about the animation. For backward compatibility, when this field is set, the _document_ field will also be set */
|
|
292
|
+
animation?: Animation
|
|
293
|
+
/** Message is an audio file, information about the file */
|
|
294
|
+
audio?: Audio
|
|
295
|
+
/** Message is a general file, information about the file */
|
|
296
|
+
document?: Document
|
|
297
|
+
/** Message contains paid media; information about the paid media */
|
|
298
|
+
paid_media?: PaidMediaInfo
|
|
299
|
+
/** Message is a photo, available sizes of the photo */
|
|
300
|
+
photo?: Array<PhotoSize>
|
|
301
|
+
/** Message is a sticker, information about the sticker */
|
|
302
|
+
sticker?: Sticker
|
|
303
|
+
/** Message is a forwarded story */
|
|
304
|
+
story?: Story
|
|
305
|
+
/** Message is a video, information about the video */
|
|
306
|
+
video?: Video
|
|
307
|
+
/** Message is a [video note](https://telegram.org/blog/video-messages-and-telescope), information about the video message */
|
|
308
|
+
video_note?: VideoNote
|
|
309
|
+
/** Message is a voice message, information about the file */
|
|
310
|
+
voice?: Voice
|
|
311
|
+
/** Caption for the animation, audio, document, paid media, photo, video or voice */
|
|
312
|
+
caption?: string
|
|
313
|
+
/** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */
|
|
314
|
+
caption_entities?: Array<MessageEntity>
|
|
315
|
+
/** _True_, if the caption must be shown above the message media */
|
|
316
|
+
show_caption_above_media?: true
|
|
317
|
+
/** _True_, if the message media is covered by a spoiler animation */
|
|
318
|
+
has_media_spoiler?: true
|
|
319
|
+
/** Message is a checklist */
|
|
320
|
+
checklist?: Checklist
|
|
321
|
+
/** Message is a shared contact, information about the contact */
|
|
322
|
+
contact?: Contact
|
|
323
|
+
/** Message is a dice with random value */
|
|
324
|
+
dice?: Dice
|
|
325
|
+
/** Message is a game, information about the game. [More about games »](https://core.telegram.org/bots/api#games) */
|
|
326
|
+
game?: Game
|
|
327
|
+
/** Message is a native poll, information about the poll */
|
|
328
|
+
poll?: Poll
|
|
329
|
+
/** Message is a venue, information about the venue. For backward compatibility, when this field is set, the _location_ field will also be set */
|
|
330
|
+
venue?: Venue
|
|
331
|
+
/** Message is a shared location, information about the location */
|
|
332
|
+
location?: Location
|
|
333
|
+
/** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */
|
|
334
|
+
new_chat_members?: Array<User>
|
|
335
|
+
/** A member was removed from the group, information about them (this member may be the bot itself) */
|
|
336
|
+
left_chat_member?: User
|
|
337
|
+
/** A chat title was changed to this value */
|
|
338
|
+
new_chat_title?: string
|
|
339
|
+
/** A chat photo was change to this value */
|
|
340
|
+
new_chat_photo?: Array<PhotoSize>
|
|
341
|
+
/** Service message: the chat photo was deleted */
|
|
342
|
+
delete_chat_photo?: true
|
|
343
|
+
/** Service message: the group has been created */
|
|
344
|
+
group_chat_created?: true
|
|
345
|
+
/** 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. */
|
|
346
|
+
supergroup_chat_created?: true
|
|
347
|
+
/** 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. */
|
|
348
|
+
channel_chat_created?: true
|
|
349
|
+
/** Service message: auto-delete timer settings changed in the chat */
|
|
350
|
+
message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged
|
|
351
|
+
/** The group has been migrated to a supergroup with the specified identifier. */
|
|
352
|
+
migrate_to_chat_id?: number
|
|
353
|
+
/** The supergroup has been migrated from a group with the specified identifier. */
|
|
354
|
+
migrate_from_chat_id?: number
|
|
355
|
+
/** Specified message was pinned. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain further _reply\_to\_message_ fields even if it itself is a reply. */
|
|
356
|
+
pinned_message?: MaybeInaccessibleMessage
|
|
357
|
+
/** Message is an invoice for a [payment](https://core.telegram.org/bots/api#payments), information about the invoice. [More about payments »](https://core.telegram.org/bots/api#payments) */
|
|
358
|
+
invoice?: Invoice
|
|
359
|
+
/** Message is a service message about a successful payment, information about the payment. [More about payments »](https://core.telegram.org/bots/api#payments) */
|
|
360
|
+
successful_payment?: SuccessfulPayment
|
|
361
|
+
/** Message is a service message about a refunded payment, information about the payment. [More about payments »](https://core.telegram.org/bots/api#payments) */
|
|
362
|
+
refunded_payment?: RefundedPayment
|
|
363
|
+
/** Service message: users were shared with the bot */
|
|
364
|
+
users_shared?: UsersShared
|
|
365
|
+
/** Service message: a chat was shared with the bot */
|
|
366
|
+
chat_shared?: ChatShared
|
|
367
|
+
/** Service message: a regular gift was sent or received */
|
|
368
|
+
gift?: GiftInfo
|
|
369
|
+
/** Service message: a unique gift was sent or received */
|
|
370
|
+
unique_gift?: UniqueGiftInfo
|
|
371
|
+
/** The domain name of the website on which the user has logged in. [More about Telegram Login »](https://core.telegram.org/widgets/login) */
|
|
372
|
+
connected_website?: string
|
|
373
|
+
/** Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method [requestWriteAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps) */
|
|
374
|
+
write_access_allowed?: WriteAccessAllowed
|
|
375
|
+
/** Telegram Passport data */
|
|
376
|
+
passport_data?: PassportData
|
|
377
|
+
/** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */
|
|
378
|
+
proximity_alert_triggered?: ProximityAlertTriggered
|
|
379
|
+
/** Service message: user boosted the chat */
|
|
380
|
+
boost_added?: ChatBoostAdded
|
|
381
|
+
/** Service message: chat background set */
|
|
382
|
+
chat_background_set?: ChatBackground
|
|
383
|
+
/** Service message: some tasks in a checklist were marked as done or not done */
|
|
384
|
+
checklist_tasks_done?: ChecklistTasksDone
|
|
385
|
+
/** Service message: tasks were added to a checklist */
|
|
386
|
+
checklist_tasks_added?: ChecklistTasksAdded
|
|
387
|
+
/** Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed */
|
|
388
|
+
direct_message_price_changed?: DirectMessagePriceChanged
|
|
389
|
+
/** Service message: forum topic created */
|
|
390
|
+
forum_topic_created?: ForumTopicCreated
|
|
391
|
+
/** Service message: forum topic edited */
|
|
392
|
+
forum_topic_edited?: ForumTopicEdited
|
|
393
|
+
/** Service message: forum topic closed */
|
|
394
|
+
forum_topic_closed?: ForumTopicClosed
|
|
395
|
+
/** Service message: forum topic reopened */
|
|
396
|
+
forum_topic_reopened?: ForumTopicReopened
|
|
397
|
+
/** Service message: the 'General' forum topic hidden */
|
|
398
|
+
general_forum_topic_hidden?: GeneralForumTopicHidden
|
|
399
|
+
/** Service message: the 'General' forum topic unhidden */
|
|
400
|
+
general_forum_topic_unhidden?: GeneralForumTopicUnhidden
|
|
401
|
+
/** Service message: a scheduled giveaway was created */
|
|
402
|
+
giveaway_created?: GiveawayCreated
|
|
403
|
+
/** The message is a scheduled giveaway message */
|
|
404
|
+
giveaway?: Giveaway
|
|
405
|
+
/** A giveaway with public winners was completed */
|
|
406
|
+
giveaway_winners?: GiveawayWinners
|
|
407
|
+
/** Service message: a giveaway without public winners was completed */
|
|
408
|
+
giveaway_completed?: GiveawayCompleted
|
|
409
|
+
/** Service message: the price for paid messages has changed in the chat */
|
|
410
|
+
paid_message_price_changed?: PaidMessagePriceChanged
|
|
411
|
+
/** Service message: a suggested post was approved */
|
|
412
|
+
suggested_post_approved?: SuggestedPostApproved
|
|
413
|
+
/** Service message: approval of a suggested post has failed */
|
|
414
|
+
suggested_post_approval_failed?: SuggestedPostApprovalFailed
|
|
415
|
+
/** Service message: a suggested post was declined */
|
|
416
|
+
suggested_post_declined?: SuggestedPostDeclined
|
|
417
|
+
/** Service message: payment for a suggested post was received */
|
|
418
|
+
suggested_post_paid?: SuggestedPostPaid
|
|
419
|
+
/** Service message: payment for a suggested post was refunded */
|
|
420
|
+
suggested_post_refunded?: SuggestedPostRefunded
|
|
421
|
+
/** Service message: video chat scheduled */
|
|
422
|
+
video_chat_scheduled?: VideoChatScheduled
|
|
423
|
+
/** Service message: video chat started */
|
|
424
|
+
video_chat_started?: VideoChatStarted
|
|
425
|
+
/** Service message: video chat ended */
|
|
426
|
+
video_chat_ended?: VideoChatEnded
|
|
427
|
+
/** Service message: new participants invited to a video chat */
|
|
428
|
+
video_chat_participants_invited?: VideoChatParticipantsInvited
|
|
429
|
+
/** Service message: data sent by a Web App */
|
|
430
|
+
web_app_data?: WebAppData
|
|
431
|
+
/** Inline keyboard attached to the message. `login_url` buttons are represented as ordinary `url` buttons. */
|
|
432
|
+
reply_markup?: InlineKeyboardMarkup
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/** This object represents a unique message identifier. */
|
|
436
|
+
export interface MessageId {
|
|
437
|
+
/** Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent */
|
|
438
|
+
message_id: number
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/** This object describes a message that was deleted or is otherwise inaccessible to the bot. */
|
|
442
|
+
export interface InaccessibleMessage {
|
|
443
|
+
/** Chat the message belonged to */
|
|
444
|
+
chat: Chat
|
|
445
|
+
/** Unique message identifier inside the chat */
|
|
446
|
+
message_id: number
|
|
447
|
+
/** Always 0. The field can be used to differentiate regular and inaccessible messages. */
|
|
448
|
+
date: number
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* This object describes a message that can be inaccessible to the bot. It can be one of
|
|
453
|
+
*
|
|
454
|
+
* - [Message](https://core.telegram.org/bots/api#message)
|
|
455
|
+
* - [InaccessibleMessage](https://core.telegram.org/bots/api#inaccessiblemessage)
|
|
456
|
+
*/
|
|
457
|
+
export type MaybeInaccessibleMessage = Message | InaccessibleMessage
|
|
458
|
+
|
|
459
|
+
/** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */
|
|
460
|
+
export interface MessageEntity {
|
|
461
|
+
/** Type of the entity. Currently, can be “mention” (`@username`), “hashtag” (`#hashtag` or `#hashtag@chatusername`), “cashtag” (`$USD` or `$USD@chatusername`), “bot\_command” (`/start@jobs_bot`), “url” (`https://telegram.org`), “email” (`do-not-reply@telegram.org`), “phone\_number” (`+1-212-555-0123`), “bold” (**bold text**), “italic” (_italic text_), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable\_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text\_link” (for clickable text URLs), “text\_mention” (for users [without usernames](https://telegram.org/blog/edit#new-mentions)), “custom\_emoji” (for inline custom emoji stickers) */
|
|
462
|
+
type: string
|
|
463
|
+
/** Offset in [UTF-16 code units](https://core.telegram.org/api/entities#entity-length) to the start of the entity */
|
|
464
|
+
offset: number
|
|
465
|
+
/** Length of the entity in [UTF-16 code units](https://core.telegram.org/api/entities#entity-length) */
|
|
466
|
+
length: number
|
|
467
|
+
/** For “text\_link” only, URL that will be opened after user taps on the text */
|
|
468
|
+
url?: string
|
|
469
|
+
/** For “text\_mention” only, the mentioned user */
|
|
470
|
+
user?: User
|
|
471
|
+
/** For “pre” only, the programming language of the entity text */
|
|
472
|
+
language?: string
|
|
473
|
+
/** For “custom\_emoji” only, unique identifier of the custom emoji. Use [getCustomEmojiStickers](https://core.telegram.org/bots/api#getcustomemojistickers) to get full information about the sticker */
|
|
474
|
+
custom_emoji_id?: string
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/** This object contains information about the quoted part of a message that is replied to by the given message. */
|
|
478
|
+
export interface TextQuote {
|
|
479
|
+
/** Text of the quoted part of a message that is replied to by the given message */
|
|
480
|
+
text: string
|
|
481
|
+
/** Special entities that appear in the quote. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities are kept in quotes. */
|
|
482
|
+
entities?: Array<MessageEntity>
|
|
483
|
+
/** Approximate quote position in the original message in UTF-16 code units as specified by the sender */
|
|
484
|
+
position: number
|
|
485
|
+
/** _True_, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */
|
|
486
|
+
is_manual?: true
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** This object contains information about a message that is being replied to, which may come from another chat or forum topic. */
|
|
490
|
+
export interface ExternalReplyInfo {
|
|
491
|
+
/** Origin of the message replied to by the given message */
|
|
492
|
+
origin: MessageOrigin
|
|
493
|
+
/** Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */
|
|
494
|
+
chat?: Chat
|
|
495
|
+
/** Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */
|
|
496
|
+
message_id?: number
|
|
497
|
+
/** Options used for link preview generation for the original message, if it is a text message */
|
|
498
|
+
link_preview_options?: LinkPreviewOptions
|
|
499
|
+
/** Message is an animation, information about the animation */
|
|
500
|
+
animation?: Animation
|
|
501
|
+
/** Message is an audio file, information about the file */
|
|
502
|
+
audio?: Audio
|
|
503
|
+
/** Message is a general file, information about the file */
|
|
504
|
+
document?: Document
|
|
505
|
+
/** Message contains paid media; information about the paid media */
|
|
506
|
+
paid_media?: PaidMediaInfo
|
|
507
|
+
/** Message is a photo, available sizes of the photo */
|
|
508
|
+
photo?: Array<PhotoSize>
|
|
509
|
+
/** Message is a sticker, information about the sticker */
|
|
510
|
+
sticker?: Sticker
|
|
511
|
+
/** Message is a forwarded story */
|
|
512
|
+
story?: Story
|
|
513
|
+
/** Message is a video, information about the video */
|
|
514
|
+
video?: Video
|
|
515
|
+
/** Message is a [video note](https://telegram.org/blog/video-messages-and-telescope), information about the video message */
|
|
516
|
+
video_note?: VideoNote
|
|
517
|
+
/** Message is a voice message, information about the file */
|
|
518
|
+
voice?: Voice
|
|
519
|
+
/** _True_, if the message media is covered by a spoiler animation */
|
|
520
|
+
has_media_spoiler?: true
|
|
521
|
+
/** Message is a checklist */
|
|
522
|
+
checklist?: Checklist
|
|
523
|
+
/** Message is a shared contact, information about the contact */
|
|
524
|
+
contact?: Contact
|
|
525
|
+
/** Message is a dice with random value */
|
|
526
|
+
dice?: Dice
|
|
527
|
+
/** Message is a game, information about the game. [More about games »](https://core.telegram.org/bots/api#games) */
|
|
528
|
+
game?: Game
|
|
529
|
+
/** Message is a scheduled giveaway, information about the giveaway */
|
|
530
|
+
giveaway?: Giveaway
|
|
531
|
+
/** A giveaway with public winners was completed */
|
|
532
|
+
giveaway_winners?: GiveawayWinners
|
|
533
|
+
/** Message is an invoice for a [payment](https://core.telegram.org/bots/api#payments), information about the invoice. [More about payments »](https://core.telegram.org/bots/api#payments) */
|
|
534
|
+
invoice?: Invoice
|
|
535
|
+
/** Message is a shared location, information about the location */
|
|
536
|
+
location?: Location
|
|
537
|
+
/** Message is a native poll, information about the poll */
|
|
538
|
+
poll?: Poll
|
|
539
|
+
/** Message is a venue, information about the venue */
|
|
540
|
+
venue?: Venue
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** Describes reply parameters for the message that is being sent. */
|
|
544
|
+
export interface ReplyParameters {
|
|
545
|
+
/** Identifier of the message that will be replied to in the current chat, or in the chat _chat\_id_ if it is specified */
|
|
546
|
+
message_id: number
|
|
547
|
+
/** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format `@channelusername`). Not supported for messages sent on behalf of a business account and messages from channel direct messages chats. */
|
|
548
|
+
chat_id?: number | string
|
|
549
|
+
/** Pass _True_ if the message should be sent even if the specified message to be replied to is not found. Always _False_ for replies in another chat or forum topic. Always _True_ for messages sent on behalf of a business account. */
|
|
550
|
+
allow_sending_without_reply?: boolean
|
|
551
|
+
/** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities. The message will fail to send if the quote isn't found in the original message. */
|
|
552
|
+
quote?: string
|
|
553
|
+
/** Mode for parsing entities in the quote. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
554
|
+
quote_parse_mode?: string
|
|
555
|
+
/** An array of special entities that appear in the quote. It can be specified instead of _quote\_parse\_mode_. */
|
|
556
|
+
quote_entities?: Array<MessageEntity>
|
|
557
|
+
/** Position of the quote in the original message in UTF-16 code units */
|
|
558
|
+
quote_position?: number
|
|
559
|
+
/** Identifier of the specific checklist task to be replied to */
|
|
560
|
+
checklist_task_id?: number
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* This object describes the origin of a message. It can be one of
|
|
565
|
+
*
|
|
566
|
+
* - [MessageOriginUser](https://core.telegram.org/bots/api#messageoriginuser)
|
|
567
|
+
* - [MessageOriginHiddenUser](https://core.telegram.org/bots/api#messageoriginhiddenuser)
|
|
568
|
+
* - [MessageOriginChat](https://core.telegram.org/bots/api#messageoriginchat)
|
|
569
|
+
* - [MessageOriginChannel](https://core.telegram.org/bots/api#messageoriginchannel)
|
|
570
|
+
*/
|
|
571
|
+
export type MessageOrigin = MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel
|
|
572
|
+
|
|
573
|
+
/** The message was originally sent by a known user. */
|
|
574
|
+
export interface MessageOriginUser {
|
|
575
|
+
/** Type of the message origin, always “user” */
|
|
576
|
+
type: string
|
|
577
|
+
/** Date the message was sent originally in Unix time */
|
|
578
|
+
date: number
|
|
579
|
+
/** User that sent the message originally */
|
|
580
|
+
sender_user: User
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** The message was originally sent by an unknown user. */
|
|
584
|
+
export interface MessageOriginHiddenUser {
|
|
585
|
+
/** Type of the message origin, always “hidden\_user” */
|
|
586
|
+
type: string
|
|
587
|
+
/** Date the message was sent originally in Unix time */
|
|
588
|
+
date: number
|
|
589
|
+
/** Name of the user that sent the message originally */
|
|
590
|
+
sender_user_name: string
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/** The message was originally sent on behalf of a chat to a group chat. */
|
|
594
|
+
export interface MessageOriginChat {
|
|
595
|
+
/** Type of the message origin, always “chat” */
|
|
596
|
+
type: string
|
|
597
|
+
/** Date the message was sent originally in Unix time */
|
|
598
|
+
date: number
|
|
599
|
+
/** Chat that sent the message originally */
|
|
600
|
+
sender_chat: Chat
|
|
601
|
+
/** For messages originally sent by an anonymous chat administrator, original message author signature */
|
|
602
|
+
author_signature?: string
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
/** The message was originally sent to a channel chat. */
|
|
606
|
+
export interface MessageOriginChannel {
|
|
607
|
+
/** Type of the message origin, always “channel” */
|
|
608
|
+
type: string
|
|
609
|
+
/** Date the message was sent originally in Unix time */
|
|
610
|
+
date: number
|
|
611
|
+
/** Channel chat to which the message was originally sent */
|
|
612
|
+
chat: Chat
|
|
613
|
+
/** Unique message identifier inside the chat */
|
|
614
|
+
message_id: number
|
|
615
|
+
/** Signature of the original post author */
|
|
616
|
+
author_signature?: string
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/** This object represents one size of a photo or a [file](https://core.telegram.org/bots/api#document) / [sticker](https://core.telegram.org/bots/api#sticker) thumbnail. */
|
|
620
|
+
export interface PhotoSize {
|
|
621
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
622
|
+
file_id: string
|
|
623
|
+
/** 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. */
|
|
624
|
+
file_unique_id: string
|
|
625
|
+
/** Photo width */
|
|
626
|
+
width: number
|
|
627
|
+
/** Photo height */
|
|
628
|
+
height: number
|
|
629
|
+
/** File size in bytes */
|
|
630
|
+
file_size?: number
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
/** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */
|
|
634
|
+
export interface Animation {
|
|
635
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
636
|
+
file_id: string
|
|
637
|
+
/** 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. */
|
|
638
|
+
file_unique_id: string
|
|
639
|
+
/** Video width as defined by the sender */
|
|
640
|
+
width: number
|
|
641
|
+
/** Video height as defined by the sender */
|
|
642
|
+
height: number
|
|
643
|
+
/** Duration of the video in seconds as defined by the sender */
|
|
644
|
+
duration: number
|
|
645
|
+
/** Animation thumbnail as defined by the sender */
|
|
646
|
+
thumbnail?: PhotoSize
|
|
647
|
+
/** Original animation filename as defined by the sender */
|
|
648
|
+
file_name?: string
|
|
649
|
+
/** MIME type of the file as defined by the sender */
|
|
650
|
+
mime_type?: string
|
|
651
|
+
/** File size in bytes. */
|
|
652
|
+
file_size?: number
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** This object represents an audio file to be treated as music by the Telegram clients. */
|
|
656
|
+
export interface Audio {
|
|
657
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
658
|
+
file_id: string
|
|
659
|
+
/** 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. */
|
|
660
|
+
file_unique_id: string
|
|
661
|
+
/** Duration of the audio in seconds as defined by the sender */
|
|
662
|
+
duration: number
|
|
663
|
+
/** Performer of the audio as defined by the sender or by audio tags */
|
|
664
|
+
performer?: string
|
|
665
|
+
/** Title of the audio as defined by the sender or by audio tags */
|
|
666
|
+
title?: string
|
|
667
|
+
/** Original filename as defined by the sender */
|
|
668
|
+
file_name?: string
|
|
669
|
+
/** MIME type of the file as defined by the sender */
|
|
670
|
+
mime_type?: string
|
|
671
|
+
/** File size in bytes. */
|
|
672
|
+
file_size?: number
|
|
673
|
+
/** Thumbnail of the album cover to which the music file belongs */
|
|
674
|
+
thumbnail?: PhotoSize
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/** This object represents a general file (as opposed to [photos](https://core.telegram.org/bots/api#photosize), [voice messages](https://core.telegram.org/bots/api#voice) and [audio files](https://core.telegram.org/bots/api#audio)). */
|
|
678
|
+
export interface Document {
|
|
679
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
680
|
+
file_id: string
|
|
681
|
+
/** 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. */
|
|
682
|
+
file_unique_id: string
|
|
683
|
+
/** Document thumbnail as defined by the sender */
|
|
684
|
+
thumbnail?: PhotoSize
|
|
685
|
+
/** Original filename as defined by the sender */
|
|
686
|
+
file_name?: string
|
|
687
|
+
/** MIME type of the file as defined by the sender */
|
|
688
|
+
mime_type?: string
|
|
689
|
+
/** File size in bytes. */
|
|
690
|
+
file_size?: number
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/** This object represents a story. */
|
|
694
|
+
export interface Story {
|
|
695
|
+
/** Chat that posted the story */
|
|
696
|
+
chat: Chat
|
|
697
|
+
/** Unique identifier for the story in the chat */
|
|
698
|
+
id: number
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/** This object represents a video file. */
|
|
702
|
+
export interface Video {
|
|
703
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
704
|
+
file_id: string
|
|
705
|
+
/** 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. */
|
|
706
|
+
file_unique_id: string
|
|
707
|
+
/** Video width as defined by the sender */
|
|
708
|
+
width: number
|
|
709
|
+
/** Video height as defined by the sender */
|
|
710
|
+
height: number
|
|
711
|
+
/** Duration of the video in seconds as defined by the sender */
|
|
712
|
+
duration: number
|
|
713
|
+
/** Video thumbnail */
|
|
714
|
+
thumbnail?: PhotoSize
|
|
715
|
+
/** Available sizes of the cover of the video in the message */
|
|
716
|
+
cover?: Array<PhotoSize>
|
|
717
|
+
/** Timestamp in seconds from which the video will play in the message */
|
|
718
|
+
start_timestamp?: number
|
|
719
|
+
/** Original filename as defined by the sender */
|
|
720
|
+
file_name?: string
|
|
721
|
+
/** MIME type of the file as defined by the sender */
|
|
722
|
+
mime_type?: string
|
|
723
|
+
/** File size in bytes. */
|
|
724
|
+
file_size?: number
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/** This object represents a [video message](https://telegram.org/blog/video-messages-and-telescope) (available in Telegram apps as of [v.4.0](https://telegram.org/blog/video-messages-and-telescope)). */
|
|
728
|
+
export interface VideoNote {
|
|
729
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
730
|
+
file_id: string
|
|
731
|
+
/** 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. */
|
|
732
|
+
file_unique_id: string
|
|
733
|
+
/** Video width and height (diameter of the video message) as defined by the sender */
|
|
734
|
+
length: number
|
|
735
|
+
/** Duration of the video in seconds as defined by the sender */
|
|
736
|
+
duration: number
|
|
737
|
+
/** Video thumbnail */
|
|
738
|
+
thumbnail?: PhotoSize
|
|
739
|
+
/** File size in bytes */
|
|
740
|
+
file_size?: number
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
/** This object represents a voice note. */
|
|
744
|
+
export interface Voice {
|
|
745
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
746
|
+
file_id: string
|
|
747
|
+
/** 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. */
|
|
748
|
+
file_unique_id: string
|
|
749
|
+
/** Duration of the audio in seconds as defined by the sender */
|
|
750
|
+
duration: number
|
|
751
|
+
/** MIME type of the file as defined by the sender */
|
|
752
|
+
mime_type?: string
|
|
753
|
+
/** File size in bytes. */
|
|
754
|
+
file_size?: number
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/** Describes the paid media added to a message. */
|
|
758
|
+
export interface PaidMediaInfo {
|
|
759
|
+
/** The number of Telegram Stars that must be paid to buy access to the media */
|
|
760
|
+
star_count: number
|
|
761
|
+
/** Information about the paid media */
|
|
762
|
+
paid_media: Array<PaidMedia>
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* This object describes paid media. Currently, it can be one of
|
|
767
|
+
*
|
|
768
|
+
* - [PaidMediaPreview](https://core.telegram.org/bots/api#paidmediapreview)
|
|
769
|
+
* - [PaidMediaPhoto](https://core.telegram.org/bots/api#paidmediaphoto)
|
|
770
|
+
* - [PaidMediaVideo](https://core.telegram.org/bots/api#paidmediavideo)
|
|
771
|
+
*/
|
|
772
|
+
export type PaidMedia = PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo
|
|
773
|
+
|
|
774
|
+
/** The paid media isn't available before the payment. */
|
|
775
|
+
export interface PaidMediaPreview {
|
|
776
|
+
/** Type of the paid media, always “preview” */
|
|
777
|
+
type: string
|
|
778
|
+
/** Media width as defined by the sender */
|
|
779
|
+
width?: number
|
|
780
|
+
/** Media height as defined by the sender */
|
|
781
|
+
height?: number
|
|
782
|
+
/** Duration of the media in seconds as defined by the sender */
|
|
783
|
+
duration?: number
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/** The paid media is a photo. */
|
|
787
|
+
export interface PaidMediaPhoto {
|
|
788
|
+
/** Type of the paid media, always “photo” */
|
|
789
|
+
type: string
|
|
790
|
+
/** The photo */
|
|
791
|
+
photo: Array<PhotoSize>
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/** The paid media is a video. */
|
|
795
|
+
export interface PaidMediaVideo {
|
|
796
|
+
/** Type of the paid media, always “video” */
|
|
797
|
+
type: string
|
|
798
|
+
/** The video */
|
|
799
|
+
video: Video
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/** This object represents a phone contact. */
|
|
803
|
+
export interface Contact {
|
|
804
|
+
/** Contact's phone number */
|
|
805
|
+
phone_number: string
|
|
806
|
+
/** Contact's first name */
|
|
807
|
+
first_name: string
|
|
808
|
+
/** Contact's last name */
|
|
809
|
+
last_name?: string
|
|
810
|
+
/** Contact's user identifier in Telegram. */
|
|
811
|
+
user_id?: number
|
|
812
|
+
/** Additional data about the contact in the form of a [vCard](https://en.wikipedia.org/wiki/VCard) */
|
|
813
|
+
vcard?: string
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/** This object represents an animated emoji that displays a random value. */
|
|
817
|
+
export interface Dice {
|
|
818
|
+
/** Emoji on which the dice throw animation is based */
|
|
819
|
+
emoji: string
|
|
820
|
+
/** Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji */
|
|
821
|
+
value: number
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/** This object contains information about one answer option in a poll. */
|
|
825
|
+
export interface PollOption {
|
|
826
|
+
/** Option text, 1-100 characters */
|
|
827
|
+
text: string
|
|
828
|
+
/** Special entities that appear in the option _text_. Currently, only custom emoji entities are allowed in poll option texts */
|
|
829
|
+
text_entities?: Array<MessageEntity>
|
|
830
|
+
/** Number of users that voted for this option */
|
|
831
|
+
voter_count: number
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/** This object contains information about one answer option in a poll to be sent. */
|
|
835
|
+
export interface InputPollOption {
|
|
836
|
+
/** Option text, 1-100 characters */
|
|
837
|
+
text: string
|
|
838
|
+
/** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. Currently, only custom emoji entities are allowed */
|
|
839
|
+
text_parse_mode?: string
|
|
840
|
+
/** An array of special entities that appear in the poll option text. It can be specified instead of _text\_parse\_mode_ */
|
|
841
|
+
text_entities?: Array<MessageEntity>
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** This object represents an answer of a user in a non-anonymous poll. */
|
|
845
|
+
export interface PollAnswer {
|
|
846
|
+
/** Unique poll identifier */
|
|
847
|
+
poll_id: string
|
|
848
|
+
/** The chat that changed the answer to the poll, if the voter is anonymous */
|
|
849
|
+
voter_chat?: Chat
|
|
850
|
+
/** The user that changed the answer to the poll, if the voter isn't anonymous */
|
|
851
|
+
user?: User
|
|
852
|
+
/** 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */
|
|
853
|
+
option_ids: Array<number>
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/** This object contains information about a poll. */
|
|
857
|
+
export interface Poll {
|
|
858
|
+
/** Unique poll identifier */
|
|
859
|
+
id: string
|
|
860
|
+
/** Poll question, 1-300 characters */
|
|
861
|
+
question: string
|
|
862
|
+
/** Special entities that appear in the _question_. Currently, only custom emoji entities are allowed in poll questions */
|
|
863
|
+
question_entities?: Array<MessageEntity>
|
|
864
|
+
/** List of poll options */
|
|
865
|
+
options: Array<PollOption>
|
|
866
|
+
/** Total number of users that voted in the poll */
|
|
867
|
+
total_voter_count: number
|
|
868
|
+
/** _True_, if the poll is closed */
|
|
869
|
+
is_closed: boolean
|
|
870
|
+
/** _True_, if the poll is anonymous */
|
|
871
|
+
is_anonymous: boolean
|
|
872
|
+
/** Poll type, currently can be “regular” or “quiz” */
|
|
873
|
+
type: string
|
|
874
|
+
/** _True_, if the poll allows multiple answers */
|
|
875
|
+
allows_multiple_answers: boolean
|
|
876
|
+
/** 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. */
|
|
877
|
+
correct_option_id?: number
|
|
878
|
+
/** 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 */
|
|
879
|
+
explanation?: string
|
|
880
|
+
/** Special entities like usernames, URLs, bot commands, etc. that appear in the _explanation_ */
|
|
881
|
+
explanation_entities?: Array<MessageEntity>
|
|
882
|
+
/** Amount of time in seconds the poll will be active after creation */
|
|
883
|
+
open_period?: number
|
|
884
|
+
/** Point in time (Unix timestamp) when the poll will be automatically closed */
|
|
885
|
+
close_date?: number
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/** Describes a task in a checklist. */
|
|
889
|
+
export interface ChecklistTask {
|
|
890
|
+
/** Unique identifier of the task */
|
|
891
|
+
id: number
|
|
892
|
+
/** Text of the task */
|
|
893
|
+
text: string
|
|
894
|
+
/** Special entities that appear in the task text */
|
|
895
|
+
text_entities?: Array<MessageEntity>
|
|
896
|
+
/** User that completed the task; omitted if the task wasn't completed */
|
|
897
|
+
completed_by_user?: User
|
|
898
|
+
/** Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
|
|
899
|
+
completion_date?: number
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/** Describes a checklist. */
|
|
903
|
+
export interface Checklist {
|
|
904
|
+
/** Title of the checklist */
|
|
905
|
+
title: string
|
|
906
|
+
/** Special entities that appear in the checklist title */
|
|
907
|
+
title_entities?: Array<MessageEntity>
|
|
908
|
+
/** List of tasks in the checklist */
|
|
909
|
+
tasks: Array<ChecklistTask>
|
|
910
|
+
/** _True_, if users other than the creator of the list can add tasks to the list */
|
|
911
|
+
others_can_add_tasks?: true
|
|
912
|
+
/** _True_, if users other than the creator of the list can mark tasks as done or not done */
|
|
913
|
+
others_can_mark_tasks_as_done?: true
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/** Describes a task to add to a checklist. */
|
|
917
|
+
export interface InputChecklistTask {
|
|
918
|
+
/** Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist */
|
|
919
|
+
id: number
|
|
920
|
+
/** Text of the task; 1-100 characters after entities parsing */
|
|
921
|
+
text: string
|
|
922
|
+
/** Mode for parsing entities in the text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
923
|
+
parse_mode?: string
|
|
924
|
+
/** List of special entities that appear in the text, which can be specified instead of parse\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities are allowed. */
|
|
925
|
+
text_entities?: Array<MessageEntity>
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/** Describes a checklist to create. */
|
|
929
|
+
export interface InputChecklist {
|
|
930
|
+
/** Title of the checklist; 1-255 characters after entities parsing */
|
|
931
|
+
title: string
|
|
932
|
+
/** Mode for parsing entities in the title. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
933
|
+
parse_mode?: string
|
|
934
|
+
/** List of special entities that appear in the title, which can be specified instead of parse\_mode. Currently, only _bold_, _italic_, _underline_, _strikethrough_, _spoiler_, and _custom\_emoji_ entities are allowed. */
|
|
935
|
+
title_entities?: Array<MessageEntity>
|
|
936
|
+
/** List of 1-30 tasks in the checklist */
|
|
937
|
+
tasks: Array<InputChecklistTask>
|
|
938
|
+
/** Pass _True_ if other users can add tasks to the checklist */
|
|
939
|
+
others_can_add_tasks?: boolean
|
|
940
|
+
/** Pass _True_ if other users can mark tasks as done or not done in the checklist */
|
|
941
|
+
others_can_mark_tasks_as_done?: boolean
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
/** Describes a service message about checklist tasks marked as done or not done. */
|
|
945
|
+
export interface ChecklistTasksDone {
|
|
946
|
+
/** Message containing the checklist whose tasks were marked as done or not done. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
947
|
+
checklist_message?: Message
|
|
948
|
+
/** Identifiers of the tasks that were marked as done */
|
|
949
|
+
marked_as_done_task_ids?: Array<number>
|
|
950
|
+
/** Identifiers of the tasks that were marked as not done */
|
|
951
|
+
marked_as_not_done_task_ids?: Array<number>
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/** Describes a service message about tasks added to a checklist. */
|
|
955
|
+
export interface ChecklistTasksAdded {
|
|
956
|
+
/** Message containing the checklist to which the tasks were added. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
957
|
+
checklist_message?: Message
|
|
958
|
+
/** List of tasks added to the checklist */
|
|
959
|
+
tasks: Array<ChecklistTask>
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
/** This object represents a point on the map. */
|
|
963
|
+
export interface Location {
|
|
964
|
+
/** Latitude as defined by the sender */
|
|
965
|
+
latitude: number
|
|
966
|
+
/** Longitude as defined by the sender */
|
|
967
|
+
longitude: number
|
|
968
|
+
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
|
|
969
|
+
horizontal_accuracy?: number
|
|
970
|
+
/** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */
|
|
971
|
+
live_period?: number
|
|
972
|
+
/** The direction in which user is moving, in degrees; 1-360. For active live locations only. */
|
|
973
|
+
heading?: number
|
|
974
|
+
/** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */
|
|
975
|
+
proximity_alert_radius?: number
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/** This object represents a venue. */
|
|
979
|
+
export interface Venue {
|
|
980
|
+
/** Venue location. Can't be a live location */
|
|
981
|
+
location: Location
|
|
982
|
+
/** Name of the venue */
|
|
983
|
+
title: string
|
|
984
|
+
/** Address of the venue */
|
|
985
|
+
address: string
|
|
986
|
+
/** Foursquare identifier of the venue */
|
|
987
|
+
foursquare_id?: string
|
|
988
|
+
/** Foursquare type of the venue. (For example, “arts\_entertainment/default”, “arts\_entertainment/aquarium” or “food/icecream”.) */
|
|
989
|
+
foursquare_type?: string
|
|
990
|
+
/** Google Places identifier of the venue */
|
|
991
|
+
google_place_id?: string
|
|
992
|
+
/** Google Places type of the venue. (See [supported types](https://developers.google.com/places/web-service/supported_types).) */
|
|
993
|
+
google_place_type?: string
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/** Describes data sent from a [Web App](https://core.telegram.org/bots/webapps) to the bot. */
|
|
997
|
+
export interface WebAppData {
|
|
998
|
+
/** The data. Be aware that a bad client can send arbitrary data in this field. */
|
|
999
|
+
data: string
|
|
1000
|
+
/** 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. */
|
|
1001
|
+
button_text: string
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
/** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */
|
|
1005
|
+
export interface ProximityAlertTriggered {
|
|
1006
|
+
/** User that triggered the alert */
|
|
1007
|
+
traveler: User
|
|
1008
|
+
/** User that set the alert */
|
|
1009
|
+
watcher: User
|
|
1010
|
+
/** The distance between the users */
|
|
1011
|
+
distance: number
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/** This object represents a service message about a change in auto-delete timer settings. */
|
|
1015
|
+
export interface MessageAutoDeleteTimerChanged {
|
|
1016
|
+
/** New auto-delete time for messages in the chat; in seconds */
|
|
1017
|
+
message_auto_delete_time: number
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/** This object represents a service message about a user boosting a chat. */
|
|
1021
|
+
export interface ChatBoostAdded {
|
|
1022
|
+
/** Number of boosts added by the user */
|
|
1023
|
+
boost_count: number
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* This object describes the way a background is filled based on the selected colors. Currently, it can be one of
|
|
1028
|
+
*
|
|
1029
|
+
* - [BackgroundFillSolid](https://core.telegram.org/bots/api#backgroundfillsolid)
|
|
1030
|
+
* - [BackgroundFillGradient](https://core.telegram.org/bots/api#backgroundfillgradient)
|
|
1031
|
+
* - [BackgroundFillFreeformGradient](https://core.telegram.org/bots/api#backgroundfillfreeformgradient)
|
|
1032
|
+
*/
|
|
1033
|
+
export type BackgroundFill = BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient
|
|
1034
|
+
|
|
1035
|
+
/** The background is filled using the selected color. */
|
|
1036
|
+
export interface BackgroundFillSolid {
|
|
1037
|
+
/** Type of the background fill, always “solid” */
|
|
1038
|
+
type: string
|
|
1039
|
+
/** The color of the background fill in the RGB24 format */
|
|
1040
|
+
color: number
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
/** The background is a gradient fill. */
|
|
1044
|
+
export interface BackgroundFillGradient {
|
|
1045
|
+
/** Type of the background fill, always “gradient” */
|
|
1046
|
+
type: string
|
|
1047
|
+
/** Top color of the gradient in the RGB24 format */
|
|
1048
|
+
top_color: number
|
|
1049
|
+
/** Bottom color of the gradient in the RGB24 format */
|
|
1050
|
+
bottom_color: number
|
|
1051
|
+
/** Clockwise rotation angle of the background fill in degrees; 0-359 */
|
|
1052
|
+
rotation_angle: number
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/** The background is a freeform gradient that rotates after every message in the chat. */
|
|
1056
|
+
export interface BackgroundFillFreeformGradient {
|
|
1057
|
+
/** Type of the background fill, always “freeform\_gradient” */
|
|
1058
|
+
type: string
|
|
1059
|
+
/** A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */
|
|
1060
|
+
colors: Array<number>
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* This object describes the type of a background. Currently, it can be one of
|
|
1065
|
+
*
|
|
1066
|
+
* - [BackgroundTypeFill](https://core.telegram.org/bots/api#backgroundtypefill)
|
|
1067
|
+
* - [BackgroundTypeWallpaper](https://core.telegram.org/bots/api#backgroundtypewallpaper)
|
|
1068
|
+
* - [BackgroundTypePattern](https://core.telegram.org/bots/api#backgroundtypepattern)
|
|
1069
|
+
* - [BackgroundTypeChatTheme](https://core.telegram.org/bots/api#backgroundtypechattheme)
|
|
1070
|
+
*/
|
|
1071
|
+
export type BackgroundType = BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme
|
|
1072
|
+
|
|
1073
|
+
/** The background is automatically filled based on the selected colors. */
|
|
1074
|
+
export interface BackgroundTypeFill {
|
|
1075
|
+
/** Type of the background, always “fill” */
|
|
1076
|
+
type: string
|
|
1077
|
+
/** The background fill */
|
|
1078
|
+
fill: BackgroundFill
|
|
1079
|
+
/** Dimming of the background in dark themes, as a percentage; 0-100 */
|
|
1080
|
+
dark_theme_dimming: number
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
/** The background is a wallpaper in the JPEG format. */
|
|
1084
|
+
export interface BackgroundTypeWallpaper {
|
|
1085
|
+
/** Type of the background, always “wallpaper” */
|
|
1086
|
+
type: string
|
|
1087
|
+
/** Document with the wallpaper */
|
|
1088
|
+
document: Document
|
|
1089
|
+
/** Dimming of the background in dark themes, as a percentage; 0-100 */
|
|
1090
|
+
dark_theme_dimming: number
|
|
1091
|
+
/** _True_, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */
|
|
1092
|
+
is_blurred?: true
|
|
1093
|
+
/** _True_, if the background moves slightly when the device is tilted */
|
|
1094
|
+
is_moving?: true
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/** The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user. */
|
|
1098
|
+
export interface BackgroundTypePattern {
|
|
1099
|
+
/** Type of the background, always “pattern” */
|
|
1100
|
+
type: string
|
|
1101
|
+
/** Document with the pattern */
|
|
1102
|
+
document: Document
|
|
1103
|
+
/** The background fill that is combined with the pattern */
|
|
1104
|
+
fill: BackgroundFill
|
|
1105
|
+
/** Intensity of the pattern when it is shown above the filled background; 0-100 */
|
|
1106
|
+
intensity: number
|
|
1107
|
+
/** _True_, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only */
|
|
1108
|
+
is_inverted?: true
|
|
1109
|
+
/** _True_, if the background moves slightly when the device is tilted */
|
|
1110
|
+
is_moving?: true
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/** The background is taken directly from a built-in chat theme. */
|
|
1114
|
+
export interface BackgroundTypeChatTheme {
|
|
1115
|
+
/** Type of the background, always “chat\_theme” */
|
|
1116
|
+
type: string
|
|
1117
|
+
/** Name of the chat theme, which is usually an emoji */
|
|
1118
|
+
theme_name: string
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
/** This object represents a chat background. */
|
|
1122
|
+
export interface ChatBackground {
|
|
1123
|
+
/** Type of the background */
|
|
1124
|
+
type: BackgroundType
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/** This object represents a service message about a new forum topic created in the chat. */
|
|
1128
|
+
export interface ForumTopicCreated {
|
|
1129
|
+
/** Name of the topic */
|
|
1130
|
+
name: string
|
|
1131
|
+
/** Color of the topic icon in RGB format */
|
|
1132
|
+
icon_color: number
|
|
1133
|
+
/** Unique identifier of the custom emoji shown as the topic icon */
|
|
1134
|
+
icon_custom_emoji_id?: string
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
/** This object represents a service message about a forum topic closed in the chat. Currently holds no information. */
|
|
1138
|
+
export interface ForumTopicClosed {
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/** This object represents a service message about an edited forum topic. */
|
|
1142
|
+
export interface ForumTopicEdited {
|
|
1143
|
+
/** New name of the topic, if it was edited */
|
|
1144
|
+
name?: string
|
|
1145
|
+
/** New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */
|
|
1146
|
+
icon_custom_emoji_id?: string
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/** This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */
|
|
1150
|
+
export interface ForumTopicReopened {
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
/** This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */
|
|
1154
|
+
export interface GeneralForumTopicHidden {
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
/** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */
|
|
1158
|
+
export interface GeneralForumTopicUnhidden {
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/** This object contains information about a user that was shared with the bot using a [KeyboardButtonRequestUsers](https://core.telegram.org/bots/api#keyboardbuttonrequestusers) button. */
|
|
1162
|
+
export interface SharedUser {
|
|
1163
|
+
/** Identifier of the shared user. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */
|
|
1164
|
+
user_id: number
|
|
1165
|
+
/** First name of the user, if the name was requested by the bot */
|
|
1166
|
+
first_name?: string
|
|
1167
|
+
/** Last name of the user, if the name was requested by the bot */
|
|
1168
|
+
last_name?: string
|
|
1169
|
+
/** Username of the user, if the username was requested by the bot */
|
|
1170
|
+
username?: string
|
|
1171
|
+
/** Available sizes of the chat photo, if the photo was requested by the bot */
|
|
1172
|
+
photo?: Array<PhotoSize>
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/** This object contains information about the users whose identifiers were shared with the bot using a [KeyboardButtonRequestUsers](https://core.telegram.org/bots/api#keyboardbuttonrequestusers) button. */
|
|
1176
|
+
export interface UsersShared {
|
|
1177
|
+
/** Identifier of the request */
|
|
1178
|
+
request_id: number
|
|
1179
|
+
/** Information about users shared with the bot. */
|
|
1180
|
+
users: Array<SharedUser>
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/** This object contains information about a chat that was shared with the bot using a [KeyboardButtonRequestChat](https://core.telegram.org/bots/api#keyboardbuttonrequestchat) button. */
|
|
1184
|
+
export interface ChatShared {
|
|
1185
|
+
/** Identifier of the request */
|
|
1186
|
+
request_id: number
|
|
1187
|
+
/** Identifier of the shared chat. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */
|
|
1188
|
+
chat_id: number
|
|
1189
|
+
/** Title of the chat, if the title was requested by the bot. */
|
|
1190
|
+
title?: string
|
|
1191
|
+
/** Username of the chat, if the username was requested by the bot and available. */
|
|
1192
|
+
username?: string
|
|
1193
|
+
/** Available sizes of the chat photo, if the photo was requested by the bot */
|
|
1194
|
+
photo?: Array<PhotoSize>
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/** This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method [requestWriteAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps). */
|
|
1198
|
+
export interface WriteAccessAllowed {
|
|
1199
|
+
/** _True_, if the access was granted after the user accepted an explicit request from a Web App sent by the method [requestWriteAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps) */
|
|
1200
|
+
from_request?: boolean
|
|
1201
|
+
/** Name of the Web App, if the access was granted when the Web App was launched from a link */
|
|
1202
|
+
web_app_name?: string
|
|
1203
|
+
/** _True_, if the access was granted when the bot was added to the attachment or side menu */
|
|
1204
|
+
from_attachment_menu?: boolean
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/** This object represents a service message about a video chat scheduled in the chat. */
|
|
1208
|
+
export interface VideoChatScheduled {
|
|
1209
|
+
/** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */
|
|
1210
|
+
start_date: number
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/** This object represents a service message about a video chat started in the chat. Currently holds no information. */
|
|
1214
|
+
export interface VideoChatStarted {
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/** This object represents a service message about a video chat ended in the chat. */
|
|
1218
|
+
export interface VideoChatEnded {
|
|
1219
|
+
/** Video chat duration in seconds */
|
|
1220
|
+
duration: number
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
/** This object represents a service message about new members invited to a video chat. */
|
|
1224
|
+
export interface VideoChatParticipantsInvited {
|
|
1225
|
+
/** New members that were invited to the video chat */
|
|
1226
|
+
users: Array<User>
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/** Describes a service message about a change in the price of paid messages within a chat. */
|
|
1230
|
+
export interface PaidMessagePriceChanged {
|
|
1231
|
+
/** The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message */
|
|
1232
|
+
paid_message_star_count: number
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
/** Describes a service message about a change in the price of direct messages sent to a channel chat. */
|
|
1236
|
+
export interface DirectMessagePriceChanged {
|
|
1237
|
+
/** _True_, if direct messages are enabled for the channel chat; false otherwise */
|
|
1238
|
+
are_direct_messages_enabled: boolean
|
|
1239
|
+
/** The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0. */
|
|
1240
|
+
direct_message_star_count?: number
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/** Describes a service message about the approval of a suggested post. */
|
|
1244
|
+
export interface SuggestedPostApproved {
|
|
1245
|
+
/** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
1246
|
+
suggested_post_message?: Message
|
|
1247
|
+
/** Amount paid for the post */
|
|
1248
|
+
price?: SuggestedPostPrice
|
|
1249
|
+
/** Date when the post will be published */
|
|
1250
|
+
send_date: number
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
/** Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval. */
|
|
1254
|
+
export interface SuggestedPostApprovalFailed {
|
|
1255
|
+
/** Message containing the suggested post whose approval has failed. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
1256
|
+
suggested_post_message?: Message
|
|
1257
|
+
/** Expected price of the post */
|
|
1258
|
+
price: SuggestedPostPrice
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
/** Describes a service message about the rejection of a suggested post. */
|
|
1262
|
+
export interface SuggestedPostDeclined {
|
|
1263
|
+
/** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
1264
|
+
suggested_post_message?: Message
|
|
1265
|
+
/** Comment with which the post was declined */
|
|
1266
|
+
comment?: string
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
/** Describes a service message about a successful payment for a suggested post. */
|
|
1270
|
+
export interface SuggestedPostPaid {
|
|
1271
|
+
/** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
1272
|
+
suggested_post_message?: Message
|
|
1273
|
+
/** Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins */
|
|
1274
|
+
currency: string
|
|
1275
|
+
/** The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only */
|
|
1276
|
+
amount?: number
|
|
1277
|
+
/** The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only */
|
|
1278
|
+
star_amount?: StarAmount
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
/** Describes a service message about a payment refund for a suggested post. */
|
|
1282
|
+
export interface SuggestedPostRefunded {
|
|
1283
|
+
/** Message containing the suggested post. Note that the [Message](https://core.telegram.org/bots/api#message) object in this field will not contain the _reply\_to\_message_ field even if it itself is a reply. */
|
|
1284
|
+
suggested_post_message?: Message
|
|
1285
|
+
/** Reason for the refund. Currently, one of “post\_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment\_refunded” if the payer refunded their payment. */
|
|
1286
|
+
reason: string
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
/** This object represents a service message about the creation of a scheduled giveaway. */
|
|
1290
|
+
export interface GiveawayCreated {
|
|
1291
|
+
/** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
|
|
1292
|
+
prize_star_count?: number
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
/** This object represents a message about a scheduled giveaway. */
|
|
1296
|
+
export interface Giveaway {
|
|
1297
|
+
/** The list of chats which the user must join to participate in the giveaway */
|
|
1298
|
+
chats: Array<Chat>
|
|
1299
|
+
/** Point in time (Unix timestamp) when winners of the giveaway will be selected */
|
|
1300
|
+
winners_selection_date: number
|
|
1301
|
+
/** The number of users which are supposed to be selected as winners of the giveaway */
|
|
1302
|
+
winner_count: number
|
|
1303
|
+
/** _True_, if only users who join the chats after the giveaway started should be eligible to win */
|
|
1304
|
+
only_new_members?: true
|
|
1305
|
+
/** _True_, if the list of giveaway winners will be visible to everyone */
|
|
1306
|
+
has_public_winners?: true
|
|
1307
|
+
/** Description of additional giveaway prize */
|
|
1308
|
+
prize_description?: string
|
|
1309
|
+
/** A list of two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. */
|
|
1310
|
+
country_codes?: Array<string>
|
|
1311
|
+
/** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
|
|
1312
|
+
prize_star_count?: number
|
|
1313
|
+
/** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
|
|
1314
|
+
premium_subscription_month_count?: number
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
/** This object represents a message about the completion of a giveaway with public winners. */
|
|
1318
|
+
export interface GiveawayWinners {
|
|
1319
|
+
/** The chat that created the giveaway */
|
|
1320
|
+
chat: Chat
|
|
1321
|
+
/** Identifier of the message with the giveaway in the chat */
|
|
1322
|
+
giveaway_message_id: number
|
|
1323
|
+
/** Point in time (Unix timestamp) when winners of the giveaway were selected */
|
|
1324
|
+
winners_selection_date: number
|
|
1325
|
+
/** Total number of winners in the giveaway */
|
|
1326
|
+
winner_count: number
|
|
1327
|
+
/** List of up to 100 winners of the giveaway */
|
|
1328
|
+
winners: Array<User>
|
|
1329
|
+
/** The number of other chats the user had to join in order to be eligible for the giveaway */
|
|
1330
|
+
additional_chat_count?: number
|
|
1331
|
+
/** The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */
|
|
1332
|
+
prize_star_count?: number
|
|
1333
|
+
/** The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */
|
|
1334
|
+
premium_subscription_month_count?: number
|
|
1335
|
+
/** Number of undistributed prizes */
|
|
1336
|
+
unclaimed_prize_count?: number
|
|
1337
|
+
/** _True_, if only users who had joined the chats after the giveaway started were eligible to win */
|
|
1338
|
+
only_new_members?: true
|
|
1339
|
+
/** _True_, if the giveaway was canceled because the payment for it was refunded */
|
|
1340
|
+
was_refunded?: true
|
|
1341
|
+
/** Description of additional giveaway prize */
|
|
1342
|
+
prize_description?: string
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
/** This object represents a service message about the completion of a giveaway without public winners. */
|
|
1346
|
+
export interface GiveawayCompleted {
|
|
1347
|
+
/** Number of winners in the giveaway */
|
|
1348
|
+
winner_count: number
|
|
1349
|
+
/** Number of undistributed prizes */
|
|
1350
|
+
unclaimed_prize_count?: number
|
|
1351
|
+
/** Message with the giveaway that was completed, if it wasn't deleted */
|
|
1352
|
+
giveaway_message?: Message
|
|
1353
|
+
/** _True_, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */
|
|
1354
|
+
is_star_giveaway?: true
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
/** Describes the options used for link preview generation. */
|
|
1358
|
+
export interface LinkPreviewOptions {
|
|
1359
|
+
/** _True_, if the link preview is disabled */
|
|
1360
|
+
is_disabled?: boolean
|
|
1361
|
+
/** URL to use for the link preview. If empty, then the first URL found in the message text will be used */
|
|
1362
|
+
url?: string
|
|
1363
|
+
/** _True_, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
|
|
1364
|
+
prefer_small_media?: boolean
|
|
1365
|
+
/** _True_, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */
|
|
1366
|
+
prefer_large_media?: boolean
|
|
1367
|
+
/** _True_, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */
|
|
1368
|
+
show_above_text?: boolean
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/** Describes the price of a suggested post. */
|
|
1372
|
+
export interface SuggestedPostPrice {
|
|
1373
|
+
/** Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins */
|
|
1374
|
+
currency: string
|
|
1375
|
+
/** The amount of the currency that will be paid for the post in the _smallest units_ of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000. */
|
|
1376
|
+
amount: number
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
/** Contains information about a suggested post. */
|
|
1380
|
+
export interface SuggestedPostInfo {
|
|
1381
|
+
/** State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”. */
|
|
1382
|
+
state: string
|
|
1383
|
+
/** Proposed price of the post. If the field is omitted, then the post is unpaid. */
|
|
1384
|
+
price?: SuggestedPostPrice
|
|
1385
|
+
/** Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it. */
|
|
1386
|
+
send_date?: number
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/** Contains parameters of a post that is being suggested by the bot. */
|
|
1390
|
+
export interface SuggestedPostParameters {
|
|
1391
|
+
/** Proposed price for the post. If the field is omitted, then the post is unpaid. */
|
|
1392
|
+
price?: SuggestedPostPrice
|
|
1393
|
+
/** Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it. */
|
|
1394
|
+
send_date?: number
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/** Describes a topic of a direct messages chat. */
|
|
1398
|
+
export interface DirectMessagesTopic {
|
|
1399
|
+
/** Unique identifier of the topic. */
|
|
1400
|
+
topic_id: number
|
|
1401
|
+
/** Information about the user that created the topic. Currently, it is always present */
|
|
1402
|
+
user?: User
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
/** This object represent a user's profile pictures. */
|
|
1406
|
+
export interface UserProfilePhotos {
|
|
1407
|
+
/** Total number of profile pictures the target user has */
|
|
1408
|
+
total_count: number
|
|
1409
|
+
/** Requested profile pictures (in up to 4 sizes each) */
|
|
1410
|
+
photos: Array<Array<PhotoSize>>
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* 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](https://core.telegram.org/bots/api#getfile).
|
|
1415
|
+
*
|
|
1416
|
+
* > The maximum file size to download is 20 MB
|
|
1417
|
+
*/
|
|
1418
|
+
export interface File {
|
|
1419
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
1420
|
+
file_id: string
|
|
1421
|
+
/** 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. */
|
|
1422
|
+
file_unique_id: string
|
|
1423
|
+
/** File size in bytes. */
|
|
1424
|
+
file_size?: number
|
|
1425
|
+
/** File path. Use `https://api.telegram.org/file/bot<token>/<file_path>` to get the file. */
|
|
1426
|
+
file_path?: string
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/** Describes a [Web App](https://core.telegram.org/bots/webapps). */
|
|
1430
|
+
export interface WebAppInfo {
|
|
1431
|
+
/** An HTTPS URL of a Web App to be opened with additional data as specified in [Initializing Web Apps](https://core.telegram.org/bots/webapps#initializing-mini-apps) */
|
|
1432
|
+
url: string
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1435
|
+
/** This object represents a [custom keyboard](https://core.telegram.org/bots/features#keyboards) with reply options (see [Introduction to bots](https://core.telegram.org/bots/features#keyboards) for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
|
|
1436
|
+
export interface ReplyKeyboardMarkup {
|
|
1437
|
+
/** Array of button rows, each represented by an Array of [KeyboardButton](https://core.telegram.org/bots/api#keyboardbutton) objects */
|
|
1438
|
+
keyboard: Array<Array<KeyboardButton>>
|
|
1439
|
+
/** 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. */
|
|
1440
|
+
is_persistent?: boolean
|
|
1441
|
+
/** 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. */
|
|
1442
|
+
resize_keyboard?: boolean
|
|
1443
|
+
/** 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_. */
|
|
1444
|
+
one_time_keyboard?: boolean
|
|
1445
|
+
/** The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */
|
|
1446
|
+
input_field_placeholder?: string
|
|
1447
|
+
/**
|
|
1448
|
+
* 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](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
|
|
1449
|
+
*
|
|
1450
|
+
* _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.
|
|
1451
|
+
*/
|
|
1452
|
+
selective?: boolean
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, _String_ can be used instead of this object to specify the button text.
|
|
1457
|
+
*
|
|
1458
|
+
* **Note:** _request\_users_ and _request\_chat_ options will only work in Telegram versions released after 3 February, 2023. Older clients will display _unsupported message_.
|
|
1459
|
+
*/
|
|
1460
|
+
export interface KeyboardButton {
|
|
1461
|
+
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
|
|
1462
|
+
text: string
|
|
1463
|
+
/** If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users\_shared” service message. Available in private chats only. */
|
|
1464
|
+
request_users?: KeyboardButtonRequestUsers
|
|
1465
|
+
/** If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat\_shared” service message. Available in private chats only. */
|
|
1466
|
+
request_chat?: KeyboardButtonRequestChat
|
|
1467
|
+
/** If _True_, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */
|
|
1468
|
+
request_contact?: boolean
|
|
1469
|
+
/** If _True_, the user's current location will be sent when the button is pressed. Available in private chats only. */
|
|
1470
|
+
request_location?: boolean
|
|
1471
|
+
/** 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. */
|
|
1472
|
+
request_poll?: KeyboardButtonPollType
|
|
1473
|
+
/** If specified, the described [Web App](https://core.telegram.org/bots/webapps) 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. */
|
|
1474
|
+
web_app?: WebAppInfo
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
/** This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. [More about requesting users »](https://core.telegram.org/bots/features#chat-and-user-selection) */
|
|
1478
|
+
export interface KeyboardButtonRequestUsers {
|
|
1479
|
+
/** Signed 32-bit identifier of the request that will be received back in the [UsersShared](https://core.telegram.org/bots/api#usersshared) object. Must be unique within the message */
|
|
1480
|
+
request_id: number
|
|
1481
|
+
/** Pass _True_ to request bots, pass _False_ to request regular users. If not specified, no additional restrictions are applied. */
|
|
1482
|
+
user_is_bot?: boolean
|
|
1483
|
+
/** Pass _True_ to request premium users, pass _False_ to request non-premium users. If not specified, no additional restrictions are applied. */
|
|
1484
|
+
user_is_premium?: boolean
|
|
1485
|
+
/** The maximum number of users to be selected; 1-10. Defaults to 1. */
|
|
1486
|
+
max_quantity?: number
|
|
1487
|
+
/** Pass _True_ to request the users' first and last names */
|
|
1488
|
+
request_name?: boolean
|
|
1489
|
+
/** Pass _True_ to request the users' usernames */
|
|
1490
|
+
request_username?: boolean
|
|
1491
|
+
/** Pass _True_ to request the users' photos */
|
|
1492
|
+
request_photo?: boolean
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/** This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. [More about requesting chats »](https://core.telegram.org/bots/features#chat-and-user-selection). */
|
|
1496
|
+
export interface KeyboardButtonRequestChat {
|
|
1497
|
+
/** Signed 32-bit identifier of the request, which will be received back in the [ChatShared](https://core.telegram.org/bots/api#chatshared) object. Must be unique within the message */
|
|
1498
|
+
request_id: number
|
|
1499
|
+
/** Pass _True_ to request a channel chat, pass _False_ to request a group or a supergroup chat. */
|
|
1500
|
+
chat_is_channel: boolean
|
|
1501
|
+
/** Pass _True_ to request a forum supergroup, pass _False_ to request a non-forum chat. If not specified, no additional restrictions are applied. */
|
|
1502
|
+
chat_is_forum?: boolean
|
|
1503
|
+
/** Pass _True_ to request a supergroup or a channel with a username, pass _False_ to request a chat without a username. If not specified, no additional restrictions are applied. */
|
|
1504
|
+
chat_has_username?: boolean
|
|
1505
|
+
/** Pass _True_ to request a chat owned by the user. Otherwise, no additional restrictions are applied. */
|
|
1506
|
+
chat_is_created?: boolean
|
|
1507
|
+
/** An object listing the required administrator rights of the user in the chat. The rights must be a superset of _bot\_administrator\_rights_. If not specified, no additional restrictions are applied. */
|
|
1508
|
+
user_administrator_rights?: ChatAdministratorRights
|
|
1509
|
+
/** An object listing the required administrator rights of the bot in the chat. The rights must be a subset of _user\_administrator\_rights_. If not specified, no additional restrictions are applied. */
|
|
1510
|
+
bot_administrator_rights?: ChatAdministratorRights
|
|
1511
|
+
/** Pass _True_ to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. */
|
|
1512
|
+
bot_is_member?: boolean
|
|
1513
|
+
/** Pass _True_ to request the chat's title */
|
|
1514
|
+
request_title?: boolean
|
|
1515
|
+
/** Pass _True_ to request the chat's username */
|
|
1516
|
+
request_username?: boolean
|
|
1517
|
+
/** Pass _True_ to request the chat's photo */
|
|
1518
|
+
request_photo?: boolean
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
/** This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. */
|
|
1522
|
+
export interface KeyboardButtonPollType {
|
|
1523
|
+
/** 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. */
|
|
1524
|
+
type?: string
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
/** 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](https://core.telegram.org/bots/api#replykeyboardmarkup)). Not supported in channels and for messages sent on behalf of a Telegram Business account. */
|
|
1528
|
+
export interface ReplyKeyboardRemove {
|
|
1529
|
+
/** 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](https://core.telegram.org/bots/api#replykeyboardmarkup)) */
|
|
1530
|
+
remove_keyboard: true
|
|
1531
|
+
/**
|
|
1532
|
+
* 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](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
|
|
1533
|
+
*
|
|
1534
|
+
* _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.
|
|
1535
|
+
*/
|
|
1536
|
+
selective?: boolean
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/** This object represents an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) that appears right next to the message it belongs to. */
|
|
1540
|
+
export interface InlineKeyboardMarkup {
|
|
1541
|
+
/** Array of button rows, each represented by an Array of [InlineKeyboardButton](https://core.telegram.org/bots/api#inlinekeyboardbutton) objects */
|
|
1542
|
+
inline_keyboard: Array<Array<InlineKeyboardButton>>
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/** This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button. */
|
|
1546
|
+
export interface InlineKeyboardButton {
|
|
1547
|
+
/** Label text on the button */
|
|
1548
|
+
text: string
|
|
1549
|
+
/** 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 identifier without using a username, if this is allowed by their privacy settings. */
|
|
1550
|
+
url?: string
|
|
1551
|
+
/** Data to be sent in a [callback query](https://core.telegram.org/bots/api#callbackquery) to the bot when the button is pressed, 1-64 bytes */
|
|
1552
|
+
callback_data?: string
|
|
1553
|
+
/** Description of the [Web App](https://core.telegram.org/bots/webapps) 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](https://core.telegram.org/bots/api#answerwebappquery). Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account. */
|
|
1554
|
+
web_app?: WebAppInfo
|
|
1555
|
+
/** An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login). */
|
|
1556
|
+
login_url?: LoginUrl
|
|
1557
|
+
/** If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
|
|
1558
|
+
switch_inline_query?: string
|
|
1559
|
+
/**
|
|
1560
|
+
* If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.
|
|
1561
|
+
*
|
|
1562
|
+
* This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a Telegram Business account.
|
|
1563
|
+
*/
|
|
1564
|
+
switch_inline_query_current_chat?: string
|
|
1565
|
+
/** If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a Telegram Business account. */
|
|
1566
|
+
switch_inline_query_chosen_chat?: SwitchInlineQueryChosenChat
|
|
1567
|
+
/** Description of the button that copies the specified text to the clipboard. */
|
|
1568
|
+
copy_text?: CopyTextButton
|
|
1569
|
+
/**
|
|
1570
|
+
* Description of the game that will be launched when the user presses the button.
|
|
1571
|
+
*
|
|
1572
|
+
* **NOTE:** This type of button **must** always be the first button in the first row.
|
|
1573
|
+
*/
|
|
1574
|
+
callback_game?: CallbackGame
|
|
1575
|
+
/**
|
|
1576
|
+
* Specify _True_, to send a [Pay button](https://core.telegram.org/bots/api#payments). Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.
|
|
1577
|
+
*
|
|
1578
|
+
* **NOTE:** This type of button **must** always be the first button in the first row and can only be used in invoice messages.
|
|
1579
|
+
*/
|
|
1580
|
+
pay?: boolean
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* 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](https://core.telegram.org/widgets/login) 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:
|
|
1585
|
+
*
|
|
1586
|
+
* [](https://core.telegram.org/file/811140015/1734/8VZFkwWXalM.97872/6127fa62d8a0bf2b3c)
|
|
1587
|
+
*
|
|
1588
|
+
* Telegram apps support these buttons as of [version 5.7](https://telegram.org/blog/privacy-discussions-web-bots#meet-seamless-web-bots).
|
|
1589
|
+
*
|
|
1590
|
+
* > Sample bot: [@discussbot](https://t.me/discussbot)
|
|
1591
|
+
*/
|
|
1592
|
+
export interface LoginUrl {
|
|
1593
|
+
/**
|
|
1594
|
+
* An HTTPS 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](https://core.telegram.org/widgets/login#receiving-authorization-data).
|
|
1595
|
+
*
|
|
1596
|
+
* **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](https://core.telegram.org/widgets/login#checking-authorization).
|
|
1597
|
+
*/
|
|
1598
|
+
url: string
|
|
1599
|
+
/** New text of the button in forwarded messages. */
|
|
1600
|
+
forward_text?: string
|
|
1601
|
+
/** Username of a bot, which will be used for user authorization. See [Setting up a bot](https://core.telegram.org/widgets/login#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](https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot) for more details. */
|
|
1602
|
+
bot_username?: string
|
|
1603
|
+
/** Pass _True_ to request the permission for your bot to send messages to the user. */
|
|
1604
|
+
request_write_access?: boolean
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
/** This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. */
|
|
1608
|
+
export interface SwitchInlineQueryChosenChat {
|
|
1609
|
+
/** The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted */
|
|
1610
|
+
query?: string
|
|
1611
|
+
/** _True_, if private chats with users can be chosen */
|
|
1612
|
+
allow_user_chats?: boolean
|
|
1613
|
+
/** _True_, if private chats with bots can be chosen */
|
|
1614
|
+
allow_bot_chats?: boolean
|
|
1615
|
+
/** _True_, if group and supergroup chats can be chosen */
|
|
1616
|
+
allow_group_chats?: boolean
|
|
1617
|
+
/** _True_, if channel chats can be chosen */
|
|
1618
|
+
allow_channel_chats?: boolean
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
/** This object represents an inline keyboard button that copies specified text to the clipboard. */
|
|
1622
|
+
export interface CopyTextButton {
|
|
1623
|
+
/** The text to be copied to the clipboard; 1-256 characters */
|
|
1624
|
+
text: string
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* This object represents an incoming callback query from a callback button in an [inline keyboard](https://core.telegram.org/bots/features#inline-keyboards). 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](https://core.telegram.org/bots/api#inline-mode)), the field _inline\_message\_id_ will be present. Exactly one of the fields _data_ or _game\_short\_name_ will be present.
|
|
1629
|
+
*
|
|
1630
|
+
* > **NOTE:** After the user presses a callback button, Telegram clients will display a progress bar until you call [answerCallbackQuery](https://core.telegram.org/bots/api#answercallbackquery). It is, therefore, necessary to react by calling [answerCallbackQuery](https://core.telegram.org/bots/api#answercallbackquery) even if no notification to the user is needed (e.g., without specifying any of the optional parameters).
|
|
1631
|
+
*/
|
|
1632
|
+
export interface CallbackQuery {
|
|
1633
|
+
/** Unique identifier for this query */
|
|
1634
|
+
id: string
|
|
1635
|
+
/** Sender */
|
|
1636
|
+
from: User
|
|
1637
|
+
/** Message sent by the bot with the callback button that originated the query */
|
|
1638
|
+
message?: MaybeInaccessibleMessage
|
|
1639
|
+
/** Identifier of the message sent via the bot in inline mode, that originated the query. */
|
|
1640
|
+
inline_message_id?: string
|
|
1641
|
+
/** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in [games](https://core.telegram.org/bots/api#games). */
|
|
1642
|
+
chat_instance: string
|
|
1643
|
+
/** Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. */
|
|
1644
|
+
data?: string
|
|
1645
|
+
/** Short name of a [Game](https://core.telegram.org/bots/api#games) to be returned, serves as the unique identifier for the game */
|
|
1646
|
+
game_short_name?: string
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
/**
|
|
1650
|
+
* 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](https://core.telegram.org/bots/features#privacy-mode). Not supported in channels and for messages sent on behalf of a Telegram Business account.
|
|
1651
|
+
*
|
|
1652
|
+
* > **Example:** A [poll bot](https://t.me/PollBot) for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
|
|
1653
|
+
* >
|
|
1654
|
+
* > - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
|
|
1655
|
+
* > - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
|
|
1656
|
+
* >
|
|
1657
|
+
* > The last option is definitely more attractive. And if you use [ForceReply](https://core.telegram.org/bots/api#forcereply) in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions - without any extra work for the user.
|
|
1658
|
+
*/
|
|
1659
|
+
export interface ForceReply {
|
|
1660
|
+
/** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */
|
|
1661
|
+
force_reply: true
|
|
1662
|
+
/** The placeholder to be shown in the input field when the reply is active; 1-64 characters */
|
|
1663
|
+
input_field_placeholder?: string
|
|
1664
|
+
/** 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](https://core.telegram.org/bots/api#message) object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. */
|
|
1665
|
+
selective?: boolean
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/** This object represents a chat photo. */
|
|
1669
|
+
export interface ChatPhoto {
|
|
1670
|
+
/** 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. */
|
|
1671
|
+
small_file_id: string
|
|
1672
|
+
/** 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. */
|
|
1673
|
+
small_file_unique_id: string
|
|
1674
|
+
/** 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. */
|
|
1675
|
+
big_file_id: string
|
|
1676
|
+
/** 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. */
|
|
1677
|
+
big_file_unique_id: string
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
/** Represents an invite link for a chat. */
|
|
1681
|
+
export interface ChatInviteLink {
|
|
1682
|
+
/** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */
|
|
1683
|
+
invite_link: string
|
|
1684
|
+
/** Creator of the link */
|
|
1685
|
+
creator: User
|
|
1686
|
+
/** _True_, if users joining the chat via the link need to be approved by chat administrators */
|
|
1687
|
+
creates_join_request: boolean
|
|
1688
|
+
/** _True_, if the link is primary */
|
|
1689
|
+
is_primary: boolean
|
|
1690
|
+
/** _True_, if the link is revoked */
|
|
1691
|
+
is_revoked: boolean
|
|
1692
|
+
/** Invite link name */
|
|
1693
|
+
name?: string
|
|
1694
|
+
/** Point in time (Unix timestamp) when the link will expire or has been expired */
|
|
1695
|
+
expire_date?: number
|
|
1696
|
+
/** The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */
|
|
1697
|
+
member_limit?: number
|
|
1698
|
+
/** Number of pending join requests created using this link */
|
|
1699
|
+
pending_join_request_count?: number
|
|
1700
|
+
/** The number of seconds the subscription will be active for before the next payment */
|
|
1701
|
+
subscription_period?: number
|
|
1702
|
+
/** The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link */
|
|
1703
|
+
subscription_price?: number
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
/** Represents the rights of an administrator in a chat. */
|
|
1707
|
+
export interface ChatAdministratorRights {
|
|
1708
|
+
/** _True_, if the user's presence in the chat is hidden */
|
|
1709
|
+
is_anonymous: boolean
|
|
1710
|
+
/** _True_, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
1711
|
+
can_manage_chat: boolean
|
|
1712
|
+
/** _True_, if the administrator can delete messages of other users */
|
|
1713
|
+
can_delete_messages: boolean
|
|
1714
|
+
/** _True_, if the administrator can manage video chats */
|
|
1715
|
+
can_manage_video_chats: boolean
|
|
1716
|
+
/** _True_, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */
|
|
1717
|
+
can_restrict_members: boolean
|
|
1718
|
+
/** _True_, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
|
|
1719
|
+
can_promote_members: boolean
|
|
1720
|
+
/** _True_, if the user is allowed to change the chat title, photo and other settings */
|
|
1721
|
+
can_change_info: boolean
|
|
1722
|
+
/** _True_, if the user is allowed to invite new users to the chat */
|
|
1723
|
+
can_invite_users: boolean
|
|
1724
|
+
/** _True_, if the administrator can post stories to the chat */
|
|
1725
|
+
can_post_stories: boolean
|
|
1726
|
+
/** _True_, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
|
|
1727
|
+
can_edit_stories: boolean
|
|
1728
|
+
/** _True_, if the administrator can delete stories posted by other users */
|
|
1729
|
+
can_delete_stories: boolean
|
|
1730
|
+
/** _True_, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
1731
|
+
can_post_messages?: boolean
|
|
1732
|
+
/** _True_, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
1733
|
+
can_edit_messages?: boolean
|
|
1734
|
+
/** _True_, if the user is allowed to pin messages; for groups and supergroups only */
|
|
1735
|
+
can_pin_messages?: boolean
|
|
1736
|
+
/** _True_, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
1737
|
+
can_manage_topics?: boolean
|
|
1738
|
+
/** _True_, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
|
|
1739
|
+
can_manage_direct_messages?: boolean
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
/** This object represents changes in the status of a chat member. */
|
|
1743
|
+
export interface ChatMemberUpdated {
|
|
1744
|
+
/** Chat the user belongs to */
|
|
1745
|
+
chat: Chat
|
|
1746
|
+
/** Performer of the action, which resulted in the change */
|
|
1747
|
+
from: User
|
|
1748
|
+
/** Date the change was done in Unix time */
|
|
1749
|
+
date: number
|
|
1750
|
+
/** Previous information about the chat member */
|
|
1751
|
+
old_chat_member: ChatMember
|
|
1752
|
+
/** New information about the chat member */
|
|
1753
|
+
new_chat_member: ChatMember
|
|
1754
|
+
/** Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */
|
|
1755
|
+
invite_link?: ChatInviteLink
|
|
1756
|
+
/** _True_, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator */
|
|
1757
|
+
via_join_request?: boolean
|
|
1758
|
+
/** _True_, if the user joined the chat via a chat folder invite link */
|
|
1759
|
+
via_chat_folder_invite_link?: boolean
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
|
|
1764
|
+
*
|
|
1765
|
+
* - [ChatMemberOwner](https://core.telegram.org/bots/api#chatmemberowner)
|
|
1766
|
+
* - [ChatMemberAdministrator](https://core.telegram.org/bots/api#chatmemberadministrator)
|
|
1767
|
+
* - [ChatMemberMember](https://core.telegram.org/bots/api#chatmembermember)
|
|
1768
|
+
* - [ChatMemberRestricted](https://core.telegram.org/bots/api#chatmemberrestricted)
|
|
1769
|
+
* - [ChatMemberLeft](https://core.telegram.org/bots/api#chatmemberleft)
|
|
1770
|
+
* - [ChatMemberBanned](https://core.telegram.org/bots/api#chatmemberbanned)
|
|
1771
|
+
*/
|
|
1772
|
+
export type ChatMember = ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned
|
|
1773
|
+
|
|
1774
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that owns the chat and has all administrator privileges. */
|
|
1775
|
+
export interface ChatMemberOwner {
|
|
1776
|
+
/** The member's status in the chat, always “creator” */
|
|
1777
|
+
status: string
|
|
1778
|
+
/** Information about the user */
|
|
1779
|
+
user: User
|
|
1780
|
+
/** _True_, if the user's presence in the chat is hidden */
|
|
1781
|
+
is_anonymous: boolean
|
|
1782
|
+
/** Custom title for this user */
|
|
1783
|
+
custom_title?: string
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that has some additional privileges. */
|
|
1787
|
+
export interface ChatMemberAdministrator {
|
|
1788
|
+
/** The member's status in the chat, always “administrator” */
|
|
1789
|
+
status: string
|
|
1790
|
+
/** Information about the user */
|
|
1791
|
+
user: User
|
|
1792
|
+
/** _True_, if the bot is allowed to edit administrator privileges of that user */
|
|
1793
|
+
can_be_edited: boolean
|
|
1794
|
+
/** _True_, if the user's presence in the chat is hidden */
|
|
1795
|
+
is_anonymous: boolean
|
|
1796
|
+
/** _True_, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege. */
|
|
1797
|
+
can_manage_chat: boolean
|
|
1798
|
+
/** _True_, if the administrator can delete messages of other users */
|
|
1799
|
+
can_delete_messages: boolean
|
|
1800
|
+
/** _True_, if the administrator can manage video chats */
|
|
1801
|
+
can_manage_video_chats: boolean
|
|
1802
|
+
/** _True_, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */
|
|
1803
|
+
can_restrict_members: boolean
|
|
1804
|
+
/** _True_, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) */
|
|
1805
|
+
can_promote_members: boolean
|
|
1806
|
+
/** _True_, if the user is allowed to change the chat title, photo and other settings */
|
|
1807
|
+
can_change_info: boolean
|
|
1808
|
+
/** _True_, if the user is allowed to invite new users to the chat */
|
|
1809
|
+
can_invite_users: boolean
|
|
1810
|
+
/** _True_, if the administrator can post stories to the chat */
|
|
1811
|
+
can_post_stories: boolean
|
|
1812
|
+
/** _True_, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat's story archive */
|
|
1813
|
+
can_edit_stories: boolean
|
|
1814
|
+
/** _True_, if the administrator can delete stories posted by other users */
|
|
1815
|
+
can_delete_stories: boolean
|
|
1816
|
+
/** _True_, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */
|
|
1817
|
+
can_post_messages?: boolean
|
|
1818
|
+
/** _True_, if the administrator can edit messages of other users and can pin messages; for channels only */
|
|
1819
|
+
can_edit_messages?: boolean
|
|
1820
|
+
/** _True_, if the user is allowed to pin messages; for groups and supergroups only */
|
|
1821
|
+
can_pin_messages?: boolean
|
|
1822
|
+
/** _True_, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */
|
|
1823
|
+
can_manage_topics?: boolean
|
|
1824
|
+
/** _True_, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
|
|
1825
|
+
can_manage_direct_messages?: boolean
|
|
1826
|
+
/** Custom title for this user */
|
|
1827
|
+
custom_title?: string
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that has no additional privileges or restrictions. */
|
|
1831
|
+
export interface ChatMemberMember {
|
|
1832
|
+
/** The member's status in the chat, always “member” */
|
|
1833
|
+
status: string
|
|
1834
|
+
/** Information about the user */
|
|
1835
|
+
user: User
|
|
1836
|
+
/** Date when the user's subscription will expire; Unix time */
|
|
1837
|
+
until_date?: number
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that is under certain restrictions in the chat. Supergroups only. */
|
|
1841
|
+
export interface ChatMemberRestricted {
|
|
1842
|
+
/** The member's status in the chat, always “restricted” */
|
|
1843
|
+
status: string
|
|
1844
|
+
/** Information about the user */
|
|
1845
|
+
user: User
|
|
1846
|
+
/** _True_, if the user is a member of the chat at the moment of the request */
|
|
1847
|
+
is_member: boolean
|
|
1848
|
+
/** _True_, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
|
|
1849
|
+
can_send_messages: boolean
|
|
1850
|
+
/** _True_, if the user is allowed to send audios */
|
|
1851
|
+
can_send_audios: boolean
|
|
1852
|
+
/** _True_, if the user is allowed to send documents */
|
|
1853
|
+
can_send_documents: boolean
|
|
1854
|
+
/** _True_, if the user is allowed to send photos */
|
|
1855
|
+
can_send_photos: boolean
|
|
1856
|
+
/** _True_, if the user is allowed to send videos */
|
|
1857
|
+
can_send_videos: boolean
|
|
1858
|
+
/** _True_, if the user is allowed to send video notes */
|
|
1859
|
+
can_send_video_notes: boolean
|
|
1860
|
+
/** _True_, if the user is allowed to send voice notes */
|
|
1861
|
+
can_send_voice_notes: boolean
|
|
1862
|
+
/** _True_, if the user is allowed to send polls and checklists */
|
|
1863
|
+
can_send_polls: boolean
|
|
1864
|
+
/** _True_, if the user is allowed to send animations, games, stickers and use inline bots */
|
|
1865
|
+
can_send_other_messages: boolean
|
|
1866
|
+
/** _True_, if the user is allowed to add web page previews to their messages */
|
|
1867
|
+
can_add_web_page_previews: boolean
|
|
1868
|
+
/** _True_, if the user is allowed to change the chat title, photo and other settings */
|
|
1869
|
+
can_change_info: boolean
|
|
1870
|
+
/** _True_, if the user is allowed to invite new users to the chat */
|
|
1871
|
+
can_invite_users: boolean
|
|
1872
|
+
/** _True_, if the user is allowed to pin messages */
|
|
1873
|
+
can_pin_messages: boolean
|
|
1874
|
+
/** _True_, if the user is allowed to create forum topics */
|
|
1875
|
+
can_manage_topics: boolean
|
|
1876
|
+
/** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever */
|
|
1877
|
+
until_date: number
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that isn't currently a member of the chat, but may join it themselves. */
|
|
1881
|
+
export interface ChatMemberLeft {
|
|
1882
|
+
/** The member's status in the chat, always “left” */
|
|
1883
|
+
status: string
|
|
1884
|
+
/** Information about the user */
|
|
1885
|
+
user: User
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/** Represents a [chat member](https://core.telegram.org/bots/api#chatmember) that was banned in the chat and can't return to the chat or view chat messages. */
|
|
1889
|
+
export interface ChatMemberBanned {
|
|
1890
|
+
/** The member's status in the chat, always “kicked” */
|
|
1891
|
+
status: string
|
|
1892
|
+
/** Information about the user */
|
|
1893
|
+
user: User
|
|
1894
|
+
/** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever */
|
|
1895
|
+
until_date: number
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
/** Represents a join request sent to a chat. */
|
|
1899
|
+
export interface ChatJoinRequest {
|
|
1900
|
+
/** Chat to which the request was sent */
|
|
1901
|
+
chat: Chat
|
|
1902
|
+
/** User that sent the join request */
|
|
1903
|
+
from: User
|
|
1904
|
+
/** Identifier of a private chat with the user who sent the join request. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. */
|
|
1905
|
+
user_chat_id: number
|
|
1906
|
+
/** Date the request was sent in Unix time */
|
|
1907
|
+
date: number
|
|
1908
|
+
/** Bio of the user. */
|
|
1909
|
+
bio?: string
|
|
1910
|
+
/** Chat invite link that was used by the user to send the join request */
|
|
1911
|
+
invite_link?: ChatInviteLink
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/** Describes actions that a non-administrator user is allowed to take in a chat. */
|
|
1915
|
+
export interface ChatPermissions {
|
|
1916
|
+
/** _True_, if the user is allowed to send text messages, contacts, giveaways, giveaway winners, invoices, locations and venues */
|
|
1917
|
+
can_send_messages?: boolean
|
|
1918
|
+
/** _True_, if the user is allowed to send audios */
|
|
1919
|
+
can_send_audios?: boolean
|
|
1920
|
+
/** _True_, if the user is allowed to send documents */
|
|
1921
|
+
can_send_documents?: boolean
|
|
1922
|
+
/** _True_, if the user is allowed to send photos */
|
|
1923
|
+
can_send_photos?: boolean
|
|
1924
|
+
/** _True_, if the user is allowed to send videos */
|
|
1925
|
+
can_send_videos?: boolean
|
|
1926
|
+
/** _True_, if the user is allowed to send video notes */
|
|
1927
|
+
can_send_video_notes?: boolean
|
|
1928
|
+
/** _True_, if the user is allowed to send voice notes */
|
|
1929
|
+
can_send_voice_notes?: boolean
|
|
1930
|
+
/** _True_, if the user is allowed to send polls and checklists */
|
|
1931
|
+
can_send_polls?: boolean
|
|
1932
|
+
/** _True_, if the user is allowed to send animations, games, stickers and use inline bots */
|
|
1933
|
+
can_send_other_messages?: boolean
|
|
1934
|
+
/** _True_, if the user is allowed to add web page previews to their messages */
|
|
1935
|
+
can_add_web_page_previews?: boolean
|
|
1936
|
+
/** _True_, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
|
|
1937
|
+
can_change_info?: boolean
|
|
1938
|
+
/** _True_, if the user is allowed to invite new users to the chat */
|
|
1939
|
+
can_invite_users?: boolean
|
|
1940
|
+
/** _True_, if the user is allowed to pin messages. Ignored in public supergroups */
|
|
1941
|
+
can_pin_messages?: boolean
|
|
1942
|
+
/** _True_, if the user is allowed to create forum topics. If omitted defaults to the value of can\_pin\_messages */
|
|
1943
|
+
can_manage_topics?: boolean
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/** Describes the birthdate of a user. */
|
|
1947
|
+
export interface Birthdate {
|
|
1948
|
+
/** Day of the user's birth; 1-31 */
|
|
1949
|
+
day: number
|
|
1950
|
+
/** Month of the user's birth; 1-12 */
|
|
1951
|
+
month: number
|
|
1952
|
+
/** Year of the user's birth */
|
|
1953
|
+
year?: number
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
/** Contains information about the start page settings of a Telegram Business account. */
|
|
1957
|
+
export interface BusinessIntro {
|
|
1958
|
+
/** Title text of the business intro */
|
|
1959
|
+
title?: string
|
|
1960
|
+
/** Message text of the business intro */
|
|
1961
|
+
message?: string
|
|
1962
|
+
/** Sticker of the business intro */
|
|
1963
|
+
sticker?: Sticker
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
/** Contains information about the location of a Telegram Business account. */
|
|
1967
|
+
export interface BusinessLocation {
|
|
1968
|
+
/** Address of the business */
|
|
1969
|
+
address: string
|
|
1970
|
+
/** Location of the business */
|
|
1971
|
+
location?: Location
|
|
1972
|
+
}
|
|
1973
|
+
|
|
1974
|
+
/** Describes an interval of time during which a business is open. */
|
|
1975
|
+
export interface BusinessOpeningHoursInterval {
|
|
1976
|
+
/** The minute's sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 \* 24 \* 60 */
|
|
1977
|
+
opening_minute: number
|
|
1978
|
+
/** The minute's sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 \* 24 \* 60 */
|
|
1979
|
+
closing_minute: number
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
/** Describes the opening hours of a business. */
|
|
1983
|
+
export interface BusinessOpeningHours {
|
|
1984
|
+
/** Unique name of the time zone for which the opening hours are defined */
|
|
1985
|
+
time_zone_name: string
|
|
1986
|
+
/** List of time intervals describing business opening hours */
|
|
1987
|
+
opening_hours: Array<BusinessOpeningHoursInterval>
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
/** Describes the position of a clickable area within a story. */
|
|
1991
|
+
export interface StoryAreaPosition {
|
|
1992
|
+
/** The abscissa of the area's center, as a percentage of the media width */
|
|
1993
|
+
x_percentage: number
|
|
1994
|
+
/** The ordinate of the area's center, as a percentage of the media height */
|
|
1995
|
+
y_percentage: number
|
|
1996
|
+
/** The width of the area's rectangle, as a percentage of the media width */
|
|
1997
|
+
width_percentage: number
|
|
1998
|
+
/** The height of the area's rectangle, as a percentage of the media height */
|
|
1999
|
+
height_percentage: number
|
|
2000
|
+
/** The clockwise rotation angle of the rectangle, in degrees; 0-360 */
|
|
2001
|
+
rotation_angle: number
|
|
2002
|
+
/** The radius of the rectangle corner rounding, as a percentage of the media width */
|
|
2003
|
+
corner_radius_percentage: number
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
/** Describes the physical address of a location. */
|
|
2007
|
+
export interface LocationAddress {
|
|
2008
|
+
/** The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located */
|
|
2009
|
+
country_code: string
|
|
2010
|
+
/** State of the location */
|
|
2011
|
+
state?: string
|
|
2012
|
+
/** City of the location */
|
|
2013
|
+
city?: string
|
|
2014
|
+
/** Street address of the location */
|
|
2015
|
+
street?: string
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
/**
|
|
2019
|
+
* Describes the type of a clickable area on a story. Currently, it can be one of
|
|
2020
|
+
*
|
|
2021
|
+
* - [StoryAreaTypeLocation](https://core.telegram.org/bots/api#storyareatypelocation)
|
|
2022
|
+
* - [StoryAreaTypeSuggestedReaction](https://core.telegram.org/bots/api#storyareatypesuggestedreaction)
|
|
2023
|
+
* - [StoryAreaTypeLink](https://core.telegram.org/bots/api#storyareatypelink)
|
|
2024
|
+
* - [StoryAreaTypeWeather](https://core.telegram.org/bots/api#storyareatypeweather)
|
|
2025
|
+
* - [StoryAreaTypeUniqueGift](https://core.telegram.org/bots/api#storyareatypeuniquegift)
|
|
2026
|
+
*/
|
|
2027
|
+
export type StoryAreaType = StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift
|
|
2028
|
+
|
|
2029
|
+
/** Describes a story area pointing to a location. Currently, a story can have up to 10 location areas. */
|
|
2030
|
+
export interface StoryAreaTypeLocation {
|
|
2031
|
+
/** Type of the area, always “location” */
|
|
2032
|
+
type: string
|
|
2033
|
+
/** Location latitude in degrees */
|
|
2034
|
+
latitude: number
|
|
2035
|
+
/** Location longitude in degrees */
|
|
2036
|
+
longitude: number
|
|
2037
|
+
/** Address of the location */
|
|
2038
|
+
address?: LocationAddress
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
/** Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas. */
|
|
2042
|
+
export interface StoryAreaTypeSuggestedReaction {
|
|
2043
|
+
/** Type of the area, always “suggested\_reaction” */
|
|
2044
|
+
type: string
|
|
2045
|
+
/** Type of the reaction */
|
|
2046
|
+
reaction_type: ReactionType
|
|
2047
|
+
/** Pass _True_ if the reaction area has a dark background */
|
|
2048
|
+
is_dark?: boolean
|
|
2049
|
+
/** Pass _True_ if reaction area corner is flipped */
|
|
2050
|
+
is_flipped?: boolean
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
/** Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas. */
|
|
2054
|
+
export interface StoryAreaTypeLink {
|
|
2055
|
+
/** Type of the area, always “link” */
|
|
2056
|
+
type: string
|
|
2057
|
+
/** HTTP or tg:// URL to be opened when the area is clicked */
|
|
2058
|
+
url: string
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
/** Describes a story area containing weather information. Currently, a story can have up to 3 weather areas. */
|
|
2062
|
+
export interface StoryAreaTypeWeather {
|
|
2063
|
+
/** Type of the area, always “weather” */
|
|
2064
|
+
type: string
|
|
2065
|
+
/** Temperature, in degree Celsius */
|
|
2066
|
+
temperature: number
|
|
2067
|
+
/** Emoji representing the weather */
|
|
2068
|
+
emoji: string
|
|
2069
|
+
/** A color of the area background in the ARGB format */
|
|
2070
|
+
background_color: number
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
/** Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area. */
|
|
2074
|
+
export interface StoryAreaTypeUniqueGift {
|
|
2075
|
+
/** Type of the area, always “unique\_gift” */
|
|
2076
|
+
type: string
|
|
2077
|
+
/** Unique name of the gift */
|
|
2078
|
+
name: string
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
/** Describes a clickable area on a story media. */
|
|
2082
|
+
export interface StoryArea {
|
|
2083
|
+
/** Position of the area */
|
|
2084
|
+
position: StoryAreaPosition
|
|
2085
|
+
/** Type of the area */
|
|
2086
|
+
type: StoryAreaType
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
/** Represents a location to which a chat is connected. */
|
|
2090
|
+
export interface ChatLocation {
|
|
2091
|
+
/** The location to which the supergroup is connected. Can't be a live location. */
|
|
2092
|
+
location: Location
|
|
2093
|
+
/** Location address; 1-64 characters, as defined by the chat owner */
|
|
2094
|
+
address: string
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* This object describes the type of a reaction. Currently, it can be one of
|
|
2099
|
+
*
|
|
2100
|
+
* - [ReactionTypeEmoji](https://core.telegram.org/bots/api#reactiontypeemoji)
|
|
2101
|
+
* - [ReactionTypeCustomEmoji](https://core.telegram.org/bots/api#reactiontypecustomemoji)
|
|
2102
|
+
* - [ReactionTypePaid](https://core.telegram.org/bots/api#reactiontypepaid)
|
|
2103
|
+
*/
|
|
2104
|
+
export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid
|
|
2105
|
+
|
|
2106
|
+
/** The reaction is based on an emoji. */
|
|
2107
|
+
export interface ReactionTypeEmoji {
|
|
2108
|
+
/** Type of the reaction, always “emoji” */
|
|
2109
|
+
type: string
|
|
2110
|
+
/** Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" */
|
|
2111
|
+
emoji: string
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/** The reaction is based on a custom emoji. */
|
|
2115
|
+
export interface ReactionTypeCustomEmoji {
|
|
2116
|
+
/** Type of the reaction, always “custom\_emoji” */
|
|
2117
|
+
type: string
|
|
2118
|
+
/** Custom emoji identifier */
|
|
2119
|
+
custom_emoji_id: string
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
/** The reaction is paid. */
|
|
2123
|
+
export interface ReactionTypePaid {
|
|
2124
|
+
/** Type of the reaction, always “paid” */
|
|
2125
|
+
type: string
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
/** Represents a reaction added to a message along with the number of times it was added. */
|
|
2129
|
+
export interface ReactionCount {
|
|
2130
|
+
/** Type of the reaction */
|
|
2131
|
+
type: ReactionType
|
|
2132
|
+
/** Number of times the reaction was added */
|
|
2133
|
+
total_count: number
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
/** This object represents a change of a reaction on a message performed by a user. */
|
|
2137
|
+
export interface MessageReactionUpdated {
|
|
2138
|
+
/** The chat containing the message the user reacted to */
|
|
2139
|
+
chat: Chat
|
|
2140
|
+
/** Unique identifier of the message inside the chat */
|
|
2141
|
+
message_id: number
|
|
2142
|
+
/** The user that changed the reaction, if the user isn't anonymous */
|
|
2143
|
+
user?: User
|
|
2144
|
+
/** The chat on behalf of which the reaction was changed, if the user is anonymous */
|
|
2145
|
+
actor_chat?: Chat
|
|
2146
|
+
/** Date of the change in Unix time */
|
|
2147
|
+
date: number
|
|
2148
|
+
/** Previous list of reaction types that were set by the user */
|
|
2149
|
+
old_reaction: Array<ReactionType>
|
|
2150
|
+
/** New list of reaction types that have been set by the user */
|
|
2151
|
+
new_reaction: Array<ReactionType>
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
/** This object represents reaction changes on a message with anonymous reactions. */
|
|
2155
|
+
export interface MessageReactionCountUpdated {
|
|
2156
|
+
/** The chat containing the message */
|
|
2157
|
+
chat: Chat
|
|
2158
|
+
/** Unique message identifier inside the chat */
|
|
2159
|
+
message_id: number
|
|
2160
|
+
/** Date of the change in Unix time */
|
|
2161
|
+
date: number
|
|
2162
|
+
/** List of reactions that are present on the message */
|
|
2163
|
+
reactions: Array<ReactionCount>
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
/** This object represents a forum topic. */
|
|
2167
|
+
export interface ForumTopic {
|
|
2168
|
+
/** Unique identifier of the forum topic */
|
|
2169
|
+
message_thread_id: number
|
|
2170
|
+
/** Name of the topic */
|
|
2171
|
+
name: string
|
|
2172
|
+
/** Color of the topic icon in RGB format */
|
|
2173
|
+
icon_color: number
|
|
2174
|
+
/** Unique identifier of the custom emoji shown as the topic icon */
|
|
2175
|
+
icon_custom_emoji_id?: string
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
/** This object represents a gift that can be sent by the bot. */
|
|
2179
|
+
export interface Gift {
|
|
2180
|
+
/** Unique identifier of the gift */
|
|
2181
|
+
id: string
|
|
2182
|
+
/** The sticker that represents the gift */
|
|
2183
|
+
sticker: Sticker
|
|
2184
|
+
/** The number of Telegram Stars that must be paid to send the sticker */
|
|
2185
|
+
star_count: number
|
|
2186
|
+
/** The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
|
|
2187
|
+
upgrade_star_count?: number
|
|
2188
|
+
/** The total number of the gifts of this type that can be sent; for limited gifts only */
|
|
2189
|
+
total_count?: number
|
|
2190
|
+
/** The number of remaining gifts of this type that can be sent; for limited gifts only */
|
|
2191
|
+
remaining_count?: number
|
|
2192
|
+
/** Information about the chat that published the gift */
|
|
2193
|
+
publisher_chat?: Chat
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
/** This object represent a list of gifts. */
|
|
2197
|
+
export interface Gifts {
|
|
2198
|
+
/** The list of gifts */
|
|
2199
|
+
gifts: Array<Gift>
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
/** This object describes the model of a unique gift. */
|
|
2203
|
+
export interface UniqueGiftModel {
|
|
2204
|
+
/** Name of the model */
|
|
2205
|
+
name: string
|
|
2206
|
+
/** The sticker that represents the unique gift */
|
|
2207
|
+
sticker: Sticker
|
|
2208
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
2209
|
+
rarity_per_mille: number
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
/** This object describes the symbol shown on the pattern of a unique gift. */
|
|
2213
|
+
export interface UniqueGiftSymbol {
|
|
2214
|
+
/** Name of the symbol */
|
|
2215
|
+
name: string
|
|
2216
|
+
/** The sticker that represents the unique gift */
|
|
2217
|
+
sticker: Sticker
|
|
2218
|
+
/** The number of unique gifts that receive this model for every 1000 gifts upgraded */
|
|
2219
|
+
rarity_per_mille: number
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
/** This object describes the colors of the backdrop of a unique gift. */
|
|
2223
|
+
export interface UniqueGiftBackdropColors {
|
|
2224
|
+
/** The color in the center of the backdrop in RGB format */
|
|
2225
|
+
center_color: number
|
|
2226
|
+
/** The color on the edges of the backdrop in RGB format */
|
|
2227
|
+
edge_color: number
|
|
2228
|
+
/** The color to be applied to the symbol in RGB format */
|
|
2229
|
+
symbol_color: number
|
|
2230
|
+
/** The color for the text on the backdrop in RGB format */
|
|
2231
|
+
text_color: number
|
|
2232
|
+
}
|
|
2233
|
+
|
|
2234
|
+
/** This object describes the backdrop of a unique gift. */
|
|
2235
|
+
export interface UniqueGiftBackdrop {
|
|
2236
|
+
/** Name of the backdrop */
|
|
2237
|
+
name: string
|
|
2238
|
+
/** Colors of the backdrop */
|
|
2239
|
+
colors: UniqueGiftBackdropColors
|
|
2240
|
+
/** The number of unique gifts that receive this backdrop for every 1000 gifts upgraded */
|
|
2241
|
+
rarity_per_mille: number
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
/** This object describes a unique gift that was upgraded from a regular gift. */
|
|
2245
|
+
export interface UniqueGift {
|
|
2246
|
+
/** Human-readable name of the regular gift from which this unique gift was upgraded */
|
|
2247
|
+
base_name: string
|
|
2248
|
+
/** Unique name of the gift. This name can be used in `https://t.me/nft/...` links and story areas */
|
|
2249
|
+
name: string
|
|
2250
|
+
/** Unique number of the upgraded gift among gifts upgraded from the same regular gift */
|
|
2251
|
+
number: number
|
|
2252
|
+
/** Model of the gift */
|
|
2253
|
+
model: UniqueGiftModel
|
|
2254
|
+
/** Symbol of the gift */
|
|
2255
|
+
symbol: UniqueGiftSymbol
|
|
2256
|
+
/** Backdrop of the gift */
|
|
2257
|
+
backdrop: UniqueGiftBackdrop
|
|
2258
|
+
/** Information about the chat that published the gift */
|
|
2259
|
+
publisher_chat?: Chat
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
/** Describes a service message about a regular gift that was sent or received. */
|
|
2263
|
+
export interface GiftInfo {
|
|
2264
|
+
/** Information about the gift */
|
|
2265
|
+
gift: Gift
|
|
2266
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
2267
|
+
owned_gift_id?: string
|
|
2268
|
+
/** Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */
|
|
2269
|
+
convert_star_count?: number
|
|
2270
|
+
/** Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
|
|
2271
|
+
prepaid_upgrade_star_count?: number
|
|
2272
|
+
/** _True_, if the gift can be upgraded to a unique gift */
|
|
2273
|
+
can_be_upgraded?: true
|
|
2274
|
+
/** Text of the message that was added to the gift */
|
|
2275
|
+
text?: string
|
|
2276
|
+
/** Special entities that appear in the text */
|
|
2277
|
+
entities?: Array<MessageEntity>
|
|
2278
|
+
/** _True_, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
2279
|
+
is_private?: true
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
/** Describes a service message about a unique gift that was sent or received. */
|
|
2283
|
+
export interface UniqueGiftInfo {
|
|
2284
|
+
/** Information about the gift */
|
|
2285
|
+
gift: UniqueGift
|
|
2286
|
+
/** Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, or “resale” for gifts bought from other users */
|
|
2287
|
+
origin: string
|
|
2288
|
+
/** For gifts bought from other users, the price paid for the gift */
|
|
2289
|
+
last_resale_star_count?: number
|
|
2290
|
+
/** Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */
|
|
2291
|
+
owned_gift_id?: string
|
|
2292
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
2293
|
+
transfer_star_count?: number
|
|
2294
|
+
/** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
|
|
2295
|
+
next_transfer_date?: number
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
/**
|
|
2299
|
+
* This object describes a gift received and owned by a user or a chat. Currently, it can be one of
|
|
2300
|
+
*
|
|
2301
|
+
* - [OwnedGiftRegular](https://core.telegram.org/bots/api#ownedgiftregular)
|
|
2302
|
+
* - [OwnedGiftUnique](https://core.telegram.org/bots/api#ownedgiftunique)
|
|
2303
|
+
*/
|
|
2304
|
+
export type OwnedGift = OwnedGiftRegular | OwnedGiftUnique
|
|
2305
|
+
|
|
2306
|
+
/** Describes a regular gift owned by a user or a chat. */
|
|
2307
|
+
export interface OwnedGiftRegular {
|
|
2308
|
+
/** Type of the gift, always “regular” */
|
|
2309
|
+
type: string
|
|
2310
|
+
/** Information about the regular gift */
|
|
2311
|
+
gift: Gift
|
|
2312
|
+
/** Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only */
|
|
2313
|
+
owned_gift_id?: string
|
|
2314
|
+
/** Sender of the gift if it is a known user */
|
|
2315
|
+
sender_user?: User
|
|
2316
|
+
/** Date the gift was sent in Unix time */
|
|
2317
|
+
send_date: number
|
|
2318
|
+
/** Text of the message that was added to the gift */
|
|
2319
|
+
text?: string
|
|
2320
|
+
/** Special entities that appear in the text */
|
|
2321
|
+
entities?: Array<MessageEntity>
|
|
2322
|
+
/** _True_, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
|
|
2323
|
+
is_private?: true
|
|
2324
|
+
/** _True_, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
2325
|
+
is_saved?: true
|
|
2326
|
+
/** _True_, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only */
|
|
2327
|
+
can_be_upgraded?: true
|
|
2328
|
+
/** _True_, if the gift was refunded and isn't available anymore */
|
|
2329
|
+
was_refunded?: true
|
|
2330
|
+
/** Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars */
|
|
2331
|
+
convert_star_count?: number
|
|
2332
|
+
/** Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift */
|
|
2333
|
+
prepaid_upgrade_star_count?: number
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
/** Describes a unique gift received and owned by a user or a chat. */
|
|
2337
|
+
export interface OwnedGiftUnique {
|
|
2338
|
+
/** Type of the gift, always “unique” */
|
|
2339
|
+
type: string
|
|
2340
|
+
/** Information about the unique gift */
|
|
2341
|
+
gift: UniqueGift
|
|
2342
|
+
/** Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only */
|
|
2343
|
+
owned_gift_id?: string
|
|
2344
|
+
/** Sender of the gift if it is a known user */
|
|
2345
|
+
sender_user?: User
|
|
2346
|
+
/** Date the gift was sent in Unix time */
|
|
2347
|
+
send_date: number
|
|
2348
|
+
/** _True_, if the gift is displayed on the account's profile page; for gifts received on behalf of business accounts only */
|
|
2349
|
+
is_saved?: true
|
|
2350
|
+
/** _True_, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only */
|
|
2351
|
+
can_be_transferred?: true
|
|
2352
|
+
/** Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift */
|
|
2353
|
+
transfer_star_count?: number
|
|
2354
|
+
/** Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now */
|
|
2355
|
+
next_transfer_date?: number
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
/** Contains the list of gifts received and owned by a user or a chat. */
|
|
2359
|
+
export interface OwnedGifts {
|
|
2360
|
+
/** The total number of gifts owned by the user or the chat */
|
|
2361
|
+
total_count: number
|
|
2362
|
+
/** The list of gifts */
|
|
2363
|
+
gifts: Array<OwnedGift>
|
|
2364
|
+
/** Offset for the next request. If empty, then there are no more results */
|
|
2365
|
+
next_offset?: string
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/** This object describes the types of gifts that can be gifted to a user or a chat. */
|
|
2369
|
+
export interface AcceptedGiftTypes {
|
|
2370
|
+
/** _True_, if unlimited regular gifts are accepted */
|
|
2371
|
+
unlimited_gifts: boolean
|
|
2372
|
+
/** _True_, if limited regular gifts are accepted */
|
|
2373
|
+
limited_gifts: boolean
|
|
2374
|
+
/** _True_, if unique gifts or gifts that can be upgraded to unique for free are accepted */
|
|
2375
|
+
unique_gifts: boolean
|
|
2376
|
+
/** _True_, if a Telegram Premium subscription is accepted */
|
|
2377
|
+
premium_subscription: boolean
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
/** Describes an amount of Telegram Stars. */
|
|
2381
|
+
export interface StarAmount {
|
|
2382
|
+
/** Integer amount of Telegram Stars, rounded to 0; can be negative */
|
|
2383
|
+
amount: number
|
|
2384
|
+
/** The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if _amount_ is non-positive */
|
|
2385
|
+
nanostar_amount?: number
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
/** This object represents a bot command. */
|
|
2389
|
+
export interface BotCommand {
|
|
2390
|
+
/** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */
|
|
2391
|
+
command: string
|
|
2392
|
+
/** Description of the command; 1-256 characters. */
|
|
2393
|
+
description: string
|
|
2394
|
+
}
|
|
2395
|
+
|
|
2396
|
+
/**
|
|
2397
|
+
* This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
|
|
2398
|
+
*
|
|
2399
|
+
* - [BotCommandScopeDefault](https://core.telegram.org/bots/api#botcommandscopedefault)
|
|
2400
|
+
* - [BotCommandScopeAllPrivateChats](https://core.telegram.org/bots/api#botcommandscopeallprivatechats)
|
|
2401
|
+
* - [BotCommandScopeAllGroupChats](https://core.telegram.org/bots/api#botcommandscopeallgroupchats)
|
|
2402
|
+
* - [BotCommandScopeAllChatAdministrators](https://core.telegram.org/bots/api#botcommandscopeallchatadministrators)
|
|
2403
|
+
* - [BotCommandScopeChat](https://core.telegram.org/bots/api#botcommandscopechat)
|
|
2404
|
+
* - [BotCommandScopeChatAdministrators](https://core.telegram.org/bots/api#botcommandscopechatadministrators)
|
|
2405
|
+
* - [BotCommandScopeChatMember](https://core.telegram.org/bots/api#botcommandscopechatmember)
|
|
2406
|
+
*/
|
|
2407
|
+
export type BotCommandScope = BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember
|
|
2408
|
+
|
|
2409
|
+
/** Represents the default [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands. Default commands are used if no commands with a [narrower scope](https://core.telegram.org/bots/api#determining-list-of-commands) are specified for the user. */
|
|
2410
|
+
export interface BotCommandScopeDefault {
|
|
2411
|
+
/** Scope type, must be _default_ */
|
|
2412
|
+
type: string
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all private chats. */
|
|
2416
|
+
export interface BotCommandScopeAllPrivateChats {
|
|
2417
|
+
/** Scope type, must be _all\_private\_chats_ */
|
|
2418
|
+
type: string
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all group and supergroup chats. */
|
|
2422
|
+
export interface BotCommandScopeAllGroupChats {
|
|
2423
|
+
/** Scope type, must be _all\_group\_chats_ */
|
|
2424
|
+
type: string
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all group and supergroup chat administrators. */
|
|
2428
|
+
export interface BotCommandScopeAllChatAdministrators {
|
|
2429
|
+
/** Scope type, must be _all\_chat\_administrators_ */
|
|
2430
|
+
type: string
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering a specific chat. */
|
|
2434
|
+
export interface BotCommandScopeChat {
|
|
2435
|
+
/** Scope type, must be _chat_ */
|
|
2436
|
+
type: string
|
|
2437
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
|
|
2438
|
+
chat_id: number | string
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering all administrators of a specific group or supergroup chat. */
|
|
2442
|
+
export interface BotCommandScopeChatAdministrators {
|
|
2443
|
+
/** Scope type, must be _chat\_administrators_ */
|
|
2444
|
+
type: string
|
|
2445
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
|
|
2446
|
+
chat_id: number | string
|
|
2447
|
+
}
|
|
2448
|
+
|
|
2449
|
+
/** Represents the [scope](https://core.telegram.org/bots/api#botcommandscope) of bot commands, covering a specific member of a group or supergroup chat. */
|
|
2450
|
+
export interface BotCommandScopeChatMember {
|
|
2451
|
+
/** Scope type, must be _chat\_member_ */
|
|
2452
|
+
type: string
|
|
2453
|
+
/** Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`). Channel direct messages chats and channel chats aren't supported. */
|
|
2454
|
+
chat_id: number | string
|
|
2455
|
+
/** Unique identifier of the target user */
|
|
2456
|
+
user_id: number
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
/** This object represents the bot's name. */
|
|
2460
|
+
export interface BotName {
|
|
2461
|
+
/** The bot's name */
|
|
2462
|
+
name: string
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
/** This object represents the bot's description. */
|
|
2466
|
+
export interface BotDescription {
|
|
2467
|
+
/** The bot's description */
|
|
2468
|
+
description: string
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2471
|
+
/** This object represents the bot's short description. */
|
|
2472
|
+
export interface BotShortDescription {
|
|
2473
|
+
/** The bot's short description */
|
|
2474
|
+
short_description: string
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
/**
|
|
2478
|
+
* This object describes the bot's menu button in a private chat. It should be one of
|
|
2479
|
+
*
|
|
2480
|
+
* - [MenuButtonCommands](https://core.telegram.org/bots/api#menubuttoncommands)
|
|
2481
|
+
* - [MenuButtonWebApp](https://core.telegram.org/bots/api#menubuttonwebapp)
|
|
2482
|
+
* - [MenuButtonDefault](https://core.telegram.org/bots/api#menubuttondefault)
|
|
2483
|
+
*
|
|
2484
|
+
* If a menu button other than [MenuButtonDefault](https://core.telegram.org/bots/api#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.
|
|
2485
|
+
*/
|
|
2486
|
+
export type MenuButton = MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault
|
|
2487
|
+
|
|
2488
|
+
/** Represents a menu button, which opens the bot's list of commands. */
|
|
2489
|
+
export interface MenuButtonCommands {
|
|
2490
|
+
/** Type of the button, must be _commands_ */
|
|
2491
|
+
type: string
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
/** Represents a menu button, which launches a [Web App](https://core.telegram.org/bots/webapps). */
|
|
2495
|
+
export interface MenuButtonWebApp {
|
|
2496
|
+
/** Type of the button, must be _web\_app_ */
|
|
2497
|
+
type: string
|
|
2498
|
+
/** Text on the button */
|
|
2499
|
+
text: string
|
|
2500
|
+
/** 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](https://core.telegram.org/bots/api#answerwebappquery). Alternatively, a `t.me` link to a Web App of the bot can be specified in the object instead of the Web App's URL, in which case the Web App will be opened as if the user pressed the link. */
|
|
2501
|
+
web_app: WebAppInfo
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
/** Describes that no specific value for the menu button was set. */
|
|
2505
|
+
export interface MenuButtonDefault {
|
|
2506
|
+
/** Type of the button, must be _default_ */
|
|
2507
|
+
type: string
|
|
2508
|
+
}
|
|
2509
|
+
|
|
2510
|
+
/**
|
|
2511
|
+
* This object describes the source of a chat boost. It can be one of
|
|
2512
|
+
*
|
|
2513
|
+
* - [ChatBoostSourcePremium](https://core.telegram.org/bots/api#chatboostsourcepremium)
|
|
2514
|
+
* - [ChatBoostSourceGiftCode](https://core.telegram.org/bots/api#chatboostsourcegiftcode)
|
|
2515
|
+
* - [ChatBoostSourceGiveaway](https://core.telegram.org/bots/api#chatboostsourcegiveaway)
|
|
2516
|
+
*/
|
|
2517
|
+
export type ChatBoostSource = ChatBoostSourcePremium | ChatBoostSourceGiftCode | ChatBoostSourceGiveaway
|
|
2518
|
+
|
|
2519
|
+
/** The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. */
|
|
2520
|
+
export interface ChatBoostSourcePremium {
|
|
2521
|
+
/** Source of the boost, always “premium” */
|
|
2522
|
+
source: string
|
|
2523
|
+
/** User that boosted the chat */
|
|
2524
|
+
user: User
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
/** The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription. */
|
|
2528
|
+
export interface ChatBoostSourceGiftCode {
|
|
2529
|
+
/** Source of the boost, always “gift\_code” */
|
|
2530
|
+
source: string
|
|
2531
|
+
/** User for which the gift code was created */
|
|
2532
|
+
user: User
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
/** The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and _prize\_star\_count_ / 500 times for one year for Telegram Star giveaways. */
|
|
2536
|
+
export interface ChatBoostSourceGiveaway {
|
|
2537
|
+
/** Source of the boost, always “giveaway” */
|
|
2538
|
+
source: string
|
|
2539
|
+
/** Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet. */
|
|
2540
|
+
giveaway_message_id: number
|
|
2541
|
+
/** User that won the prize in the giveaway if any; for Telegram Premium giveaways only */
|
|
2542
|
+
user?: User
|
|
2543
|
+
/** The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */
|
|
2544
|
+
prize_star_count?: number
|
|
2545
|
+
/** _True_, if the giveaway was completed, but there was no user to win the prize */
|
|
2546
|
+
is_unclaimed?: true
|
|
2547
|
+
}
|
|
2548
|
+
|
|
2549
|
+
/** This object contains information about a chat boost. */
|
|
2550
|
+
export interface ChatBoost {
|
|
2551
|
+
/** Unique identifier of the boost */
|
|
2552
|
+
boost_id: string
|
|
2553
|
+
/** Point in time (Unix timestamp) when the chat was boosted */
|
|
2554
|
+
add_date: number
|
|
2555
|
+
/** Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */
|
|
2556
|
+
expiration_date: number
|
|
2557
|
+
/** Source of the added boost */
|
|
2558
|
+
source: ChatBoostSource
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
/** This object represents a boost added to a chat or changed. */
|
|
2562
|
+
export interface ChatBoostUpdated {
|
|
2563
|
+
/** Chat which was boosted */
|
|
2564
|
+
chat: Chat
|
|
2565
|
+
/** Information about the chat boost */
|
|
2566
|
+
boost: ChatBoost
|
|
2567
|
+
}
|
|
2568
|
+
|
|
2569
|
+
/** This object represents a boost removed from a chat. */
|
|
2570
|
+
export interface ChatBoostRemoved {
|
|
2571
|
+
/** Chat which was boosted */
|
|
2572
|
+
chat: Chat
|
|
2573
|
+
/** Unique identifier of the boost */
|
|
2574
|
+
boost_id: string
|
|
2575
|
+
/** Point in time (Unix timestamp) when the boost was removed */
|
|
2576
|
+
remove_date: number
|
|
2577
|
+
/** Source of the removed boost */
|
|
2578
|
+
source: ChatBoostSource
|
|
2579
|
+
}
|
|
2580
|
+
|
|
2581
|
+
/** This object represents a list of boosts added to a chat by a user. */
|
|
2582
|
+
export interface UserChatBoosts {
|
|
2583
|
+
/** The list of boosts added to the chat by the user */
|
|
2584
|
+
boosts: Array<ChatBoost>
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
/** Represents the rights of a business bot. */
|
|
2588
|
+
export interface BusinessBotRights {
|
|
2589
|
+
/** _True_, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */
|
|
2590
|
+
can_reply?: true
|
|
2591
|
+
/** _True_, if the bot can mark incoming private messages as read */
|
|
2592
|
+
can_read_messages?: true
|
|
2593
|
+
/** _True_, if the bot can delete messages sent by the bot */
|
|
2594
|
+
can_delete_sent_messages?: true
|
|
2595
|
+
/** _True_, if the bot can delete all private messages in managed chats */
|
|
2596
|
+
can_delete_all_messages?: true
|
|
2597
|
+
/** _True_, if the bot can edit the first and last name of the business account */
|
|
2598
|
+
can_edit_name?: true
|
|
2599
|
+
/** _True_, if the bot can edit the bio of the business account */
|
|
2600
|
+
can_edit_bio?: true
|
|
2601
|
+
/** _True_, if the bot can edit the profile photo of the business account */
|
|
2602
|
+
can_edit_profile_photo?: true
|
|
2603
|
+
/** _True_, if the bot can edit the username of the business account */
|
|
2604
|
+
can_edit_username?: true
|
|
2605
|
+
/** _True_, if the bot can change the privacy settings pertaining to gifts for the business account */
|
|
2606
|
+
can_change_gift_settings?: true
|
|
2607
|
+
/** _True_, if the bot can view gifts and the amount of Telegram Stars owned by the business account */
|
|
2608
|
+
can_view_gifts_and_stars?: true
|
|
2609
|
+
/** _True_, if the bot can convert regular gifts owned by the business account to Telegram Stars */
|
|
2610
|
+
can_convert_gifts_to_stars?: true
|
|
2611
|
+
/** _True_, if the bot can transfer and upgrade gifts owned by the business account */
|
|
2612
|
+
can_transfer_and_upgrade_gifts?: true
|
|
2613
|
+
/** _True_, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts */
|
|
2614
|
+
can_transfer_stars?: true
|
|
2615
|
+
/** _True_, if the bot can post, edit and delete stories on behalf of the business account */
|
|
2616
|
+
can_manage_stories?: true
|
|
2617
|
+
}
|
|
2618
|
+
|
|
2619
|
+
/** Describes the connection of the bot with a business account. */
|
|
2620
|
+
export interface BusinessConnection {
|
|
2621
|
+
/** Unique identifier of the business connection */
|
|
2622
|
+
id: string
|
|
2623
|
+
/** Business account user that created the business connection */
|
|
2624
|
+
user: User
|
|
2625
|
+
/** Identifier of a private chat with the user who created the business connection. */
|
|
2626
|
+
user_chat_id: number
|
|
2627
|
+
/** Date the connection was established in Unix time */
|
|
2628
|
+
date: number
|
|
2629
|
+
/** Rights of the business bot */
|
|
2630
|
+
rights?: BusinessBotRights
|
|
2631
|
+
/** _True_, if the connection is active */
|
|
2632
|
+
is_enabled: boolean
|
|
2633
|
+
}
|
|
2634
|
+
|
|
2635
|
+
/** This object is received when messages are deleted from a connected business account. */
|
|
2636
|
+
export interface BusinessMessagesDeleted {
|
|
2637
|
+
/** Unique identifier of the business connection */
|
|
2638
|
+
business_connection_id: string
|
|
2639
|
+
/** Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */
|
|
2640
|
+
chat: Chat
|
|
2641
|
+
/** The list of identifiers of deleted messages in the chat of the business account */
|
|
2642
|
+
message_ids: Array<number>
|
|
2643
|
+
}
|
|
2644
|
+
|
|
2645
|
+
/** Describes why a request was unsuccessful. */
|
|
2646
|
+
export interface ResponseParameters {
|
|
2647
|
+
/** The group has been migrated to a supergroup with the specified identifier. */
|
|
2648
|
+
migrate_to_chat_id?: number
|
|
2649
|
+
/** In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */
|
|
2650
|
+
retry_after?: number
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
/**
|
|
2654
|
+
* This object represents the content of a media message to be sent. It should be one of
|
|
2655
|
+
*
|
|
2656
|
+
* - [InputMediaAnimation](https://core.telegram.org/bots/api#inputmediaanimation)
|
|
2657
|
+
* - [InputMediaDocument](https://core.telegram.org/bots/api#inputmediadocument)
|
|
2658
|
+
* - [InputMediaAudio](https://core.telegram.org/bots/api#inputmediaaudio)
|
|
2659
|
+
* - [InputMediaPhoto](https://core.telegram.org/bots/api#inputmediaphoto)
|
|
2660
|
+
* - [InputMediaVideo](https://core.telegram.org/bots/api#inputmediavideo)
|
|
2661
|
+
*/
|
|
2662
|
+
export type InputMedia = InputMediaAnimation | InputMediaDocument | InputMediaAudio | InputMediaPhoto | InputMediaVideo
|
|
2663
|
+
|
|
2664
|
+
/** Represents a photo to be sent. */
|
|
2665
|
+
export interface InputMediaPhoto {
|
|
2666
|
+
/** Type of the result, must be _photo_ */
|
|
2667
|
+
type: string
|
|
2668
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2669
|
+
media: string
|
|
2670
|
+
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
2671
|
+
caption?: string
|
|
2672
|
+
/** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
2673
|
+
parse_mode?: string
|
|
2674
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
2675
|
+
caption_entities?: Array<MessageEntity>
|
|
2676
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
2677
|
+
show_caption_above_media?: boolean
|
|
2678
|
+
/** Pass _True_ if the photo needs to be covered with a spoiler animation */
|
|
2679
|
+
has_spoiler?: boolean
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
/** Represents a video to be sent. */
|
|
2683
|
+
export interface InputMediaVideo {
|
|
2684
|
+
/** Type of the result, must be _video_ */
|
|
2685
|
+
type: string
|
|
2686
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2687
|
+
media: string
|
|
2688
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2689
|
+
thumbnail?: string
|
|
2690
|
+
/** Cover for the video in the message. 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2691
|
+
cover?: string
|
|
2692
|
+
/** Start timestamp for the video in the message */
|
|
2693
|
+
start_timestamp?: number
|
|
2694
|
+
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
2695
|
+
caption?: string
|
|
2696
|
+
/** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
2697
|
+
parse_mode?: string
|
|
2698
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
2699
|
+
caption_entities?: Array<MessageEntity>
|
|
2700
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
2701
|
+
show_caption_above_media?: boolean
|
|
2702
|
+
/** Video width */
|
|
2703
|
+
width?: number
|
|
2704
|
+
/** Video height */
|
|
2705
|
+
height?: number
|
|
2706
|
+
/** Video duration in seconds */
|
|
2707
|
+
duration?: number
|
|
2708
|
+
/** Pass _True_ if the uploaded video is suitable for streaming */
|
|
2709
|
+
supports_streaming?: boolean
|
|
2710
|
+
/** Pass _True_ if the video needs to be covered with a spoiler animation */
|
|
2711
|
+
has_spoiler?: boolean
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
/** Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. */
|
|
2715
|
+
export interface InputMediaAnimation {
|
|
2716
|
+
/** Type of the result, must be _animation_ */
|
|
2717
|
+
type: string
|
|
2718
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2719
|
+
media: string
|
|
2720
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2721
|
+
thumbnail?: string
|
|
2722
|
+
/** Caption of the animation to be sent, 0-1024 characters after entities parsing */
|
|
2723
|
+
caption?: string
|
|
2724
|
+
/** Mode for parsing entities in the animation caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
2725
|
+
parse_mode?: string
|
|
2726
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
2727
|
+
caption_entities?: Array<MessageEntity>
|
|
2728
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
2729
|
+
show_caption_above_media?: boolean
|
|
2730
|
+
/** Animation width */
|
|
2731
|
+
width?: number
|
|
2732
|
+
/** Animation height */
|
|
2733
|
+
height?: number
|
|
2734
|
+
/** Animation duration in seconds */
|
|
2735
|
+
duration?: number
|
|
2736
|
+
/** Pass _True_ if the animation needs to be covered with a spoiler animation */
|
|
2737
|
+
has_spoiler?: boolean
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/** Represents an audio file to be treated as music to be sent. */
|
|
2741
|
+
export interface InputMediaAudio {
|
|
2742
|
+
/** Type of the result, must be _audio_ */
|
|
2743
|
+
type: string
|
|
2744
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2745
|
+
media: string
|
|
2746
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2747
|
+
thumbnail?: string
|
|
2748
|
+
/** Caption of the audio to be sent, 0-1024 characters after entities parsing */
|
|
2749
|
+
caption?: string
|
|
2750
|
+
/** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
2751
|
+
parse_mode?: string
|
|
2752
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
2753
|
+
caption_entities?: Array<MessageEntity>
|
|
2754
|
+
/** Duration of the audio in seconds */
|
|
2755
|
+
duration?: number
|
|
2756
|
+
/** Performer of the audio */
|
|
2757
|
+
performer?: string
|
|
2758
|
+
/** Title of the audio */
|
|
2759
|
+
title?: string
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
/** Represents a general file to be sent. */
|
|
2763
|
+
export interface InputMediaDocument {
|
|
2764
|
+
/** Type of the result, must be _document_ */
|
|
2765
|
+
type: string
|
|
2766
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2767
|
+
media: string
|
|
2768
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2769
|
+
thumbnail?: string
|
|
2770
|
+
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
|
|
2771
|
+
caption?: string
|
|
2772
|
+
/** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
2773
|
+
parse_mode?: string
|
|
2774
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
2775
|
+
caption_entities?: Array<MessageEntity>
|
|
2776
|
+
/** 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. */
|
|
2777
|
+
disable_content_type_detection?: boolean
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* This object describes the paid media to be sent. Currently, it can be one of
|
|
2782
|
+
*
|
|
2783
|
+
* - [InputPaidMediaPhoto](https://core.telegram.org/bots/api#inputpaidmediaphoto)
|
|
2784
|
+
* - [InputPaidMediaVideo](https://core.telegram.org/bots/api#inputpaidmediavideo)
|
|
2785
|
+
*/
|
|
2786
|
+
export type InputPaidMedia = InputPaidMediaPhoto | InputPaidMediaVideo
|
|
2787
|
+
|
|
2788
|
+
/** The paid media to send is a photo. */
|
|
2789
|
+
export interface InputPaidMediaPhoto {
|
|
2790
|
+
/** Type of the media, must be _photo_ */
|
|
2791
|
+
type: string
|
|
2792
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2793
|
+
media: string
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2796
|
+
/** The paid media to send is a video. */
|
|
2797
|
+
export interface InputPaidMediaVideo {
|
|
2798
|
+
/** Type of the media, must be _video_ */
|
|
2799
|
+
type: string
|
|
2800
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2801
|
+
media: string
|
|
2802
|
+
/** 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2803
|
+
thumbnail?: string
|
|
2804
|
+
/** Cover for the video in the message. 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 information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2805
|
+
cover?: string
|
|
2806
|
+
/** Start timestamp for the video in the message */
|
|
2807
|
+
start_timestamp?: number
|
|
2808
|
+
/** Video width */
|
|
2809
|
+
width?: number
|
|
2810
|
+
/** Video height */
|
|
2811
|
+
height?: number
|
|
2812
|
+
/** Video duration in seconds */
|
|
2813
|
+
duration?: number
|
|
2814
|
+
/** Pass _True_ if the uploaded video is suitable for streaming */
|
|
2815
|
+
supports_streaming?: boolean
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
/**
|
|
2819
|
+
* This object describes a profile photo to set. Currently, it can be one of
|
|
2820
|
+
*
|
|
2821
|
+
* - [InputProfilePhotoStatic](https://core.telegram.org/bots/api#inputprofilephotostatic)
|
|
2822
|
+
* - [InputProfilePhotoAnimated](https://core.telegram.org/bots/api#inputprofilephotoanimated)
|
|
2823
|
+
*/
|
|
2824
|
+
export type InputProfilePhoto = InputProfilePhotoStatic | InputProfilePhotoAnimated
|
|
2825
|
+
|
|
2826
|
+
/** A static profile photo in the .JPG format. */
|
|
2827
|
+
export interface InputProfilePhotoStatic {
|
|
2828
|
+
/** Type of the profile photo, must be _static_ */
|
|
2829
|
+
type: string
|
|
2830
|
+
/** The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2831
|
+
photo: string
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
/** An animated profile photo in the MPEG4 format. */
|
|
2835
|
+
export interface InputProfilePhotoAnimated {
|
|
2836
|
+
/** Type of the profile photo, must be _animated_ */
|
|
2837
|
+
type: string
|
|
2838
|
+
/** The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2839
|
+
animation: string
|
|
2840
|
+
/** Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */
|
|
2841
|
+
main_frame_timestamp?: number
|
|
2842
|
+
}
|
|
2843
|
+
|
|
2844
|
+
/**
|
|
2845
|
+
* This object describes the content of a story to post. Currently, it can be one of
|
|
2846
|
+
*
|
|
2847
|
+
* - [InputStoryContentPhoto](https://core.telegram.org/bots/api#inputstorycontentphoto)
|
|
2848
|
+
* - [InputStoryContentVideo](https://core.telegram.org/bots/api#inputstorycontentvideo)
|
|
2849
|
+
*/
|
|
2850
|
+
export type InputStoryContent = InputStoryContentPhoto | InputStoryContentVideo
|
|
2851
|
+
|
|
2852
|
+
/** Describes a photo to post as a story. */
|
|
2853
|
+
export interface InputStoryContentPhoto {
|
|
2854
|
+
/** Type of the content, must be _photo_ */
|
|
2855
|
+
type: string
|
|
2856
|
+
/** The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the photo was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2857
|
+
photo: string
|
|
2858
|
+
}
|
|
2859
|
+
|
|
2860
|
+
/** Describes a video to post as a story. */
|
|
2861
|
+
export interface InputStoryContentVideo {
|
|
2862
|
+
/** Type of the content, must be _video_ */
|
|
2863
|
+
type: string
|
|
2864
|
+
/** The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can't be reused and can only be uploaded as a new file, so you can pass “attach://<file\_attach\_name>” if the video was uploaded using multipart/form-data under <file\_attach\_name>. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2865
|
+
video: string
|
|
2866
|
+
/** Precise duration of the video in seconds; 0-60 */
|
|
2867
|
+
duration?: number
|
|
2868
|
+
/** Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0. */
|
|
2869
|
+
cover_frame_timestamp?: number
|
|
2870
|
+
/** Pass _True_ if the video has no sound */
|
|
2871
|
+
is_animation?: boolean
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
/** This object represents a sticker. */
|
|
2875
|
+
export interface Sticker {
|
|
2876
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
2877
|
+
file_id: string
|
|
2878
|
+
/** 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. */
|
|
2879
|
+
file_unique_id: string
|
|
2880
|
+
/** Type of the sticker, currently one of “regular”, “mask”, “custom\_emoji”. The type of the sticker is independent from its format, which is determined by the fields _is\_animated_ and _is\_video_. */
|
|
2881
|
+
type: string
|
|
2882
|
+
/** Sticker width */
|
|
2883
|
+
width: number
|
|
2884
|
+
/** Sticker height */
|
|
2885
|
+
height: number
|
|
2886
|
+
/** _True_, if the sticker is [animated](https://telegram.org/blog/animated-stickers) */
|
|
2887
|
+
is_animated: boolean
|
|
2888
|
+
/** _True_, if the sticker is a [video sticker](https://telegram.org/blog/video-stickers-better-reactions) */
|
|
2889
|
+
is_video: boolean
|
|
2890
|
+
/** Sticker thumbnail in the .WEBP or .JPG format */
|
|
2891
|
+
thumbnail?: PhotoSize
|
|
2892
|
+
/** Emoji associated with the sticker */
|
|
2893
|
+
emoji?: string
|
|
2894
|
+
/** Name of the sticker set to which the sticker belongs */
|
|
2895
|
+
set_name?: string
|
|
2896
|
+
/** For premium regular stickers, premium animation for the sticker */
|
|
2897
|
+
premium_animation?: File
|
|
2898
|
+
/** For mask stickers, the position where the mask should be placed */
|
|
2899
|
+
mask_position?: MaskPosition
|
|
2900
|
+
/** For custom emoji stickers, unique identifier of the custom emoji */
|
|
2901
|
+
custom_emoji_id?: string
|
|
2902
|
+
/** _True_, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places */
|
|
2903
|
+
needs_repainting?: true
|
|
2904
|
+
/** File size in bytes */
|
|
2905
|
+
file_size?: number
|
|
2906
|
+
}
|
|
2907
|
+
|
|
2908
|
+
/** This object represents a sticker set. */
|
|
2909
|
+
export interface StickerSet {
|
|
2910
|
+
/** Sticker set name */
|
|
2911
|
+
name: string
|
|
2912
|
+
/** Sticker set title */
|
|
2913
|
+
title: string
|
|
2914
|
+
/** Type of stickers in the set, currently one of “regular”, “mask”, “custom\_emoji” */
|
|
2915
|
+
sticker_type: string
|
|
2916
|
+
/** List of all set stickers */
|
|
2917
|
+
stickers: Array<Sticker>
|
|
2918
|
+
/** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */
|
|
2919
|
+
thumbnail?: PhotoSize
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
/** This object describes the position on faces where a mask should be placed by default. */
|
|
2923
|
+
export interface MaskPosition {
|
|
2924
|
+
/** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */
|
|
2925
|
+
point: string
|
|
2926
|
+
/** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */
|
|
2927
|
+
x_shift: number
|
|
2928
|
+
/** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */
|
|
2929
|
+
y_shift: number
|
|
2930
|
+
/** Mask scaling coefficient. For example, 2.0 means double size. */
|
|
2931
|
+
scale: number
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
/** This object describes a sticker to be added to a sticker set. */
|
|
2935
|
+
export interface InputSticker {
|
|
2936
|
+
/** The added sticker. Pass a _file\_id_ as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file\_attach\_name>” to upload a new file using multipart/form-data under <file\_attach\_name> name. Animated and video stickers can't be uploaded via HTTP URL. [More information on Sending Files »](https://core.telegram.org/bots/api#sending-files) */
|
|
2937
|
+
sticker: string
|
|
2938
|
+
/** Format of the added sticker, must be one of “static” for a **.WEBP** or **.PNG** image, “animated” for a **.TGS** animation, “video” for a **.WEBM** video */
|
|
2939
|
+
format: string
|
|
2940
|
+
/** List of 1-20 emoji associated with the sticker */
|
|
2941
|
+
emoji_list: Array<string>
|
|
2942
|
+
/** Position where the mask should be placed on faces. For “mask” stickers only. */
|
|
2943
|
+
mask_position?: MaskPosition
|
|
2944
|
+
/** List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom\_emoji” stickers only. */
|
|
2945
|
+
keywords?: Array<string>
|
|
2946
|
+
}
|
|
2947
|
+
|
|
2948
|
+
/** This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */
|
|
2949
|
+
export interface InlineQuery {
|
|
2950
|
+
/** Unique identifier for this query */
|
|
2951
|
+
id: string
|
|
2952
|
+
/** Sender */
|
|
2953
|
+
from: User
|
|
2954
|
+
/** Text of the query (up to 256 characters) */
|
|
2955
|
+
query: string
|
|
2956
|
+
/** Offset of the results to be returned, can be controlled by the bot */
|
|
2957
|
+
offset: string
|
|
2958
|
+
/** Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */
|
|
2959
|
+
chat_type?: string
|
|
2960
|
+
/** Sender location, only for bots that request user location */
|
|
2961
|
+
location?: Location
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
/** This object represents a button to be shown above inline query results. You **must** use exactly one of the optional fields. */
|
|
2965
|
+
export interface InlineQueryResultsButton {
|
|
2966
|
+
/** Label text on the button */
|
|
2967
|
+
text: string
|
|
2968
|
+
/** Description of the [Web App](https://core.telegram.org/bots/webapps) that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method [switchInlineQuery](https://core.telegram.org/bots/webapps#initializing-mini-apps) inside the Web App. */
|
|
2969
|
+
web_app?: WebAppInfo
|
|
2970
|
+
/**
|
|
2971
|
+
* [Deep-linking](https://core.telegram.org/bots/features#deep-linking) parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only `A-Z`, `a-z`, `0-9`, `_` and `-` are allowed.
|
|
2972
|
+
*
|
|
2973
|
+
* _Example:_ An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a [_switch\_inline_](https://core.telegram.org/bots/api#inlinekeyboardmarkup) button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
|
|
2974
|
+
*/
|
|
2975
|
+
start_parameter?: string
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
/**
|
|
2979
|
+
* This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
|
|
2980
|
+
*
|
|
2981
|
+
* - [InlineQueryResultCachedAudio](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio)
|
|
2982
|
+
* - [InlineQueryResultCachedDocument](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument)
|
|
2983
|
+
* - [InlineQueryResultCachedGif](https://core.telegram.org/bots/api#inlinequeryresultcachedgif)
|
|
2984
|
+
* - [InlineQueryResultCachedMpeg4Gif](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif)
|
|
2985
|
+
* - [InlineQueryResultCachedPhoto](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto)
|
|
2986
|
+
* - [InlineQueryResultCachedSticker](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker)
|
|
2987
|
+
* - [InlineQueryResultCachedVideo](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo)
|
|
2988
|
+
* - [InlineQueryResultCachedVoice](https://core.telegram.org/bots/api#inlinequeryresultcachedvoice)
|
|
2989
|
+
* - [InlineQueryResultArticle](https://core.telegram.org/bots/api#inlinequeryresultarticle)
|
|
2990
|
+
* - [InlineQueryResultAudio](https://core.telegram.org/bots/api#inlinequeryresultaudio)
|
|
2991
|
+
* - [InlineQueryResultContact](https://core.telegram.org/bots/api#inlinequeryresultcontact)
|
|
2992
|
+
* - [InlineQueryResultGame](https://core.telegram.org/bots/api#inlinequeryresultgame)
|
|
2993
|
+
* - [InlineQueryResultDocument](https://core.telegram.org/bots/api#inlinequeryresultdocument)
|
|
2994
|
+
* - [InlineQueryResultGif](https://core.telegram.org/bots/api#inlinequeryresultgif)
|
|
2995
|
+
* - [InlineQueryResultLocation](https://core.telegram.org/bots/api#inlinequeryresultlocation)
|
|
2996
|
+
* - [InlineQueryResultMpeg4Gif](https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif)
|
|
2997
|
+
* - [InlineQueryResultPhoto](https://core.telegram.org/bots/api#inlinequeryresultphoto)
|
|
2998
|
+
* - [InlineQueryResultVenue](https://core.telegram.org/bots/api#inlinequeryresultvenue)
|
|
2999
|
+
* - [InlineQueryResultVideo](https://core.telegram.org/bots/api#inlinequeryresultvideo)
|
|
3000
|
+
* - [InlineQueryResultVoice](https://core.telegram.org/bots/api#inlinequeryresultvoice)
|
|
3001
|
+
*
|
|
3002
|
+
* **Note:** All URLs passed in inline query results will be available to end users and therefore must be assumed to be **public**.
|
|
3003
|
+
*/
|
|
3004
|
+
export type InlineQueryResult = InlineQueryResultCachedAudio | InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice
|
|
3005
|
+
|
|
3006
|
+
/** Represents a link to an article or web page. */
|
|
3007
|
+
export interface InlineQueryResultArticle {
|
|
3008
|
+
/** Type of the result, must be _article_ */
|
|
3009
|
+
type: string
|
|
3010
|
+
/** Unique identifier for this result, 1-64 Bytes */
|
|
3011
|
+
id: string
|
|
3012
|
+
/** Title of the result */
|
|
3013
|
+
title: string
|
|
3014
|
+
/** Content of the message to be sent */
|
|
3015
|
+
input_message_content: InputMessageContent
|
|
3016
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3017
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3018
|
+
/** URL of the result */
|
|
3019
|
+
url?: string
|
|
3020
|
+
/** Short description of the result */
|
|
3021
|
+
description?: string
|
|
3022
|
+
/** Url of the thumbnail for the result */
|
|
3023
|
+
thumbnail_url?: string
|
|
3024
|
+
/** Thumbnail width */
|
|
3025
|
+
thumbnail_width?: number
|
|
3026
|
+
/** Thumbnail height */
|
|
3027
|
+
thumbnail_height?: number
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
/** Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the photo. */
|
|
3031
|
+
export interface InlineQueryResultPhoto {
|
|
3032
|
+
/** Type of the result, must be _photo_ */
|
|
3033
|
+
type: string
|
|
3034
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3035
|
+
id: string
|
|
3036
|
+
/** A valid URL of the photo. Photo must be in **JPEG** format. Photo size must not exceed 5MB */
|
|
3037
|
+
photo_url: string
|
|
3038
|
+
/** URL of the thumbnail for the photo */
|
|
3039
|
+
thumbnail_url: string
|
|
3040
|
+
/** Width of the photo */
|
|
3041
|
+
photo_width?: number
|
|
3042
|
+
/** Height of the photo */
|
|
3043
|
+
photo_height?: number
|
|
3044
|
+
/** Title for the result */
|
|
3045
|
+
title?: string
|
|
3046
|
+
/** Short description of the result */
|
|
3047
|
+
description?: string
|
|
3048
|
+
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
3049
|
+
caption?: string
|
|
3050
|
+
/** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3051
|
+
parse_mode?: string
|
|
3052
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3053
|
+
caption_entities?: Array<MessageEntity>
|
|
3054
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3055
|
+
show_caption_above_media?: boolean
|
|
3056
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3057
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3058
|
+
/** Content of the message to be sent instead of the photo */
|
|
3059
|
+
input_message_content?: InputMessageContent
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
/** Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
|
|
3063
|
+
export interface InlineQueryResultGif {
|
|
3064
|
+
/** Type of the result, must be _gif_ */
|
|
3065
|
+
type: string
|
|
3066
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3067
|
+
id: string
|
|
3068
|
+
/** A valid URL for the GIF file */
|
|
3069
|
+
gif_url: string
|
|
3070
|
+
/** Width of the GIF */
|
|
3071
|
+
gif_width?: number
|
|
3072
|
+
/** Height of the GIF */
|
|
3073
|
+
gif_height?: number
|
|
3074
|
+
/** Duration of the GIF in seconds */
|
|
3075
|
+
gif_duration?: number
|
|
3076
|
+
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
3077
|
+
thumbnail_url: string
|
|
3078
|
+
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
|
|
3079
|
+
thumbnail_mime_type?: string
|
|
3080
|
+
/** Title for the result */
|
|
3081
|
+
title?: string
|
|
3082
|
+
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
|
|
3083
|
+
caption?: string
|
|
3084
|
+
/** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3085
|
+
parse_mode?: string
|
|
3086
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3087
|
+
caption_entities?: Array<MessageEntity>
|
|
3088
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3089
|
+
show_caption_above_media?: boolean
|
|
3090
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3091
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3092
|
+
/** Content of the message to be sent instead of the GIF animation */
|
|
3093
|
+
input_message_content?: InputMessageContent
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
/** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
|
|
3097
|
+
export interface InlineQueryResultMpeg4Gif {
|
|
3098
|
+
/** Type of the result, must be _mpeg4\_gif_ */
|
|
3099
|
+
type: string
|
|
3100
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3101
|
+
id: string
|
|
3102
|
+
/** A valid URL for the MPEG4 file */
|
|
3103
|
+
mpeg4_url: string
|
|
3104
|
+
/** Video width */
|
|
3105
|
+
mpeg4_width?: number
|
|
3106
|
+
/** Video height */
|
|
3107
|
+
mpeg4_height?: number
|
|
3108
|
+
/** Video duration in seconds */
|
|
3109
|
+
mpeg4_duration?: number
|
|
3110
|
+
/** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */
|
|
3111
|
+
thumbnail_url: string
|
|
3112
|
+
/** MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */
|
|
3113
|
+
thumbnail_mime_type?: string
|
|
3114
|
+
/** Title for the result */
|
|
3115
|
+
title?: string
|
|
3116
|
+
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
|
|
3117
|
+
caption?: string
|
|
3118
|
+
/** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3119
|
+
parse_mode?: string
|
|
3120
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3121
|
+
caption_entities?: Array<MessageEntity>
|
|
3122
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3123
|
+
show_caption_above_media?: boolean
|
|
3124
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3125
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3126
|
+
/** Content of the message to be sent instead of the video animation */
|
|
3127
|
+
input_message_content?: InputMessageContent
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
/**
|
|
3131
|
+
* Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the video.
|
|
3132
|
+
*
|
|
3133
|
+
* > If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you **must** replace its content using _input\_message\_content_.
|
|
3134
|
+
*/
|
|
3135
|
+
export interface InlineQueryResultVideo {
|
|
3136
|
+
/** Type of the result, must be _video_ */
|
|
3137
|
+
type: string
|
|
3138
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3139
|
+
id: string
|
|
3140
|
+
/** A valid URL for the embedded video player or video file */
|
|
3141
|
+
video_url: string
|
|
3142
|
+
/** MIME type of the content of the video URL, “text/html” or “video/mp4” */
|
|
3143
|
+
mime_type: string
|
|
3144
|
+
/** URL of the thumbnail (JPEG only) for the video */
|
|
3145
|
+
thumbnail_url: string
|
|
3146
|
+
/** Title for the result */
|
|
3147
|
+
title: string
|
|
3148
|
+
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
3149
|
+
caption?: string
|
|
3150
|
+
/** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3151
|
+
parse_mode?: string
|
|
3152
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3153
|
+
caption_entities?: Array<MessageEntity>
|
|
3154
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3155
|
+
show_caption_above_media?: boolean
|
|
3156
|
+
/** Video width */
|
|
3157
|
+
video_width?: number
|
|
3158
|
+
/** Video height */
|
|
3159
|
+
video_height?: number
|
|
3160
|
+
/** Video duration in seconds */
|
|
3161
|
+
video_duration?: number
|
|
3162
|
+
/** Short description of the result */
|
|
3163
|
+
description?: string
|
|
3164
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3165
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3166
|
+
/** Content of the message to be sent instead of the video. This field is **required** if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). */
|
|
3167
|
+
input_message_content?: InputMessageContent
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
/** Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the audio. */
|
|
3171
|
+
export interface InlineQueryResultAudio {
|
|
3172
|
+
/** Type of the result, must be _audio_ */
|
|
3173
|
+
type: string
|
|
3174
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3175
|
+
id: string
|
|
3176
|
+
/** A valid URL for the audio file */
|
|
3177
|
+
audio_url: string
|
|
3178
|
+
/** Title */
|
|
3179
|
+
title: string
|
|
3180
|
+
/** Caption, 0-1024 characters after entities parsing */
|
|
3181
|
+
caption?: string
|
|
3182
|
+
/** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3183
|
+
parse_mode?: string
|
|
3184
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3185
|
+
caption_entities?: Array<MessageEntity>
|
|
3186
|
+
/** Performer */
|
|
3187
|
+
performer?: string
|
|
3188
|
+
/** Audio duration in seconds */
|
|
3189
|
+
audio_duration?: number
|
|
3190
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3191
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3192
|
+
/** Content of the message to be sent instead of the audio */
|
|
3193
|
+
input_message_content?: InputMessageContent
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
/** Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the the voice message. */
|
|
3197
|
+
export interface InlineQueryResultVoice {
|
|
3198
|
+
/** Type of the result, must be _voice_ */
|
|
3199
|
+
type: string
|
|
3200
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3201
|
+
id: string
|
|
3202
|
+
/** A valid URL for the voice recording */
|
|
3203
|
+
voice_url: string
|
|
3204
|
+
/** Recording title */
|
|
3205
|
+
title: string
|
|
3206
|
+
/** Caption, 0-1024 characters after entities parsing */
|
|
3207
|
+
caption?: string
|
|
3208
|
+
/** Mode for parsing entities in the voice message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3209
|
+
parse_mode?: string
|
|
3210
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3211
|
+
caption_entities?: Array<MessageEntity>
|
|
3212
|
+
/** Recording duration in seconds */
|
|
3213
|
+
voice_duration?: number
|
|
3214
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3215
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3216
|
+
/** Content of the message to be sent instead of the voice recording */
|
|
3217
|
+
input_message_content?: InputMessageContent
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
/** Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the file. Currently, only **.PDF** and **.ZIP** files can be sent using this method. */
|
|
3221
|
+
export interface InlineQueryResultDocument {
|
|
3222
|
+
/** Type of the result, must be _document_ */
|
|
3223
|
+
type: string
|
|
3224
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3225
|
+
id: string
|
|
3226
|
+
/** Title for the result */
|
|
3227
|
+
title: string
|
|
3228
|
+
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
|
|
3229
|
+
caption?: string
|
|
3230
|
+
/** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3231
|
+
parse_mode?: string
|
|
3232
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3233
|
+
caption_entities?: Array<MessageEntity>
|
|
3234
|
+
/** A valid URL for the file */
|
|
3235
|
+
document_url: string
|
|
3236
|
+
/** MIME type of the content of the file, either “application/pdf” or “application/zip” */
|
|
3237
|
+
mime_type: string
|
|
3238
|
+
/** Short description of the result */
|
|
3239
|
+
description?: string
|
|
3240
|
+
/** Inline keyboard attached to the message */
|
|
3241
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3242
|
+
/** Content of the message to be sent instead of the file */
|
|
3243
|
+
input_message_content?: InputMessageContent
|
|
3244
|
+
/** URL of the thumbnail (JPEG only) for the file */
|
|
3245
|
+
thumbnail_url?: string
|
|
3246
|
+
/** Thumbnail width */
|
|
3247
|
+
thumbnail_width?: number
|
|
3248
|
+
/** Thumbnail height */
|
|
3249
|
+
thumbnail_height?: number
|
|
3250
|
+
}
|
|
3251
|
+
|
|
3252
|
+
/** Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the location. */
|
|
3253
|
+
export interface InlineQueryResultLocation {
|
|
3254
|
+
/** Type of the result, must be _location_ */
|
|
3255
|
+
type: string
|
|
3256
|
+
/** Unique identifier for this result, 1-64 Bytes */
|
|
3257
|
+
id: string
|
|
3258
|
+
/** Location latitude in degrees */
|
|
3259
|
+
latitude: number
|
|
3260
|
+
/** Location longitude in degrees */
|
|
3261
|
+
longitude: number
|
|
3262
|
+
/** Location title */
|
|
3263
|
+
title: string
|
|
3264
|
+
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
|
|
3265
|
+
horizontal_accuracy?: number
|
|
3266
|
+
/** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
|
|
3267
|
+
live_period?: number
|
|
3268
|
+
/** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
|
|
3269
|
+
heading?: number
|
|
3270
|
+
/** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
|
|
3271
|
+
proximity_alert_radius?: number
|
|
3272
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3273
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3274
|
+
/** Content of the message to be sent instead of the location */
|
|
3275
|
+
input_message_content?: InputMessageContent
|
|
3276
|
+
/** Url of the thumbnail for the result */
|
|
3277
|
+
thumbnail_url?: string
|
|
3278
|
+
/** Thumbnail width */
|
|
3279
|
+
thumbnail_width?: number
|
|
3280
|
+
/** Thumbnail height */
|
|
3281
|
+
thumbnail_height?: number
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
/** Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the venue. */
|
|
3285
|
+
export interface InlineQueryResultVenue {
|
|
3286
|
+
/** Type of the result, must be _venue_ */
|
|
3287
|
+
type: string
|
|
3288
|
+
/** Unique identifier for this result, 1-64 Bytes */
|
|
3289
|
+
id: string
|
|
3290
|
+
/** Latitude of the venue location in degrees */
|
|
3291
|
+
latitude: number
|
|
3292
|
+
/** Longitude of the venue location in degrees */
|
|
3293
|
+
longitude: number
|
|
3294
|
+
/** Title of the venue */
|
|
3295
|
+
title: string
|
|
3296
|
+
/** Address of the venue */
|
|
3297
|
+
address: string
|
|
3298
|
+
/** Foursquare identifier of the venue if known */
|
|
3299
|
+
foursquare_id?: string
|
|
3300
|
+
/** Foursquare type of the venue, if known. (For example, “arts\_entertainment/default”, “arts\_entertainment/aquarium” or “food/icecream”.) */
|
|
3301
|
+
foursquare_type?: string
|
|
3302
|
+
/** Google Places identifier of the venue */
|
|
3303
|
+
google_place_id?: string
|
|
3304
|
+
/** Google Places type of the venue. (See [supported types](https://developers.google.com/places/web-service/supported_types).) */
|
|
3305
|
+
google_place_type?: string
|
|
3306
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3307
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3308
|
+
/** Content of the message to be sent instead of the venue */
|
|
3309
|
+
input_message_content?: InputMessageContent
|
|
3310
|
+
/** Url of the thumbnail for the result */
|
|
3311
|
+
thumbnail_url?: string
|
|
3312
|
+
/** Thumbnail width */
|
|
3313
|
+
thumbnail_width?: number
|
|
3314
|
+
/** Thumbnail height */
|
|
3315
|
+
thumbnail_height?: number
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
/** Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the contact. */
|
|
3319
|
+
export interface InlineQueryResultContact {
|
|
3320
|
+
/** Type of the result, must be _contact_ */
|
|
3321
|
+
type: string
|
|
3322
|
+
/** Unique identifier for this result, 1-64 Bytes */
|
|
3323
|
+
id: string
|
|
3324
|
+
/** Contact's phone number */
|
|
3325
|
+
phone_number: string
|
|
3326
|
+
/** Contact's first name */
|
|
3327
|
+
first_name: string
|
|
3328
|
+
/** Contact's last name */
|
|
3329
|
+
last_name?: string
|
|
3330
|
+
/** Additional data about the contact in the form of a [vCard](https://en.wikipedia.org/wiki/VCard), 0-2048 bytes */
|
|
3331
|
+
vcard?: string
|
|
3332
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3333
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3334
|
+
/** Content of the message to be sent instead of the contact */
|
|
3335
|
+
input_message_content?: InputMessageContent
|
|
3336
|
+
/** Url of the thumbnail for the result */
|
|
3337
|
+
thumbnail_url?: string
|
|
3338
|
+
/** Thumbnail width */
|
|
3339
|
+
thumbnail_width?: number
|
|
3340
|
+
/** Thumbnail height */
|
|
3341
|
+
thumbnail_height?: number
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
/** Represents a [Game](https://core.telegram.org/bots/api#games). */
|
|
3345
|
+
export interface InlineQueryResultGame {
|
|
3346
|
+
/** Type of the result, must be _game_ */
|
|
3347
|
+
type: string
|
|
3348
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3349
|
+
id: string
|
|
3350
|
+
/** Short name of the game */
|
|
3351
|
+
game_short_name: string
|
|
3352
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3353
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3354
|
+
}
|
|
3355
|
+
|
|
3356
|
+
/** Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the photo. */
|
|
3357
|
+
export interface InlineQueryResultCachedPhoto {
|
|
3358
|
+
/** Type of the result, must be _photo_ */
|
|
3359
|
+
type: string
|
|
3360
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3361
|
+
id: string
|
|
3362
|
+
/** A valid file identifier of the photo */
|
|
3363
|
+
photo_file_id: string
|
|
3364
|
+
/** Title for the result */
|
|
3365
|
+
title?: string
|
|
3366
|
+
/** Short description of the result */
|
|
3367
|
+
description?: string
|
|
3368
|
+
/** Caption of the photo to be sent, 0-1024 characters after entities parsing */
|
|
3369
|
+
caption?: string
|
|
3370
|
+
/** Mode for parsing entities in the photo caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3371
|
+
parse_mode?: string
|
|
3372
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3373
|
+
caption_entities?: Array<MessageEntity>
|
|
3374
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3375
|
+
show_caption_above_media?: boolean
|
|
3376
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3377
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3378
|
+
/** Content of the message to be sent instead of the photo */
|
|
3379
|
+
input_message_content?: InputMessageContent
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3382
|
+
/** Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with specified content instead of the animation. */
|
|
3383
|
+
export interface InlineQueryResultCachedGif {
|
|
3384
|
+
/** Type of the result, must be _gif_ */
|
|
3385
|
+
type: string
|
|
3386
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3387
|
+
id: string
|
|
3388
|
+
/** A valid file identifier for the GIF file */
|
|
3389
|
+
gif_file_id: string
|
|
3390
|
+
/** Title for the result */
|
|
3391
|
+
title?: string
|
|
3392
|
+
/** Caption of the GIF file to be sent, 0-1024 characters after entities parsing */
|
|
3393
|
+
caption?: string
|
|
3394
|
+
/** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3395
|
+
parse_mode?: string
|
|
3396
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3397
|
+
caption_entities?: Array<MessageEntity>
|
|
3398
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3399
|
+
show_caption_above_media?: boolean
|
|
3400
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3401
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3402
|
+
/** Content of the message to be sent instead of the GIF animation */
|
|
3403
|
+
input_message_content?: InputMessageContent
|
|
3404
|
+
}
|
|
3405
|
+
|
|
3406
|
+
/** Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the animation. */
|
|
3407
|
+
export interface InlineQueryResultCachedMpeg4Gif {
|
|
3408
|
+
/** Type of the result, must be _mpeg4\_gif_ */
|
|
3409
|
+
type: string
|
|
3410
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3411
|
+
id: string
|
|
3412
|
+
/** A valid file identifier for the MPEG4 file */
|
|
3413
|
+
mpeg4_file_id: string
|
|
3414
|
+
/** Title for the result */
|
|
3415
|
+
title?: string
|
|
3416
|
+
/** Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */
|
|
3417
|
+
caption?: string
|
|
3418
|
+
/** Mode for parsing entities in the caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3419
|
+
parse_mode?: string
|
|
3420
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3421
|
+
caption_entities?: Array<MessageEntity>
|
|
3422
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3423
|
+
show_caption_above_media?: boolean
|
|
3424
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3425
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3426
|
+
/** Content of the message to be sent instead of the video animation */
|
|
3427
|
+
input_message_content?: InputMessageContent
|
|
3428
|
+
}
|
|
3429
|
+
|
|
3430
|
+
/** Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the sticker. */
|
|
3431
|
+
export interface InlineQueryResultCachedSticker {
|
|
3432
|
+
/** Type of the result, must be _sticker_ */
|
|
3433
|
+
type: string
|
|
3434
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3435
|
+
id: string
|
|
3436
|
+
/** A valid file identifier of the sticker */
|
|
3437
|
+
sticker_file_id: string
|
|
3438
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3439
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3440
|
+
/** Content of the message to be sent instead of the sticker */
|
|
3441
|
+
input_message_content?: InputMessageContent
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3444
|
+
/** Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the file. */
|
|
3445
|
+
export interface InlineQueryResultCachedDocument {
|
|
3446
|
+
/** Type of the result, must be _document_ */
|
|
3447
|
+
type: string
|
|
3448
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3449
|
+
id: string
|
|
3450
|
+
/** Title for the result */
|
|
3451
|
+
title: string
|
|
3452
|
+
/** A valid file identifier for the file */
|
|
3453
|
+
document_file_id: string
|
|
3454
|
+
/** Short description of the result */
|
|
3455
|
+
description?: string
|
|
3456
|
+
/** Caption of the document to be sent, 0-1024 characters after entities parsing */
|
|
3457
|
+
caption?: string
|
|
3458
|
+
/** Mode for parsing entities in the document caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3459
|
+
parse_mode?: string
|
|
3460
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3461
|
+
caption_entities?: Array<MessageEntity>
|
|
3462
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3463
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3464
|
+
/** Content of the message to be sent instead of the file */
|
|
3465
|
+
input_message_content?: InputMessageContent
|
|
3466
|
+
}
|
|
3467
|
+
|
|
3468
|
+
/** Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the video. */
|
|
3469
|
+
export interface InlineQueryResultCachedVideo {
|
|
3470
|
+
/** Type of the result, must be _video_ */
|
|
3471
|
+
type: string
|
|
3472
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3473
|
+
id: string
|
|
3474
|
+
/** A valid file identifier for the video file */
|
|
3475
|
+
video_file_id: string
|
|
3476
|
+
/** Title for the result */
|
|
3477
|
+
title: string
|
|
3478
|
+
/** Short description of the result */
|
|
3479
|
+
description?: string
|
|
3480
|
+
/** Caption of the video to be sent, 0-1024 characters after entities parsing */
|
|
3481
|
+
caption?: string
|
|
3482
|
+
/** Mode for parsing entities in the video caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3483
|
+
parse_mode?: string
|
|
3484
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3485
|
+
caption_entities?: Array<MessageEntity>
|
|
3486
|
+
/** Pass _True_, if the caption must be shown above the message media */
|
|
3487
|
+
show_caption_above_media?: boolean
|
|
3488
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3489
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3490
|
+
/** Content of the message to be sent instead of the video */
|
|
3491
|
+
input_message_content?: InputMessageContent
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
/** Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the voice message. */
|
|
3495
|
+
export interface InlineQueryResultCachedVoice {
|
|
3496
|
+
/** Type of the result, must be _voice_ */
|
|
3497
|
+
type: string
|
|
3498
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3499
|
+
id: string
|
|
3500
|
+
/** A valid file identifier for the voice message */
|
|
3501
|
+
voice_file_id: string
|
|
3502
|
+
/** Voice message title */
|
|
3503
|
+
title: string
|
|
3504
|
+
/** Caption, 0-1024 characters after entities parsing */
|
|
3505
|
+
caption?: string
|
|
3506
|
+
/** Mode for parsing entities in the voice message caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3507
|
+
parse_mode?: string
|
|
3508
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3509
|
+
caption_entities?: Array<MessageEntity>
|
|
3510
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3511
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3512
|
+
/** Content of the message to be sent instead of the voice message */
|
|
3513
|
+
input_message_content?: InputMessageContent
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
/** Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use _input\_message\_content_ to send a message with the specified content instead of the audio. */
|
|
3517
|
+
export interface InlineQueryResultCachedAudio {
|
|
3518
|
+
/** Type of the result, must be _audio_ */
|
|
3519
|
+
type: string
|
|
3520
|
+
/** Unique identifier for this result, 1-64 bytes */
|
|
3521
|
+
id: string
|
|
3522
|
+
/** A valid file identifier for the audio file */
|
|
3523
|
+
audio_file_id: string
|
|
3524
|
+
/** Caption, 0-1024 characters after entities parsing */
|
|
3525
|
+
caption?: string
|
|
3526
|
+
/** Mode for parsing entities in the audio caption. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3527
|
+
parse_mode?: string
|
|
3528
|
+
/** List of special entities that appear in the caption, which can be specified instead of _parse\_mode_ */
|
|
3529
|
+
caption_entities?: Array<MessageEntity>
|
|
3530
|
+
/** [Inline keyboard](https://core.telegram.org/bots/features#inline-keyboards) attached to the message */
|
|
3531
|
+
reply_markup?: InlineKeyboardMarkup
|
|
3532
|
+
/** Content of the message to be sent instead of the audio */
|
|
3533
|
+
input_message_content?: InputMessageContent
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
/**
|
|
3537
|
+
* This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:
|
|
3538
|
+
*
|
|
3539
|
+
* - [InputTextMessageContent](https://core.telegram.org/bots/api#inputtextmessagecontent)
|
|
3540
|
+
* - [InputLocationMessageContent](https://core.telegram.org/bots/api#inputlocationmessagecontent)
|
|
3541
|
+
* - [InputVenueMessageContent](https://core.telegram.org/bots/api#inputvenuemessagecontent)
|
|
3542
|
+
* - [InputContactMessageContent](https://core.telegram.org/bots/api#inputcontactmessagecontent)
|
|
3543
|
+
* - [InputInvoiceMessageContent](https://core.telegram.org/bots/api#inputinvoicemessagecontent)
|
|
3544
|
+
*/
|
|
3545
|
+
export type InputMessageContent = InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent
|
|
3546
|
+
|
|
3547
|
+
/** Represents the [content](https://core.telegram.org/bots/api#inputmessagecontent) of a text message to be sent as the result of an inline query. */
|
|
3548
|
+
export interface InputTextMessageContent {
|
|
3549
|
+
/** Text of the message to be sent, 1-4096 characters */
|
|
3550
|
+
message_text: string
|
|
3551
|
+
/** Mode for parsing entities in the message text. See [formatting options](https://core.telegram.org/bots/api#formatting-options) for more details. */
|
|
3552
|
+
parse_mode?: string
|
|
3553
|
+
/** List of special entities that appear in message text, which can be specified instead of _parse\_mode_ */
|
|
3554
|
+
entities?: Array<MessageEntity>
|
|
3555
|
+
/** Link preview generation options for the message */
|
|
3556
|
+
link_preview_options?: LinkPreviewOptions
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
/** Represents the [content](https://core.telegram.org/bots/api#inputmessagecontent) of a location message to be sent as the result of an inline query. */
|
|
3560
|
+
export interface InputLocationMessageContent {
|
|
3561
|
+
/** Latitude of the location in degrees */
|
|
3562
|
+
latitude: number
|
|
3563
|
+
/** Longitude of the location in degrees */
|
|
3564
|
+
longitude: number
|
|
3565
|
+
/** The radius of uncertainty for the location, measured in meters; 0-1500 */
|
|
3566
|
+
horizontal_accuracy?: number
|
|
3567
|
+
/** Period in seconds during which the location can be updated, should be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. */
|
|
3568
|
+
live_period?: number
|
|
3569
|
+
/** For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */
|
|
3570
|
+
heading?: number
|
|
3571
|
+
/** For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */
|
|
3572
|
+
proximity_alert_radius?: number
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
/** Represents the [content](https://core.telegram.org/bots/api#inputmessagecontent) of a venue message to be sent as the result of an inline query. */
|
|
3576
|
+
export interface InputVenueMessageContent {
|
|
3577
|
+
/** Latitude of the venue in degrees */
|
|
3578
|
+
latitude: number
|
|
3579
|
+
/** Longitude of the venue in degrees */
|
|
3580
|
+
longitude: number
|
|
3581
|
+
/** Name of the venue */
|
|
3582
|
+
title: string
|
|
3583
|
+
/** Address of the venue */
|
|
3584
|
+
address: string
|
|
3585
|
+
/** Foursquare identifier of the venue, if known */
|
|
3586
|
+
foursquare_id?: string
|
|
3587
|
+
/** Foursquare type of the venue, if known. (For example, “arts\_entertainment/default”, “arts\_entertainment/aquarium” or “food/icecream”.) */
|
|
3588
|
+
foursquare_type?: string
|
|
3589
|
+
/** Google Places identifier of the venue */
|
|
3590
|
+
google_place_id?: string
|
|
3591
|
+
/** Google Places type of the venue. (See [supported types](https://developers.google.com/places/web-service/supported_types).) */
|
|
3592
|
+
google_place_type?: string
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3595
|
+
/** Represents the [content](https://core.telegram.org/bots/api#inputmessagecontent) of a contact message to be sent as the result of an inline query. */
|
|
3596
|
+
export interface InputContactMessageContent {
|
|
3597
|
+
/** Contact's phone number */
|
|
3598
|
+
phone_number: string
|
|
3599
|
+
/** Contact's first name */
|
|
3600
|
+
first_name: string
|
|
3601
|
+
/** Contact's last name */
|
|
3602
|
+
last_name?: string
|
|
3603
|
+
/** Additional data about the contact in the form of a [vCard](https://en.wikipedia.org/wiki/VCard), 0-2048 bytes */
|
|
3604
|
+
vcard?: string
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
/** Represents the [content](https://core.telegram.org/bots/api#inputmessagecontent) of an invoice message to be sent as the result of an inline query. */
|
|
3608
|
+
export interface InputInvoiceMessageContent {
|
|
3609
|
+
/** Product name, 1-32 characters */
|
|
3610
|
+
title: string
|
|
3611
|
+
/** Product description, 1-255 characters */
|
|
3612
|
+
description: string
|
|
3613
|
+
/** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */
|
|
3614
|
+
payload: string
|
|
3615
|
+
/** Payment provider token, obtained via [@BotFather](https://t.me/botfather). Pass an empty string for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3616
|
+
provider_token?: string
|
|
3617
|
+
/** Three-letter ISO 4217 currency code, see [more on currencies](https://core.telegram.org/bots/payments#supported-currencies). Pass “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3618
|
+
currency: string
|
|
3619
|
+
/** Price breakdown, an array of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3620
|
+
prices: Array<LabeledPrice>
|
|
3621
|
+
/** The maximum accepted amount for tips in the _smallest units_ of the currency (integer, **not** float/double). For example, for a maximum tip of `US$ 1.45` pass `max_tip_amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3622
|
+
max_tip_amount?: number
|
|
3623
|
+
/** An array of suggested amounts of tip in the _smallest units_ of the currency (integer, **not** float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed _max\_tip\_amount_. */
|
|
3624
|
+
suggested_tip_amounts?: Array<number>
|
|
3625
|
+
/** A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. */
|
|
3626
|
+
provider_data?: string
|
|
3627
|
+
/** URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. */
|
|
3628
|
+
photo_url?: string
|
|
3629
|
+
/** Photo size in bytes */
|
|
3630
|
+
photo_size?: number
|
|
3631
|
+
/** Photo width */
|
|
3632
|
+
photo_width?: number
|
|
3633
|
+
/** Photo height */
|
|
3634
|
+
photo_height?: number
|
|
3635
|
+
/** Pass _True_ if you require the user's full name to complete the order. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3636
|
+
need_name?: boolean
|
|
3637
|
+
/** Pass _True_ if you require the user's phone number to complete the order. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3638
|
+
need_phone_number?: boolean
|
|
3639
|
+
/** Pass _True_ if you require the user's email address to complete the order. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3640
|
+
need_email?: boolean
|
|
3641
|
+
/** Pass _True_ if you require the user's shipping address to complete the order. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3642
|
+
need_shipping_address?: boolean
|
|
3643
|
+
/** Pass _True_ if the user's phone number should be sent to the provider. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3644
|
+
send_phone_number_to_provider?: boolean
|
|
3645
|
+
/** Pass _True_ if the user's email address should be sent to the provider. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3646
|
+
send_email_to_provider?: boolean
|
|
3647
|
+
/** Pass _True_ if the final price depends on the shipping method. Ignored for payments in [Telegram Stars](https://t.me/BotNews/90). */
|
|
3648
|
+
is_flexible?: boolean
|
|
3649
|
+
}
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* Represents a [result](https://core.telegram.org/bots/api#inlinequeryresult) of an inline query that was chosen by the user and sent to their chat partner.
|
|
3653
|
+
*
|
|
3654
|
+
* **Note:** It is necessary to enable [inline feedback](https://core.telegram.org/bots/inline#collecting-feedback) via [@BotFather](https://t.me/botfather) in order to receive these objects in updates.
|
|
3655
|
+
*/
|
|
3656
|
+
export interface ChosenInlineResult {
|
|
3657
|
+
/** The unique identifier for the result that was chosen */
|
|
3658
|
+
result_id: string
|
|
3659
|
+
/** The user that chose the result */
|
|
3660
|
+
from: User
|
|
3661
|
+
/** Sender location, only for bots that require user location */
|
|
3662
|
+
location?: Location
|
|
3663
|
+
/** Identifier of the sent inline message. Available only if there is an [inline keyboard](https://core.telegram.org/bots/api#inlinekeyboardmarkup) attached to the message. Will be also received in [callback queries](https://core.telegram.org/bots/api#callbackquery) and can be used to [edit](https://core.telegram.org/bots/api#updating-messages) the message. */
|
|
3664
|
+
inline_message_id?: string
|
|
3665
|
+
/** The query that was used to obtain the result */
|
|
3666
|
+
query: string
|
|
3667
|
+
}
|
|
3668
|
+
|
|
3669
|
+
/** Describes an inline message sent by a [Web App](https://core.telegram.org/bots/webapps) on behalf of a user. */
|
|
3670
|
+
export interface SentWebAppMessage {
|
|
3671
|
+
/** Identifier of the sent inline message. Available only if there is an [inline keyboard](https://core.telegram.org/bots/api#inlinekeyboardmarkup) attached to the message. */
|
|
3672
|
+
inline_message_id?: string
|
|
3673
|
+
}
|
|
3674
|
+
|
|
3675
|
+
/** Describes an inline message to be sent by a user of a Mini App. */
|
|
3676
|
+
export interface PreparedInlineMessage {
|
|
3677
|
+
/** Unique identifier of the prepared message */
|
|
3678
|
+
id: string
|
|
3679
|
+
/** Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used */
|
|
3680
|
+
expiration_date: number
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
/** This object represents a portion of the price for goods or services. */
|
|
3684
|
+
export interface LabeledPrice {
|
|
3685
|
+
/** Portion label */
|
|
3686
|
+
label: string
|
|
3687
|
+
/** Price of the product in the _smallest units_ of the [currency](https://core.telegram.org/bots/payments#supported-currencies) (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
3688
|
+
amount: number
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
/** This object contains basic information about an invoice. */
|
|
3692
|
+
export interface Invoice {
|
|
3693
|
+
/** Product name */
|
|
3694
|
+
title: string
|
|
3695
|
+
/** Product description */
|
|
3696
|
+
description: string
|
|
3697
|
+
/** Unique bot deep-linking parameter that can be used to generate this invoice */
|
|
3698
|
+
start_parameter: string
|
|
3699
|
+
/** Three-letter ISO 4217 [currency](https://core.telegram.org/bots/payments#supported-currencies) code, or “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90) */
|
|
3700
|
+
currency: string
|
|
3701
|
+
/** Total price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
3702
|
+
total_amount: number
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
/** This object represents a shipping address. */
|
|
3706
|
+
export interface ShippingAddress {
|
|
3707
|
+
/** Two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code */
|
|
3708
|
+
country_code: string
|
|
3709
|
+
/** State, if applicable */
|
|
3710
|
+
state: string
|
|
3711
|
+
/** City */
|
|
3712
|
+
city: string
|
|
3713
|
+
/** First line for the address */
|
|
3714
|
+
street_line1: string
|
|
3715
|
+
/** Second line for the address */
|
|
3716
|
+
street_line2: string
|
|
3717
|
+
/** Address post code */
|
|
3718
|
+
post_code: string
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3721
|
+
/** This object represents information about an order. */
|
|
3722
|
+
export interface OrderInfo {
|
|
3723
|
+
/** User name */
|
|
3724
|
+
name?: string
|
|
3725
|
+
/** User's phone number */
|
|
3726
|
+
phone_number?: string
|
|
3727
|
+
/** User email */
|
|
3728
|
+
email?: string
|
|
3729
|
+
/** User shipping address */
|
|
3730
|
+
shipping_address?: ShippingAddress
|
|
3731
|
+
}
|
|
3732
|
+
|
|
3733
|
+
/** This object represents one shipping option. */
|
|
3734
|
+
export interface ShippingOption {
|
|
3735
|
+
/** Shipping option identifier */
|
|
3736
|
+
id: string
|
|
3737
|
+
/** Option title */
|
|
3738
|
+
title: string
|
|
3739
|
+
/** List of price portions */
|
|
3740
|
+
prices: Array<LabeledPrice>
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
/** This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. */
|
|
3744
|
+
export interface SuccessfulPayment {
|
|
3745
|
+
/** Three-letter ISO 4217 [currency](https://core.telegram.org/bots/payments#supported-currencies) code, or “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90) */
|
|
3746
|
+
currency: string
|
|
3747
|
+
/** Total price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
3748
|
+
total_amount: number
|
|
3749
|
+
/** Bot-specified invoice payload */
|
|
3750
|
+
invoice_payload: string
|
|
3751
|
+
/** Expiration date of the subscription, in Unix time; for recurring payments only */
|
|
3752
|
+
subscription_expiration_date?: number
|
|
3753
|
+
/** _True_, if the payment is a recurring payment for a subscription */
|
|
3754
|
+
is_recurring?: true
|
|
3755
|
+
/** _True_, if the payment is the first payment for a subscription */
|
|
3756
|
+
is_first_recurring?: true
|
|
3757
|
+
/** Identifier of the shipping option chosen by the user */
|
|
3758
|
+
shipping_option_id?: string
|
|
3759
|
+
/** Order information provided by the user */
|
|
3760
|
+
order_info?: OrderInfo
|
|
3761
|
+
/** Telegram payment identifier */
|
|
3762
|
+
telegram_payment_charge_id: string
|
|
3763
|
+
/** Provider payment identifier */
|
|
3764
|
+
provider_payment_charge_id: string
|
|
3765
|
+
}
|
|
3766
|
+
|
|
3767
|
+
/** This object contains basic information about a refunded payment. */
|
|
3768
|
+
export interface RefundedPayment {
|
|
3769
|
+
/** Three-letter ISO 4217 [currency](https://core.telegram.org/bots/payments#supported-currencies) code, or “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90). Currently, always “XTR” */
|
|
3770
|
+
currency: string
|
|
3771
|
+
/** Total refunded price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45`, `total_amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
3772
|
+
total_amount: number
|
|
3773
|
+
/** Bot-specified invoice payload */
|
|
3774
|
+
invoice_payload: string
|
|
3775
|
+
/** Telegram payment identifier */
|
|
3776
|
+
telegram_payment_charge_id: string
|
|
3777
|
+
/** Provider payment identifier */
|
|
3778
|
+
provider_payment_charge_id?: string
|
|
3779
|
+
}
|
|
3780
|
+
|
|
3781
|
+
/** This object contains information about an incoming shipping query. */
|
|
3782
|
+
export interface ShippingQuery {
|
|
3783
|
+
/** Unique query identifier */
|
|
3784
|
+
id: string
|
|
3785
|
+
/** User who sent the query */
|
|
3786
|
+
from: User
|
|
3787
|
+
/** Bot-specified invoice payload */
|
|
3788
|
+
invoice_payload: string
|
|
3789
|
+
/** User specified shipping address */
|
|
3790
|
+
shipping_address: ShippingAddress
|
|
3791
|
+
}
|
|
3792
|
+
|
|
3793
|
+
/** This object contains information about an incoming pre-checkout query. */
|
|
3794
|
+
export interface PreCheckoutQuery {
|
|
3795
|
+
/** Unique query identifier */
|
|
3796
|
+
id: string
|
|
3797
|
+
/** User who sent the query */
|
|
3798
|
+
from: User
|
|
3799
|
+
/** Three-letter ISO 4217 [currency](https://core.telegram.org/bots/payments#supported-currencies) code, or “XTR” for payments in [Telegram Stars](https://t.me/BotNews/90) */
|
|
3800
|
+
currency: string
|
|
3801
|
+
/** Total price in the _smallest units_ of the currency (integer, **not** float/double). For example, for a price of `US$ 1.45` pass `amount = 145`. See the _exp_ parameter in [currencies.json](https://core.telegram.org/bots/payments/currencies.json), it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */
|
|
3802
|
+
total_amount: number
|
|
3803
|
+
/** Bot-specified invoice payload */
|
|
3804
|
+
invoice_payload: string
|
|
3805
|
+
/** Identifier of the shipping option chosen by the user */
|
|
3806
|
+
shipping_option_id?: string
|
|
3807
|
+
/** Order information provided by the user */
|
|
3808
|
+
order_info?: OrderInfo
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
/** This object contains information about a paid media purchase. */
|
|
3812
|
+
export interface PaidMediaPurchased {
|
|
3813
|
+
/** User who purchased the media */
|
|
3814
|
+
from: User
|
|
3815
|
+
/** Bot-specified paid media payload */
|
|
3816
|
+
paid_media_payload: string
|
|
3817
|
+
}
|
|
3818
|
+
|
|
3819
|
+
/**
|
|
3820
|
+
* This object describes the state of a revenue withdrawal operation. Currently, it can be one of
|
|
3821
|
+
*
|
|
3822
|
+
* - [RevenueWithdrawalStatePending](https://core.telegram.org/bots/api#revenuewithdrawalstatepending)
|
|
3823
|
+
* - [RevenueWithdrawalStateSucceeded](https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded)
|
|
3824
|
+
* - [RevenueWithdrawalStateFailed](https://core.telegram.org/bots/api#revenuewithdrawalstatefailed)
|
|
3825
|
+
*/
|
|
3826
|
+
export type RevenueWithdrawalState = RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed
|
|
3827
|
+
|
|
3828
|
+
/** The withdrawal is in progress. */
|
|
3829
|
+
export interface RevenueWithdrawalStatePending {
|
|
3830
|
+
/** Type of the state, always “pending” */
|
|
3831
|
+
type: string
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
/** The withdrawal succeeded. */
|
|
3835
|
+
export interface RevenueWithdrawalStateSucceeded {
|
|
3836
|
+
/** Type of the state, always “succeeded” */
|
|
3837
|
+
type: string
|
|
3838
|
+
/** Date the withdrawal was completed in Unix time */
|
|
3839
|
+
date: number
|
|
3840
|
+
/** An HTTPS URL that can be used to see transaction details */
|
|
3841
|
+
url: string
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
/** The withdrawal failed and the transaction was refunded. */
|
|
3845
|
+
export interface RevenueWithdrawalStateFailed {
|
|
3846
|
+
/** Type of the state, always “failed” */
|
|
3847
|
+
type: string
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
/** Contains information about the affiliate that received a commission via this transaction. */
|
|
3851
|
+
export interface AffiliateInfo {
|
|
3852
|
+
/** The bot or the user that received an affiliate commission if it was received by a bot or a user */
|
|
3853
|
+
affiliate_user?: User
|
|
3854
|
+
/** The chat that received an affiliate commission if it was received by a chat */
|
|
3855
|
+
affiliate_chat?: Chat
|
|
3856
|
+
/** The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */
|
|
3857
|
+
commission_per_mille: number
|
|
3858
|
+
/** Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */
|
|
3859
|
+
amount: number
|
|
3860
|
+
/** The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */
|
|
3861
|
+
nanostar_amount?: number
|
|
3862
|
+
}
|
|
3863
|
+
|
|
3864
|
+
/**
|
|
3865
|
+
* This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
|
|
3866
|
+
*
|
|
3867
|
+
* - [TransactionPartnerUser](https://core.telegram.org/bots/api#transactionpartneruser)
|
|
3868
|
+
* - [TransactionPartnerChat](https://core.telegram.org/bots/api#transactionpartnerchat)
|
|
3869
|
+
* - [TransactionPartnerAffiliateProgram](https://core.telegram.org/bots/api#transactionpartneraffiliateprogram)
|
|
3870
|
+
* - [TransactionPartnerFragment](https://core.telegram.org/bots/api#transactionpartnerfragment)
|
|
3871
|
+
* - [TransactionPartnerTelegramAds](https://core.telegram.org/bots/api#transactionpartnertelegramads)
|
|
3872
|
+
* - [TransactionPartnerTelegramApi](https://core.telegram.org/bots/api#transactionpartnertelegramapi)
|
|
3873
|
+
* - [TransactionPartnerOther](https://core.telegram.org/bots/api#transactionpartnerother)
|
|
3874
|
+
*/
|
|
3875
|
+
export type TransactionPartner = TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther
|
|
3876
|
+
|
|
3877
|
+
/** Describes a transaction with a user. */
|
|
3878
|
+
export interface TransactionPartnerUser {
|
|
3879
|
+
/** Type of the transaction partner, always “user” */
|
|
3880
|
+
type: string
|
|
3881
|
+
/** Type of the transaction, currently one of “invoice\_payment” for payments via invoices, “paid\_media\_payment” for payments for paid media, “gift\_purchase” for gifts sent by the bot, “premium\_purchase” for Telegram Premium subscriptions gifted by the bot, “business\_account\_transfer” for direct transfers from managed business accounts */
|
|
3882
|
+
transaction_type: string
|
|
3883
|
+
/** Information about the user */
|
|
3884
|
+
user: User
|
|
3885
|
+
/** Information about the affiliate that received a commission via this transaction. Can be available only for “invoice\_payment” and “paid\_media\_payment” transactions. */
|
|
3886
|
+
affiliate?: AffiliateInfo
|
|
3887
|
+
/** Bot-specified invoice payload. Can be available only for “invoice\_payment” transactions. */
|
|
3888
|
+
invoice_payload?: string
|
|
3889
|
+
/** The duration of the paid subscription. Can be available only for “invoice\_payment” transactions. */
|
|
3890
|
+
subscription_period?: number
|
|
3891
|
+
/** Information about the paid media bought by the user; for “paid\_media\_payment” transactions only */
|
|
3892
|
+
paid_media?: Array<PaidMedia>
|
|
3893
|
+
/** Bot-specified paid media payload. Can be available only for “paid\_media\_payment” transactions. */
|
|
3894
|
+
paid_media_payload?: string
|
|
3895
|
+
/** The gift sent to the user by the bot; for “gift\_purchase” transactions only */
|
|
3896
|
+
gift?: Gift
|
|
3897
|
+
/** Number of months the gifted Telegram Premium subscription will be active for; for “premium\_purchase” transactions only */
|
|
3898
|
+
premium_subscription_duration?: number
|
|
3899
|
+
}
|
|
3900
|
+
|
|
3901
|
+
/** Describes a transaction with a chat. */
|
|
3902
|
+
export interface TransactionPartnerChat {
|
|
3903
|
+
/** Type of the transaction partner, always “chat” */
|
|
3904
|
+
type: string
|
|
3905
|
+
/** Information about the chat */
|
|
3906
|
+
chat: Chat
|
|
3907
|
+
/** The gift sent to the chat by the bot */
|
|
3908
|
+
gift?: Gift
|
|
3909
|
+
}
|
|
3910
|
+
|
|
3911
|
+
/** Describes the affiliate program that issued the affiliate commission received via this transaction. */
|
|
3912
|
+
export interface TransactionPartnerAffiliateProgram {
|
|
3913
|
+
/** Type of the transaction partner, always “affiliate\_program” */
|
|
3914
|
+
type: string
|
|
3915
|
+
/** Information about the bot that sponsored the affiliate program */
|
|
3916
|
+
sponsor_user?: User
|
|
3917
|
+
/** The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users */
|
|
3918
|
+
commission_per_mille: number
|
|
3919
|
+
}
|
|
3920
|
+
|
|
3921
|
+
/** Describes a withdrawal transaction with Fragment. */
|
|
3922
|
+
export interface TransactionPartnerFragment {
|
|
3923
|
+
/** Type of the transaction partner, always “fragment” */
|
|
3924
|
+
type: string
|
|
3925
|
+
/** State of the transaction if the transaction is outgoing */
|
|
3926
|
+
withdrawal_state?: RevenueWithdrawalState
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3929
|
+
/** Describes a withdrawal transaction to the Telegram Ads platform. */
|
|
3930
|
+
export interface TransactionPartnerTelegramAds {
|
|
3931
|
+
/** Type of the transaction partner, always “telegram\_ads” */
|
|
3932
|
+
type: string
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
/** Describes a transaction with payment for [paid broadcasting](https://core.telegram.org/bots/api#paid-broadcasts). */
|
|
3936
|
+
export interface TransactionPartnerTelegramApi {
|
|
3937
|
+
/** Type of the transaction partner, always “telegram\_api” */
|
|
3938
|
+
type: string
|
|
3939
|
+
/** The number of successful requests that exceeded regular limits and were therefore billed */
|
|
3940
|
+
request_count: number
|
|
3941
|
+
}
|
|
3942
|
+
|
|
3943
|
+
/** Describes a transaction with an unknown source or recipient. */
|
|
3944
|
+
export interface TransactionPartnerOther {
|
|
3945
|
+
/** Type of the transaction partner, always “other” */
|
|
3946
|
+
type: string
|
|
3947
|
+
}
|
|
3948
|
+
|
|
3949
|
+
/** Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control. */
|
|
3950
|
+
export interface StarTransaction {
|
|
3951
|
+
/** Unique identifier of the transaction. Coincides with the identifier of the original transaction for refund transactions. Coincides with _SuccessfulPayment.telegram\_payment\_charge\_id_ for successful incoming payments from users. */
|
|
3952
|
+
id: string
|
|
3953
|
+
/** Integer amount of Telegram Stars transferred by the transaction */
|
|
3954
|
+
amount: number
|
|
3955
|
+
/** The number of 1/1000000000 shares of Telegram Stars transferred by the transaction; from 0 to 999999999 */
|
|
3956
|
+
nanostar_amount?: number
|
|
3957
|
+
/** Date the transaction was created in Unix time */
|
|
3958
|
+
date: number
|
|
3959
|
+
/** Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal). Only for incoming transactions */
|
|
3960
|
+
source?: TransactionPartner
|
|
3961
|
+
/** Receiver of an outgoing transaction (e.g., a user for a purchase refund, Fragment for a withdrawal). Only for outgoing transactions */
|
|
3962
|
+
receiver?: TransactionPartner
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
/** Contains a list of Telegram Star transactions. */
|
|
3966
|
+
export interface StarTransactions {
|
|
3967
|
+
/** The list of transactions */
|
|
3968
|
+
transactions: Array<StarTransaction>
|
|
3969
|
+
}
|
|
3970
|
+
|
|
3971
|
+
/** Describes Telegram Passport data shared with the bot by the user. */
|
|
3972
|
+
export interface PassportData {
|
|
3973
|
+
/** Array with information about documents and other Telegram Passport elements that was shared with the bot */
|
|
3974
|
+
data: Array<EncryptedPassportElement>
|
|
3975
|
+
/** Encrypted credentials required to decrypt the data */
|
|
3976
|
+
credentials: EncryptedCredentials
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
/** This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. */
|
|
3980
|
+
export interface PassportFile {
|
|
3981
|
+
/** Identifier for this file, which can be used to download or reuse the file */
|
|
3982
|
+
file_id: string
|
|
3983
|
+
/** 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. */
|
|
3984
|
+
file_unique_id: string
|
|
3985
|
+
/** File size in bytes */
|
|
3986
|
+
file_size: number
|
|
3987
|
+
/** Unix time when the file was uploaded */
|
|
3988
|
+
file_date: number
|
|
3989
|
+
}
|
|
3990
|
+
|
|
3991
|
+
/** Describes documents or other Telegram Passport elements shared with the bot by the user. */
|
|
3992
|
+
export interface EncryptedPassportElement {
|
|
3993
|
+
/** Element type. One of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration”, “phone\_number”, “email”. */
|
|
3994
|
+
type: string
|
|
3995
|
+
/** Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport” and “address” types. Can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
3996
|
+
data?: string
|
|
3997
|
+
/** User's verified phone number; available only for “phone\_number” type */
|
|
3998
|
+
phone_number?: string
|
|
3999
|
+
/** User's verified email address; available only for “email” type */
|
|
4000
|
+
email?: string
|
|
4001
|
+
/** Array of encrypted files with documents provided by the user; available only for “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration” and “temporary\_registration” types. Files can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
4002
|
+
files?: Array<PassportFile>
|
|
4003
|
+
/** Encrypted file with the front side of the document, provided by the user; available only for “passport”, “driver\_license”, “identity\_card” and “internal\_passport”. The file can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
4004
|
+
front_side?: PassportFile
|
|
4005
|
+
/** Encrypted file with the reverse side of the document, provided by the user; available only for “driver\_license” and “identity\_card”. The file can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
4006
|
+
reverse_side?: PassportFile
|
|
4007
|
+
/** Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for “passport”, “driver\_license”, “identity\_card” and “internal\_passport”. The file can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
4008
|
+
selfie?: PassportFile
|
|
4009
|
+
/** Array of encrypted files with translated versions of documents provided by the user; available if requested for “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration” and “temporary\_registration” types. Files can be decrypted and verified using the accompanying [EncryptedCredentials](https://core.telegram.org/bots/api#encryptedcredentials). */
|
|
4010
|
+
translation?: Array<PassportFile>
|
|
4011
|
+
/** Base64-encoded element hash for using in [PassportElementErrorUnspecified](https://core.telegram.org/bots/api#passportelementerrorunspecified) */
|
|
4012
|
+
hash: string
|
|
4013
|
+
}
|
|
4014
|
+
|
|
4015
|
+
/** Describes data required for decrypting and authenticating [EncryptedPassportElement](https://core.telegram.org/bots/api#encryptedpassportelement). See the [Telegram Passport Documentation](https://core.telegram.org/passport#receiving-information) for a complete description of the data decryption and authentication processes. */
|
|
4016
|
+
export interface EncryptedCredentials {
|
|
4017
|
+
/** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for [EncryptedPassportElement](https://core.telegram.org/bots/api#encryptedpassportelement) decryption and authentication */
|
|
4018
|
+
data: string
|
|
4019
|
+
/** Base64-encoded data hash for data authentication */
|
|
4020
|
+
hash: string
|
|
4021
|
+
/** Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */
|
|
4022
|
+
secret: string
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
/**
|
|
4026
|
+
* This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
|
|
4027
|
+
*
|
|
4028
|
+
* - [PassportElementErrorDataField](https://core.telegram.org/bots/api#passportelementerrordatafield)
|
|
4029
|
+
* - [PassportElementErrorFrontSide](https://core.telegram.org/bots/api#passportelementerrorfrontside)
|
|
4030
|
+
* - [PassportElementErrorReverseSide](https://core.telegram.org/bots/api#passportelementerrorreverseside)
|
|
4031
|
+
* - [PassportElementErrorSelfie](https://core.telegram.org/bots/api#passportelementerrorselfie)
|
|
4032
|
+
* - [PassportElementErrorFile](https://core.telegram.org/bots/api#passportelementerrorfile)
|
|
4033
|
+
* - [PassportElementErrorFiles](https://core.telegram.org/bots/api#passportelementerrorfiles)
|
|
4034
|
+
* - [PassportElementErrorTranslationFile](https://core.telegram.org/bots/api#passportelementerrortranslationfile)
|
|
4035
|
+
* - [PassportElementErrorTranslationFiles](https://core.telegram.org/bots/api#passportelementerrortranslationfiles)
|
|
4036
|
+
* - [PassportElementErrorUnspecified](https://core.telegram.org/bots/api#passportelementerrorunspecified)
|
|
4037
|
+
*/
|
|
4038
|
+
export type PassportElementError = PassportElementErrorDataField | PassportElementErrorFrontSide | PassportElementErrorReverseSide | PassportElementErrorSelfie | PassportElementErrorFile | PassportElementErrorFiles | PassportElementErrorTranslationFile | PassportElementErrorTranslationFiles | PassportElementErrorUnspecified
|
|
4039
|
+
|
|
4040
|
+
/** Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. */
|
|
4041
|
+
export interface PassportElementErrorDataField {
|
|
4042
|
+
/** Error source, must be _data_ */
|
|
4043
|
+
source: string
|
|
4044
|
+
/** The section of the user's Telegram Passport which has the error, one of “personal\_details”, “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “address” */
|
|
4045
|
+
type: string
|
|
4046
|
+
/** Name of the data field which has the error */
|
|
4047
|
+
field_name: string
|
|
4048
|
+
/** Base64-encoded data hash */
|
|
4049
|
+
data_hash: string
|
|
4050
|
+
/** Error message */
|
|
4051
|
+
message: string
|
|
4052
|
+
}
|
|
4053
|
+
|
|
4054
|
+
/** Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. */
|
|
4055
|
+
export interface PassportElementErrorFrontSide {
|
|
4056
|
+
/** Error source, must be _front\_side_ */
|
|
4057
|
+
source: string
|
|
4058
|
+
/** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport” */
|
|
4059
|
+
type: string
|
|
4060
|
+
/** Base64-encoded hash of the file with the front side of the document */
|
|
4061
|
+
file_hash: string
|
|
4062
|
+
/** Error message */
|
|
4063
|
+
message: string
|
|
4064
|
+
}
|
|
4065
|
+
|
|
4066
|
+
/** Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. */
|
|
4067
|
+
export interface PassportElementErrorReverseSide {
|
|
4068
|
+
/** Error source, must be _reverse\_side_ */
|
|
4069
|
+
source: string
|
|
4070
|
+
/** The section of the user's Telegram Passport which has the issue, one of “driver\_license”, “identity\_card” */
|
|
4071
|
+
type: string
|
|
4072
|
+
/** Base64-encoded hash of the file with the reverse side of the document */
|
|
4073
|
+
file_hash: string
|
|
4074
|
+
/** Error message */
|
|
4075
|
+
message: string
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
/** Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. */
|
|
4079
|
+
export interface PassportElementErrorSelfie {
|
|
4080
|
+
/** Error source, must be _selfie_ */
|
|
4081
|
+
source: string
|
|
4082
|
+
/** The section of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport” */
|
|
4083
|
+
type: string
|
|
4084
|
+
/** Base64-encoded hash of the file with the selfie */
|
|
4085
|
+
file_hash: string
|
|
4086
|
+
/** Error message */
|
|
4087
|
+
message: string
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
/** Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. */
|
|
4091
|
+
export interface PassportElementErrorFile {
|
|
4092
|
+
/** Error source, must be _file_ */
|
|
4093
|
+
source: string
|
|
4094
|
+
/** The section of the user's Telegram Passport which has the issue, one of “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
|
|
4095
|
+
type: string
|
|
4096
|
+
/** Base64-encoded file hash */
|
|
4097
|
+
file_hash: string
|
|
4098
|
+
/** Error message */
|
|
4099
|
+
message: string
|
|
4100
|
+
}
|
|
4101
|
+
|
|
4102
|
+
/** Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. */
|
|
4103
|
+
export interface PassportElementErrorFiles {
|
|
4104
|
+
/** Error source, must be _files_ */
|
|
4105
|
+
source: string
|
|
4106
|
+
/** The section of the user's Telegram Passport which has the issue, one of “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
|
|
4107
|
+
type: string
|
|
4108
|
+
/** List of base64-encoded file hashes */
|
|
4109
|
+
file_hashes: Array<string>
|
|
4110
|
+
/** Error message */
|
|
4111
|
+
message: string
|
|
4112
|
+
}
|
|
4113
|
+
|
|
4114
|
+
/** Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. */
|
|
4115
|
+
export interface PassportElementErrorTranslationFile {
|
|
4116
|
+
/** Error source, must be _translation\_file_ */
|
|
4117
|
+
source: string
|
|
4118
|
+
/** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
|
|
4119
|
+
type: string
|
|
4120
|
+
/** Base64-encoded file hash */
|
|
4121
|
+
file_hash: string
|
|
4122
|
+
/** Error message */
|
|
4123
|
+
message: string
|
|
4124
|
+
}
|
|
4125
|
+
|
|
4126
|
+
/** Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. */
|
|
4127
|
+
export interface PassportElementErrorTranslationFiles {
|
|
4128
|
+
/** Error source, must be _translation\_files_ */
|
|
4129
|
+
source: string
|
|
4130
|
+
/** Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver\_license”, “identity\_card”, “internal\_passport”, “utility\_bill”, “bank\_statement”, “rental\_agreement”, “passport\_registration”, “temporary\_registration” */
|
|
4131
|
+
type: string
|
|
4132
|
+
/** List of base64-encoded file hashes */
|
|
4133
|
+
file_hashes: Array<string>
|
|
4134
|
+
/** Error message */
|
|
4135
|
+
message: string
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
/** Represents an issue in an unspecified place. The error is considered resolved when new data is added. */
|
|
4139
|
+
export interface PassportElementErrorUnspecified {
|
|
4140
|
+
/** Error source, must be _unspecified_ */
|
|
4141
|
+
source: string
|
|
4142
|
+
/** Type of element of the user's Telegram Passport which has the issue */
|
|
4143
|
+
type: string
|
|
4144
|
+
/** Base64-encoded element hash */
|
|
4145
|
+
element_hash: string
|
|
4146
|
+
/** Error message */
|
|
4147
|
+
message: string
|
|
4148
|
+
}
|
|
4149
|
+
|
|
4150
|
+
/** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */
|
|
4151
|
+
export interface Game {
|
|
4152
|
+
/** Title of the game */
|
|
4153
|
+
title: string
|
|
4154
|
+
/** Description of the game */
|
|
4155
|
+
description: string
|
|
4156
|
+
/** Photo that will be displayed in the game message in chats. */
|
|
4157
|
+
photo: Array<PhotoSize>
|
|
4158
|
+
/** Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls [setGameScore](https://core.telegram.org/bots/api#setgamescore), or manually edited using [editMessageText](https://core.telegram.org/bots/api#editmessagetext). 0-4096 characters. */
|
|
4159
|
+
text?: string
|
|
4160
|
+
/** Special entities that appear in _text_, such as usernames, URLs, bot commands, etc. */
|
|
4161
|
+
text_entities?: Array<MessageEntity>
|
|
4162
|
+
/** Animation that will be displayed in the game message in chats. Upload via [BotFather](https://t.me/botfather) */
|
|
4163
|
+
animation?: Animation
|
|
4164
|
+
}
|
|
4165
|
+
|
|
4166
|
+
/** A placeholder, currently holds no information. Use [BotFather](https://t.me/botfather) to set up your game. */
|
|
4167
|
+
export interface CallbackGame {
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
/** This object represents one row of the high scores table for a game. */
|
|
4171
|
+
export interface GameHighScore {
|
|
4172
|
+
/** Position in high score table for the game */
|
|
4173
|
+
position: number
|
|
4174
|
+
/** User */
|
|
4175
|
+
user: User
|
|
4176
|
+
/** Score */
|
|
4177
|
+
score: number
|
|
4178
|
+
}
|