import type { Formattable } from "../formattable.js"; /** * This object describes the types of gifts that can be gifted to a user or a chat. */ export interface TelegramAcceptedGiftTypes { /** * True, if unlimited regular gifts are accepted */ unlimited_gifts: boolean; /** * True, if limited regular gifts are accepted */ limited_gifts: boolean; /** * True, if unique gifts or gifts that can be upgraded to unique for free are accepted */ unique_gifts: boolean; /** * True, if a Telegram Premium subscription is accepted */ premium_subscription: boolean; /** * True, if transfers of unique gifts from channels are accepted */ gifts_from_channels: boolean; } /** * Contains information about the affiliate that received a commission via this transaction. */ export interface TelegramAffiliateInfo { /** * Optional. The bot or the user that received an affiliate commission if it was received by a bot or a user */ affiliate_user?: TelegramUser; /** * Optional. The chat that received an affiliate commission if it was received by a chat */ affiliate_chat?: TelegramChat; /** * The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users */ commission_per_mille: number; /** * Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds */ amount: number; /** * Optional. The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds */ nanostar_amount?: number; } /** * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */ export interface TelegramAnimation { /** * Identifier for this file, which can be used to download or reuse the file */ file_id: string; /** * 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. */ file_unique_id: string; /** * Video width as defined by the sender */ width: number; /** * Video height as defined by the sender */ height: number; /** * Duration of the video in seconds as defined by the sender */ duration: number; /** * Optional. Animation thumbnail as defined by the sender */ thumbnail?: TelegramPhotoSize; /** * Optional. Original animation filename as defined by the sender */ file_name?: string; /** * Optional. MIME type of the file as defined by the sender */ mime_type?: string; /** * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */ file_size?: number; } /** * This object represents an audio file to be treated as music by the Telegram clients. */ export interface TelegramAudio { /** * Identifier for this file, which can be used to download or reuse the file */ file_id: string; /** * 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. */ file_unique_id: string; /** * Duration of the audio in seconds as defined by the sender */ duration: number; /** * Optional. Performer of the audio as defined by the sender or by audio tags */ performer?: string; /** * Optional. Title of the audio as defined by the sender or by audio tags */ title?: string; /** * Optional. Original filename as defined by the sender */ file_name?: string; /** * Optional. MIME type of the file as defined by the sender */ mime_type?: string; /** * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */ file_size?: number; /** * Optional. Thumbnail of the album cover to which the music file belongs */ thumbnail?: TelegramPhotoSize; } /** * This object describes the way a background is filled based on the selected colors. Currently, it can be one of */ export type TelegramBackgroundFill = TelegramBackgroundFillSolid | TelegramBackgroundFillGradient | TelegramBackgroundFillFreeformGradient; /** * The background is a freeform gradient that rotates after every message in the chat. */ export interface TelegramBackgroundFillFreeformGradient { /** * Type of the background fill, always “freeform_gradient” */ type: "freeform_gradient"; /** * A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format */ colors: number[]; } /** * The background is a gradient fill. */ export interface TelegramBackgroundFillGradient { /** * Type of the background fill, always “gradient” */ type: "gradient"; /** * Top color of the gradient in the RGB24 format */ top_color: number; /** * Bottom color of the gradient in the RGB24 format */ bottom_color: number; /** * Clockwise rotation angle of the background fill in degrees; 0-359 */ rotation_angle: number; } /** * The background is filled using the selected color. */ export interface TelegramBackgroundFillSolid { /** * Type of the background fill, always “solid” */ type: "solid"; /** * The color of the background fill in the RGB24 format */ color: number; } /** * This object describes the type of a background. Currently, it can be one of */ export type TelegramBackgroundType = TelegramBackgroundTypeFill | TelegramBackgroundTypeWallpaper | TelegramBackgroundTypePattern | TelegramBackgroundTypeChatTheme; /** * The background is taken directly from a built-in chat theme. */ export interface TelegramBackgroundTypeChatTheme { /** * Type of the background, always “chat_theme” */ type: "chat_theme"; /** * Name of the chat theme, which is usually an emoji */ theme_name: string; } /** * The background is automatically filled based on the selected colors. */ export interface TelegramBackgroundTypeFill { /** * Type of the background, always “fill” */ type: "fill"; /** * The background fill */ fill: TelegramBackgroundFill; /** * Dimming of the background in dark themes, as a percentage; 0-100 */ dark_theme_dimming: number; } /** * 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. */ export interface TelegramBackgroundTypePattern { /** * Type of the background, always “pattern” */ type: "pattern"; /** * Document with the pattern */ document: TelegramDocument; /** * The background fill that is combined with the pattern */ fill: TelegramBackgroundFill; /** * Intensity of the pattern when it is shown above the filled background; 0-100 */ intensity: number; /** * Optional. 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. */ is_inverted?: true; /** * Optional. True, if the background moves slightly when the device is tilted */ is_moving?: true; } /** * The background is a wallpaper in the JPEG format. */ export interface TelegramBackgroundTypeWallpaper { /** * Type of the background, always “wallpaper” */ type: "wallpaper"; /** * Document with the wallpaper */ document: TelegramDocument; /** * Dimming of the background in dark themes, as a percentage; 0-100 */ dark_theme_dimming: number; /** * Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 */ is_blurred?: true; /** * Optional. True, if the background moves slightly when the device is tilted */ is_moving?: true; } /** * Describes the birthdate of a user. */ export interface TelegramBirthdate { /** * Day of the user's birth; 1-31 */ day: number; /** * Month of the user's birth; 1-12 */ month: number; /** * Optional. Year of the user's birth */ year?: number; } /** * This object describes the access settings of a bot. */ export interface TelegramBotAccessSettings { /** * True, if only selected users can access the bot. The bot's owner can always access it. */ is_access_restricted: boolean; /** * Optional. The list of other users who have access to the bot if the access is restricted */ added_users?: TelegramUser[]; } /** * This object represents a bot command. */ export interface TelegramBotCommand { /** * Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */ command: string; /** * Description of the command; 1-256 characters */ description: string; /** * Optional. True, if the command sends an ephemeral message, which can be seen only by the sender of the message and the bot */ is_ephemeral?: boolean; } /** * This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported: */ export type TelegramBotCommandScope = TelegramBotCommandScopeDefault | TelegramBotCommandScopeAllPrivateChats | TelegramBotCommandScopeAllGroupChats | TelegramBotCommandScopeAllChatAdministrators | TelegramBotCommandScopeChat | TelegramBotCommandScopeChatAdministrators | TelegramBotCommandScopeChatMember; /** * Represents the scope of bot commands, covering all group and supergroup chat administrators. */ export interface TelegramBotCommandScopeAllChatAdministrators { /** * Scope type, must be all_chat_administrators */ type: "all_chat_administrators"; } /** * Represents the scope of bot commands, covering all group and supergroup chats. */ export interface TelegramBotCommandScopeAllGroupChats { /** * Scope type, must be all_group_chats */ type: "all_group_chats"; } /** * Represents the scope of bot commands, covering all private chats. */ export interface TelegramBotCommandScopeAllPrivateChats { /** * Scope type, must be all_private_chats */ type: "all_private_chats"; } /** * Represents the scope of bot commands, covering a specific chat. */ export interface TelegramBotCommandScopeChat { /** * Scope type, must be chat */ type: "chat"; /** * Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. */ chat_id: number | string; } /** * Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. */ export interface TelegramBotCommandScopeChatAdministrators { /** * Scope type, must be chat_administrators */ type: "chat_administrators"; /** * Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. */ chat_id: number | string; } /** * Represents the scope of bot commands, covering a specific member of a group or supergroup chat. */ export interface TelegramBotCommandScopeChatMember { /** * Scope type, must be chat_member */ type: "chat_member"; /** * Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren't supported. */ chat_id: number | string; /** * Unique identifier of the target user */ user_id: number; } /** * Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user. */ export interface TelegramBotCommandScopeDefault { /** * Scope type, must be default */ type: "default"; } /** * This object represents the bot's description. */ export interface TelegramBotDescription { /** * The bot's description */ description: string; } /** * This object represents the bot's name. */ export interface TelegramBotName { /** * The bot's name */ name: string; } /** * This object represents the bot's short description. */ export interface TelegramBotShortDescription { /** * The bot's short description */ short_description: string; } /** * This object contains information about changes to a user payment subscription toward the current bot. */ export interface TelegramBotSubscriptionUpdated { /** * User who subscribed for payments toward the bot */ user: TelegramUser; /** * Bot-specified invoice payload */ invoice_payload: string; /** * The new state of the subscription. Currently, it can be one of “canceled” if the user canceled the subscription, “active” if the user re-enabled a previously canceled subscription, or “failed” if payment for the subscription failed. */ state: "canceled" | "active" | "failed"; } /** * Represents the rights of a business bot. */ export interface TelegramBusinessBotRights { /** * Optional. True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours */ can_reply?: true; /** * Optional. True, if the bot can mark incoming private messages as read */ can_read_messages?: true; /** * Optional. True, if the bot can delete messages sent by the bot */ can_delete_sent_messages?: true; /** * Optional. True, if the bot can delete all private messages in managed chats */ can_delete_all_messages?: true; /** * Optional. True, if the bot can edit the first and last name of the business account */ can_edit_name?: true; /** * Optional. True, if the bot can edit the bio of the business account */ can_edit_bio?: true; /** * Optional. True, if the bot can edit the profile photo of the business account */ can_edit_profile_photo?: true; /** * Optional. True, if the bot can edit the username of the business account */ can_edit_username?: true; /** * Optional. True, if the bot can change the privacy settings pertaining to gifts for the business account */ can_change_gift_settings?: true; /** * Optional. True, if the bot can view gifts and the amount of Telegram Stars owned by the business account */ can_view_gifts_and_stars?: true; /** * Optional. True, if the bot can convert regular gifts owned by the business account to Telegram Stars */ can_convert_gifts_to_stars?: true; /** * Optional. True, if the bot can transfer and upgrade gifts owned by the business account */ can_transfer_and_upgrade_gifts?: true; /** * Optional. 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 */ can_transfer_stars?: true; /** * Optional. True, if the bot can post, edit and delete stories on behalf of the business account */ can_manage_stories?: true; } /** * Describes the connection of the bot with a business account. */ export interface TelegramBusinessConnection { /** * Unique identifier of the business connection */ id: string; /** * Business account user that created the business connection */ user: TelegramUser; /** * Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ user_chat_id: number; /** * Date the connection was established in Unix time */ date: number; /** * Optional. Rights of the business bot */ rights?: TelegramBusinessBotRights; /** * True, if the connection is active */ is_enabled: boolean; } /** * Contains information about the start page settings of a Telegram Business account. */ export interface TelegramBusinessIntro { /** * Optional. Title text of the business intro */ title?: string; /** * Optional. Message text of the business intro */ message?: string; /** * Optional. Sticker of the business intro */ sticker?: TelegramSticker; } /** * Contains information about the location of a Telegram Business account. */ export interface TelegramBusinessLocation { /** * Address of the business */ address: string; /** * Optional. Location of the business */ location?: TelegramLocation; } /** * This object is received when messages are deleted from a connected business account. */ export interface TelegramBusinessMessagesDeleted { /** * Unique identifier of the business connection */ business_connection_id: string; /** * Information about a chat in the business account. The bot may not have access to the chat or the corresponding user. */ chat: TelegramChat; /** * The list of identifiers of deleted messages in the chat of the business account */ message_ids: number[]; } /** * Describes the opening hours of a business. */ export interface TelegramBusinessOpeningHours { /** * Unique name of the time zone for which the opening hours are defined */ time_zone_name: string; /** * List of time intervals describing business opening hours */ opening_hours: TelegramBusinessOpeningHoursInterval[]; } /** * Describes an interval of time during which a business is open. */ export interface TelegramBusinessOpeningHoursInterval { /** * 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 */ opening_minute: number; /** * 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 */ closing_minute: number; } /** * A placeholder, currently holds no information. Use BotFather to set up your game. */ export interface TelegramCallbackGame { } /** * This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. */ export interface TelegramCallbackQuery { /** * Unique identifier for this query */ id: string; /** * Sender */ from: TelegramUser; /** * Optional. Message sent by the bot with the callback button that originated the query */ message?: TelegramMaybeInaccessibleMessage; /** * Optional. Identifier of the message sent via the bot in inline mode, that originated the query */ inline_message_id?: string; /** * Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */ chat_instance: string; /** * Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data. */ data?: string; /** * Optional. Short name of a Game to be returned, serves as the unique identifier for the game */ game_short_name?: string; } /** * This object represents a chat. */ export interface TelegramChat { /** * Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ id: number; /** * Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */ type: "private" | "group" | "supergroup" | "channel"; /** * Optional. Title, for supergroups, channels and group chats */ title?: string; /** * Optional. Username, for private chats, supergroups and channels if available */ username?: string; /** * Optional. First name of the other party in a private chat */ first_name?: string; /** * Optional. Last name of the other party in a private chat */ last_name?: string; /** * Optional. True, if the supergroup chat is a forum (has topics enabled) */ is_forum?: true; /** * Optional. True, if the chat is the direct messages chat of a channel */ is_direct_messages?: true; } /** * Represents the rights of an administrator in a chat. */ export interface TelegramChatAdministratorRights { /** * True, if the user's presence in the chat is hidden */ is_anonymous: boolean; /** * 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. */ can_manage_chat: boolean; /** * True, if the administrator can delete messages of other users */ can_delete_messages: boolean; /** * True, if the administrator can manage video chats */ can_manage_video_chats: boolean; /** * True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */ can_restrict_members: boolean; /** * 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) */ can_promote_members: boolean; /** * True, if the user is allowed to change the chat title, photo and other settings */ can_change_info: boolean; /** * True, if the user is allowed to invite new users to the chat */ can_invite_users: boolean; /** * True, if the administrator can post stories to the chat */ can_post_stories: boolean; /** * 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 */ can_edit_stories: boolean; /** * True, if the administrator can delete stories posted by other users */ can_delete_stories: boolean; /** * Optional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */ can_post_messages?: boolean; /** * Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only */ can_edit_messages?: boolean; /** * Optional. True, if the user is allowed to pin messages; for groups and supergroups only */ can_pin_messages?: boolean; /** * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */ can_manage_topics?: boolean; /** * Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */ can_manage_direct_messages?: boolean; /** * Optional. True, if the administrator can edit the tags of regular members; for groups and supergroups only */ can_manage_tags?: boolean; /** * True, if the administrator can manage chat welcome messages or directly send them in the case of bots */ can_send_welcome_messages: boolean; } /** * This object represents a chat background. */ export interface TelegramChatBackground { /** * Type of the background */ type: TelegramBackgroundType; } /** * This object contains information about a chat boost. */ export interface TelegramChatBoost { /** * Unique identifier of the boost */ boost_id: string; /** * Point in time (Unix timestamp) when the chat was boosted */ add_date: number; /** * Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */ expiration_date: number; /** * Source of the added boost */ source: TelegramChatBoostSource; } /** * This object represents a service message about a user boosting a chat. */ export interface TelegramChatBoostAdded { /** * Number of boosts added by the user */ boost_count: number; } /** * This object represents a boost removed from a chat. */ export interface TelegramChatBoostRemoved { /** * Chat which was boosted */ chat: TelegramChat; /** * Unique identifier of the boost */ boost_id: string; /** * Point in time (Unix timestamp) when the boost was removed */ remove_date: number; /** * Source of the removed boost */ source: TelegramChatBoostSource; } /** * This object describes the source of a chat boost. It can be one of */ export type TelegramChatBoostSource = TelegramChatBoostSourcePremium | TelegramChatBoostSourceGiftCode | TelegramChatBoostSourceGiveaway; /** * 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. */ export interface TelegramChatBoostSourceGiftCode { /** * Source of the boost, always “gift_code” */ source: "gift_code"; /** * User for which the gift code was created */ user: TelegramUser; } /** * 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. */ export interface TelegramChatBoostSourceGiveaway { /** * Source of the boost, always “giveaway” */ source: "giveaway"; /** * 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. */ giveaway_message_id: number; /** * Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only */ user?: TelegramUser; /** * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */ prize_star_count?: number; /** * Optional. True, if the giveaway was completed, but there was no user to win the prize */ is_unclaimed?: true; } /** * The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user. */ export interface TelegramChatBoostSourcePremium { /** * Source of the boost, always “premium” */ source: "premium"; /** * User that boosted the chat */ user: TelegramUser; } /** * This object represents a boost added to a chat or changed. */ export interface TelegramChatBoostUpdated { /** * Chat which was boosted */ chat: TelegramChat; /** * Information about the chat boost */ boost: TelegramChatBoost; } /** * This object contains full information about a chat. */ export interface TelegramChatFullInfo { /** * Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ id: number; /** * Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */ type: "private" | "group" | "supergroup" | "channel"; /** * Optional. Title, for supergroups, channels and group chats */ title?: string; /** * Optional. Username, for private chats, supergroups and channels if available */ username?: string; /** * Optional. First name of the other party in a private chat */ first_name?: string; /** * Optional. Last name of the other party in a private chat */ last_name?: string; /** * Optional. True, if the supergroup chat is a forum (has topics enabled) */ is_forum?: true; /** * Optional. True, if the chat is the direct messages chat of a channel */ is_direct_messages?: true; /** * Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. */ accent_color_id: number; /** * The maximum number of reactions that can be set on a message in the chat */ max_reaction_count: number; /** * Optional. Chat photo */ photo?: TelegramChatPhoto; /** * Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels */ active_usernames?: string[]; /** * Optional. For private chats, the date of birth of the user */ birthdate?: TelegramBirthdate; /** * Optional. For private chats with business accounts, the intro of the business */ business_intro?: TelegramBusinessIntro; /** * Optional. For private chats with business accounts, the location of the business */ business_location?: TelegramBusinessLocation; /** * Optional. For private chats with business accounts, the opening hours of the business */ business_opening_hours?: TelegramBusinessOpeningHours; /** * Optional. For private chats, the personal channel of the user */ personal_chat?: TelegramChat; /** * Optional. Information about the corresponding channel chat; for direct messages chats only */ parent_chat?: TelegramChat; /** * Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. */ available_reactions?: TelegramReactionType[]; /** * Optional. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background */ background_custom_emoji_id?: string; /** * Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. */ profile_accent_color_id?: number; /** * Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background */ profile_background_custom_emoji_id?: string; /** * Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat */ emoji_status_custom_emoji_id?: string; /** * Optional. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any */ emoji_status_expiration_date?: number; /** * Optional. Bio of the other party in a private chat */ bio?: string; /** * Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user */ has_private_forwards?: true; /** * Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat */ has_restricted_voice_and_video_messages?: true; /** * Optional. True, if users need to join the supergroup before they can send messages */ join_to_send_messages?: true; /** * Optional. True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators */ join_by_request?: true; /** * Optional. Description, for groups, supergroups and channel chats */ description?: string; /** * Optional. Primary invite link, for groups, supergroups and channel chats */ invite_link?: string; /** * Optional. The most recent pinned message (by sending date) */ pinned_message?: TelegramMessage; /** * Optional. Default chat member permissions, for groups and supergroups */ permissions?: TelegramChatPermissions; /** * Information about types of gifts that are accepted by the chat or by the corresponding user for private chats */ accepted_gift_types: TelegramAcceptedGiftTypes; /** * Optional. True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. */ can_send_paid_media?: true; /** * Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds */ slow_mode_delay?: number; /** * Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions */ unrestrict_boost_count?: number; /** * Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds */ message_auto_delete_time?: number; /** * Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. */ has_aggressive_anti_spam_enabled?: true; /** * Optional. True, if non-administrators can only get the list of bots and administrators in the chat */ has_hidden_members?: true; /** * Optional. True, if messages from the chat can't be forwarded to other chats */ has_protected_content?: true; /** * Optional. True, if new chat members will have access to old messages; available only to chat administrators */ has_visible_history?: true; /** * Optional. For supergroups, name of the group sticker set */ sticker_set_name?: string; /** * Optional. True, if the bot can change the group sticker set */ can_set_sticker_set?: true; /** * Optional. 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. */ custom_emoji_sticker_set_name?: string; /** * Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. */ linked_chat_id?: number; /** * Optional. For supergroups, the location to which the supergroup is connected */ location?: TelegramChatLocation; /** * Optional. For private chats, the rating of the user if any */ rating?: TelegramUserRating; /** * Optional. For private chats, the first audio added to the profile of the user */ first_profile_audio?: TelegramAudio; /** * Optional. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */ unique_gift_colors?: TelegramUniqueGiftColors; /** * Optional. The number of Telegram Stars a general user has to pay to send a message to the chat */ paid_message_star_count?: number; /** * Optional. The bot that processes join request queries in the chat. The field is only available to chat administrators. */ guard_bot?: TelegramUser; /** * Optional. The Community to which the chat belongs */ community?: TelegramCommunity; } /** * Represents an invite link for a chat. */ export interface TelegramChatInviteLink { /** * The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */ invite_link: string; /** * Creator of the link */ creator: TelegramUser; /** * True, if users joining the chat via the link need to be approved by chat administrators */ creates_join_request: boolean; /** * True, if the link is primary */ is_primary: boolean; /** * True, if the link is revoked */ is_revoked: boolean; /** * Optional. Invite link name */ name?: string; /** * Optional. Point in time (Unix timestamp) when the link will expire or has been expired */ expire_date?: number; /** * Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ member_limit?: number; /** * Optional. Number of pending join requests created using this link */ pending_join_request_count?: number; /** * Optional. The number of seconds the subscription will be active for before the next payment */ subscription_period?: number; /** * Optional. 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 */ subscription_price?: number; } /** * Represents a join request sent to a chat. */ export interface TelegramChatJoinRequest { /** * Chat to which the request was sent */ chat: TelegramChat; /** * User that sent the join request */ from: TelegramUser; /** * Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. */ user_chat_id: number; /** * Date the request was sent in Unix time */ date: number; /** * Optional. Bio of the user */ bio?: string; /** * Optional. Chat invite link that was used by the user to send the join request */ invite_link?: TelegramChatInviteLink; /** * Optional. Identifier of the join request query; for bots assigned to process join requests only. If present, then the bot must call sendChatJoinRequestWebApp or directly call answerChatJoinRequestQuery within 10 seconds. */ query_id?: string; } /** * Represents a location to which a chat is connected. */ export interface TelegramChatLocation { /** * The location to which the supergroup is connected. Can't be a live location. */ location: TelegramLocation; /** * Location address; 1-64 characters, as defined by the chat owner */ address: string; } /** * This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: */ export type TelegramChatMember = TelegramChatMemberOwner | TelegramChatMemberAdministrator | TelegramChatMemberMember | TelegramChatMemberRestricted | TelegramChatMemberLeft | TelegramChatMemberBanned; /** * Represents a chat member that has some additional privileges. */ export interface TelegramChatMemberAdministrator { /** * The member's status in the chat, always “administrator” */ status: "administrator"; /** * Information about the user */ user: TelegramUser; /** * True, if the bot is allowed to edit administrator privileges of that user */ can_be_edited: boolean; /** * True, if the user's presence in the chat is hidden */ is_anonymous: boolean; /** * 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. */ can_manage_chat: boolean; /** * True, if the administrator can delete messages of other users */ can_delete_messages: boolean; /** * True, if the administrator can manage video chats */ can_manage_video_chats: boolean; /** * True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics */ can_restrict_members: boolean; /** * 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) */ can_promote_members: boolean; /** * True, if the user is allowed to change the chat title, photo and other settings */ can_change_info: boolean; /** * True, if the user is allowed to invite new users to the chat */ can_invite_users: boolean; /** * True, if the administrator can post stories to the chat */ can_post_stories: boolean; /** * 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 */ can_edit_stories: boolean; /** * True, if the administrator can delete stories posted by other users */ can_delete_stories: boolean; /** * Optional. True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only */ can_post_messages?: boolean; /** * Optional. True, if the administrator can edit messages of other users and can pin messages; for channels only */ can_edit_messages?: boolean; /** * Optional. True, if the user is allowed to pin messages; for groups and supergroups only */ can_pin_messages?: boolean; /** * Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only */ can_manage_topics?: boolean; /** * Optional. True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */ can_manage_direct_messages?: boolean; /** * Optional. True, if the administrator can edit the tags of regular members; for groups and supergroups only */ can_manage_tags?: boolean; /** * True, if the administrator can manage chat welcome messages or directly send them in the case of bots */ can_send_welcome_messages: boolean; /** * Optional. Custom title for this user */ custom_title?: string; } /** * Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. */ export interface TelegramChatMemberBanned { /** * The member's status in the chat, always “kicked” */ status: "kicked"; /** * Information about the user */ user: TelegramUser; /** * Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever. */ until_date: number; } /** * Represents a chat member that isn't currently a member of the chat, but may join it themselves. */ export interface TelegramChatMemberLeft { /** * The member's status in the chat, always “left” */ status: "left"; /** * Information about the user */ user: TelegramUser; } /** * Represents a chat member that has no additional privileges or restrictions. */ export interface TelegramChatMemberMember { /** * The member's status in the chat, always “member” */ status: "member"; /** * Optional. Tag of the member */ tag?: string; /** * Information about the user */ user: TelegramUser; /** * Optional. Date when the user's subscription will expire; Unix time */ until_date?: number; } /** * Represents a chat member that owns the chat and has all administrator privileges. */ export interface TelegramChatMemberOwner { /** * The member's status in the chat, always “creator” */ status: "creator"; /** * Information about the user */ user: TelegramUser; /** * True, if the user's presence in the chat is hidden */ is_anonymous: boolean; /** * Optional. Custom title for this user */ custom_title?: string; } /** * Represents a chat member that is under certain restrictions in the chat. Supergroups only. */ export interface TelegramChatMemberRestricted { /** * The member's status in the chat, always “restricted” */ status: "restricted"; /** * Optional. Tag of the member */ tag?: string; /** * Information about the user */ user: TelegramUser; /** * True, if the user is a member of the chat at the moment of the request */ is_member: boolean; /** * True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues */ can_send_messages: boolean; /** * True, if the user is allowed to send audios */ can_send_audios: boolean; /** * True, if the user is allowed to send documents */ can_send_documents: boolean; /** * True, if the user is allowed to send photos */ can_send_photos: boolean; /** * True, if the user is allowed to send videos */ can_send_videos: boolean; /** * True, if the user is allowed to send video notes */ can_send_video_notes: boolean; /** * True, if the user is allowed to send voice notes */ can_send_voice_notes: boolean; /** * True, if the user is allowed to send polls and checklists */ can_send_polls: boolean; /** * True, if the user is allowed to send animations, games, stickers and use inline bots */ can_send_other_messages: boolean; /** * True, if the user is allowed to add web page previews to their messages */ can_add_web_page_previews: boolean; /** * True, if the user is allowed to react to messages */ can_react_to_messages: boolean; /** * True, if the user is allowed to edit their own tag */ can_edit_tag: boolean; /** * True, if the user is allowed to change the chat title, photo and other settings */ can_change_info: boolean; /** * True, if the user is allowed to invite new users to the chat */ can_invite_users: boolean; /** * True, if the user is allowed to pin messages */ can_pin_messages: boolean; /** * True, if the user is allowed to create forum topics */ can_manage_topics: boolean; /** * Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever. */ until_date: number; } /** * This object represents changes in the status of a chat member. */ export interface TelegramChatMemberUpdated { /** * Chat the user belongs to */ chat: TelegramChat; /** * Performer of the action, which resulted in the change */ from: TelegramUser; /** * Date the change was done in Unix time */ date: number; /** * Previous information about the chat member */ old_chat_member: TelegramChatMember; /** * New information about the chat member */ new_chat_member: TelegramChatMember; /** * Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only */ invite_link?: TelegramChatInviteLink; /** * Optional. True, if the user joined the chat after sending a direct join request without using an invite link and being approved by an administrator */ via_join_request?: boolean; /** * Optional. True, if the user joined the chat via a chat folder invite link */ via_chat_folder_invite_link?: boolean; } /** * Describes a service message about an ownership change in the chat. */ export interface TelegramChatOwnerChanged { /** * The new owner of the chat */ new_owner: TelegramUser; } /** * Describes a service message about the chat owner leaving the chat. */ export interface TelegramChatOwnerLeft { /** * Optional. The user who will become the new owner of the chat if the previous owner does not return to the chat */ new_owner?: TelegramUser; } /** * Describes actions that a non-administrator user is allowed to take in a chat. */ export interface TelegramChatPermissions { /** * Optional. True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues */ can_send_messages?: boolean; /** * Optional. True, if the user is allowed to send audios */ can_send_audios?: boolean; /** * Optional. True, if the user is allowed to send documents */ can_send_documents?: boolean; /** * Optional. True, if the user is allowed to send photos */ can_send_photos?: boolean; /** * Optional. True, if the user is allowed to send videos */ can_send_videos?: boolean; /** * Optional. True, if the user is allowed to send video notes */ can_send_video_notes?: boolean; /** * Optional. True, if the user is allowed to send voice notes */ can_send_voice_notes?: boolean; /** * Optional. True, if the user is allowed to send polls and checklists */ can_send_polls?: boolean; /** * Optional. True, if the user is allowed to send animations, games, stickers and use inline bots */ can_send_other_messages?: boolean; /** * Optional. True, if the user is allowed to add web page previews to their messages */ can_add_web_page_previews?: boolean; /** * Optional. True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages. */ can_react_to_messages?: boolean; /** * Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages. */ can_edit_tag?: boolean; /** * Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups. */ can_change_info?: boolean; /** * Optional. True, if the user is allowed to invite new users to the chat */ can_invite_users?: boolean; /** * Optional. True, if the user is allowed to pin messages. Ignored in public supergroups. */ can_pin_messages?: boolean; /** * Optional. True, if the user is allowed to create forum topics. If omitted, defaults to the value of can_pin_messages. */ can_manage_topics?: boolean; } /** * This object represents a chat photo. */ export interface TelegramChatPhoto { /** * 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. */ small_file_id: string; /** * 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. */ small_file_unique_id: string; /** * 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. */ big_file_id: string; /** * 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. */ big_file_unique_id: string; } /** * This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */ export interface TelegramChatShared { /** * Identifier of the request */ request_id: number; /** * Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. 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. */ chat_id: number; /** * Optional. Title of the chat, if the title was requested by the bot */ title?: string; /** * Optional. Username of the chat, if the username was requested by the bot and available */ username?: string; /** * Optional. Available sizes of the chat photo, if the photo was requested by the bot */ photo?: TelegramPhotoSize[]; } /** * Describes a checklist. */ export interface TelegramChecklist { /** * Title of the checklist */ title: string; /** * Optional. Special entities that appear in the checklist title */ title_entities?: TelegramMessageEntity[]; /** * List of tasks in the checklist */ tasks: TelegramChecklistTask[]; /** * Optional. True, if users other than the creator of the list can add tasks to the list */ others_can_add_tasks?: true; /** * Optional. True, if users other than the creator of the list can mark tasks as done or not done */ others_can_mark_tasks_as_done?: true; } /** * Describes a task in a checklist. */ export interface TelegramChecklistTask { /** * Unique identifier of the task */ id: number; /** * Text of the task */ text: string; /** * Optional. Special entities that appear in the task text */ text_entities?: TelegramMessageEntity[]; /** * Optional. User that completed the task; omitted if the task wasn't completed by a user */ completed_by_user?: TelegramUser; /** * Optional. Chat that completed the task; omitted if the task wasn't completed by a chat */ completed_by_chat?: TelegramChat; /** * Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */ completion_date?: number; } /** * Describes a service message about tasks added to a checklist. */ export interface TelegramChecklistTasksAdded { /** * Optional. Message containing the checklist to which the tasks were added. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */ checklist_message?: TelegramMessage; /** * List of tasks added to the checklist */ tasks: TelegramChecklistTask[]; } /** * Describes a service message about checklist tasks marked as done or not done. */ export interface TelegramChecklistTasksDone { /** * Optional. Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply. */ checklist_message?: TelegramMessage; /** * Optional. Identifiers of the tasks that were marked as done */ marked_as_done_task_ids?: number[]; /** * Optional. Identifiers of the tasks that were marked as not done */ marked_as_not_done_task_ids?: number[]; } /** * Represents a result of an inline query that was chosen by the user and sent to their chat partner. */ export interface TelegramChosenInlineResult { /** * The unique identifier for the result that was chosen */ result_id: string; /** * The user that chose the result */ from: TelegramUser; /** * Optional. Sender location, only for bots that require user location */ location?: TelegramLocation; /** * Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */ inline_message_id?: string; /** * The query that was used to obtain the result */ query: string; } /** * Represents a community (a group of chats). */ export interface TelegramCommunity { /** * Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ id: number; /** * Name of the community */ name: string; } /** * Describes a service message about a chat or a bot being added to a community. */ export interface TelegramCommunityChatAdded { /** * The new community to which the chat or the bot belongs */ community: TelegramCommunity; } /** * Describes a service message about a chat being joined by a user from a community. */ export interface TelegramCommunityChatJoined { /** * The community from which the chat was joined */ community: TelegramCommunity; } /** * Describes a service message about a chat or a bot being removed from a community. Currently holds no information. */ export interface TelegramCommunityChatRemoved { } /** * This object represents a phone contact. */ export interface TelegramContact { /** * Contact's phone number */ phone_number: string; /** * Contact's first name */ first_name: string; /** * Optional. Contact's last name */ last_name?: string; /** * Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ user_id?: number; /** * Optional. Additional data about the contact in the form of a vCard */ vcard?: string; } /** * This object represents an inline keyboard button that copies specified text to the clipboard. */ export interface TelegramCopyTextButton { /** * The text to be copied to the clipboard; 1-256 characters */ text: string; } /** * This object represents an animated emoji that displays a random value. */ export interface TelegramDice { /** * Emoji on which the dice throw animation is based */ emoji: string; /** * Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji */ value: number; } /** * Describes a service message about a change in the price of direct messages sent to a channel chat. */ export interface TelegramDirectMessagePriceChanged { /** * True, if direct messages are enabled for the channel chat; False otherwise */ are_direct_messages_enabled: boolean; /** * Optional. 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. */ direct_message_star_count?: number; } /** * Describes a topic of a direct messages chat. */ export interface TelegramDirectMessagesTopic { /** * Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ topic_id: number; /** * Optional. Information about the user that created the topic. Currently, it is always present. */ user?: TelegramUser; } /** * This object represents a disabled button which does nothing. Currently holds no information. */ export interface TelegramDisabledButton { } /** * This object represents a general file (as opposed to photos, voice messages and audio files). */ export interface TelegramDocument { /** * Identifier for this file, which can be used to download or reuse the file */ file_id: string; /** * 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. */ file_unique_id: string; /** * Optional. Document thumbnail as defined by the sender */ thumbnail?: TelegramPhotoSize; /** * Optional. Original filename as defined by the sender */ file_name?: string; /** * Optional. MIME type of the file as defined by the sender */ mime_type?: string; /** * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */ file_size?: number; } /** * Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. */ export interface TelegramEncryptedCredentials { /** * Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */ data: string; /** * Base64-encoded data hash for data authentication */ hash: string; /** * Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */ secret: string; } /** * Describes documents or other Telegram Passport elements shared with the bot by the user. */ export interface TelegramEncryptedPassportElement { /** * 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”. */ type: "personal_details" | "passport" | "driver_license" | "identity_card" | "internal_passport" | "address" | "utility_bill" | "bank_statement" | "rental_agreement" | "passport_registration" | "temporary_registration" | "phone_number" | "email"; /** * Optional. 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. */ data?: string; /** * Optional. User's verified phone number; available only for “phone_number” type */ phone_number?: string; /** * Optional. User's verified email address; available only for “email” type */ email?: string; /** * Optional. 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. */ files?: TelegramPassportFile[]; /** * Optional. 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. */ front_side?: TelegramPassportFile; /** * Optional. 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. */ reverse_side?: TelegramPassportFile; /** * Optional. 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. */ selfie?: TelegramPassportFile; /** * Optional. 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. */ translation?: TelegramPassportFile[]; /** * Base64-encoded element hash for using in PassportElementErrorUnspecified */ hash: string; } export interface TelegramEphemeralMessageParameters { /** * Identifier of the user who will receive the message. It is not guaranteed that the user will receive the message, especially if they are offline. See here for more details. */ receiver_user_id: number; /** * Optional. Identifier of the callback query which triggered the message, if any */ callback_query_id?: string; /** * Optional. Pass True if the ephemeral message must be shown in place of the original message. Must be False for callback queries from ephemeral messages, which must be edited using regular editEphemeralMessage… methods. */ replace_callback_query_message?: boolean; } /** * This object contains information about a message that is being replied to, which may come from another chat or forum topic. */ export interface TelegramExternalReplyInfo { /** * Origin of the message replied to by the given message */ origin: TelegramMessageOrigin; /** * Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */ chat?: TelegramChat; /** * Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */ message_id?: number; /** * Optional. Options used for link preview generation for the original message, if it is a text message */ link_preview_options?: TelegramLinkPreviewOptions; /** * Optional. Message is an animation, information about the animation */ animation?: TelegramAnimation; /** * Optional. Message is an audio file, information about the file */ audio?: TelegramAudio; /** * Optional. Message is a general file, information about the file */ document?: TelegramDocument; /** * Optional. Message is a live photo, information about the live photo */ live_photo?: TelegramLivePhoto; /** * Optional. Message contains paid media; information about the paid media */ paid_media?: TelegramPaidMediaInfo; /** * Optional. Message is a photo, available sizes of the photo */ photo?: TelegramPhotoSize[]; /** * Optional. Message is a sticker, information about the sticker */ sticker?: TelegramSticker; /** * Optional. Message is a forwarded story */ story?: TelegramStory; /** * Optional. Message is a video, information about the video */ video?: TelegramVideo; /** * Optional. Message is a video note, information about the video message */ video_note?: TelegramVideoNote; /** * Optional. Message is a voice message, information about the file */ voice?: TelegramVoice; /** * Optional. True, if the message media is covered by a spoiler animation */ has_media_spoiler?: true; /** * Optional. Message is a checklist */ checklist?: TelegramChecklist; /** * Optional. Message is a shared contact, information about the contact */ contact?: TelegramContact; /** * Optional. Message is a dice with random value */ dice?: TelegramDice; /** * Optional. Message is a game, information about the game. More about games » */ game?: TelegramGame; /** * Optional. Message is a scheduled giveaway, information about the giveaway */ giveaway?: TelegramGiveaway; /** * Optional. A giveaway with public winners was completed */ giveaway_winners?: TelegramGiveawayWinners; /** * Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ invoice?: TelegramInvoice; /** * Optional. Message is a shared location, information about the location */ location?: TelegramLocation; /** * Optional. Message is a native poll, information about the poll */ poll?: TelegramPoll; /** * Optional. Message is a venue, information about the venue */ venue?: TelegramVenue; } /** * This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. 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. */ export interface TelegramFile { /** * Identifier for this file, which can be used to download or reuse the file */ file_id: string; /** * 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. */ file_unique_id: string; /** * Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value. */ file_size?: number; /** * Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. */ file_path?: string; } /** * Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account. */ export interface TelegramForceReply { /** * Shows reply interface to the user, as if they had manually selected the bot's message and tapped 'Reply' */ force_reply: true; /** * Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters */ input_field_placeholder?: string; /** * Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message. */ selective?: boolean; } /** * This object represents a forum topic. */ export interface TelegramForumTopic { /** * Unique identifier of the forum topic */ message_thread_id: number; /** * Name of the topic */ name: string; /** * Color of the topic icon in RGB format */ icon_color: number; /** * Optional. Unique identifier of the custom emoji shown as the topic icon */ icon_custom_emoji_id?: string; /** * Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */ is_name_implicit?: true; } /** * This object represents a service message about a forum topic closed in the chat. Currently holds no information. */ export interface TelegramForumTopicClosed { } /** * This object represents a service message about a new forum topic created in the chat. */ export interface TelegramForumTopicCreated { /** * Name of the topic */ name: string; /** * Color of the topic icon in RGB format */ icon_color: number; /** * Optional. Unique identifier of the custom emoji shown as the topic icon */ icon_custom_emoji_id?: string; /** * Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */ is_name_implicit?: true; } /** * This object represents a service message about an edited forum topic. */ export interface TelegramForumTopicEdited { /** * Optional. New name of the topic, if it was edited */ name?: string; /** * Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */ icon_custom_emoji_id?: string; } /** * This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */ export interface TelegramForumTopicReopened { } /** * This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */ export interface TelegramGame { /** * Title of the game */ title: string; /** * Description of the game */ description: string; /** * Photo that will be displayed in the game message in chats */ photo: TelegramPhotoSize[]; /** * Optional. 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, or manually edited using editMessageText. 0-4096 characters. */ text?: string; /** * Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. */ text_entities?: TelegramMessageEntity[]; /** * Optional. Animation that will be displayed in the game message in chats. Upload via BotFather. */ animation?: TelegramAnimation; } /** * This object represents one row of the high scores table for a game. */ export interface TelegramGameHighScore { /** * Position in high score table for the game */ position: number; /** * User */ user: TelegramUser; /** * Score */ score: number; } /** * This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */ export interface TelegramGeneralForumTopicHidden { } /** * This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */ export interface TelegramGeneralForumTopicUnhidden { } /** * This object represents a gift that can be sent by the bot. */ export interface TelegramGift { /** * Unique identifier of the gift */ id: string; /** * The sticker that represents the gift */ sticker: TelegramSticker; /** * The number of Telegram Stars that must be paid to send the sticker */ star_count: number; /** * Optional. The number of Telegram Stars that must be paid to upgrade the gift to a unique one */ upgrade_star_count?: number; /** * Optional. True, if the gift can only be purchased by Telegram Premium subscribers */ is_premium?: true; /** * Optional. True, if the gift can be used (after being upgraded) to customize a user's appearance */ has_colors?: true; /** * Optional. The total number of gifts of this type that can be sent by all users; for limited gifts only */ total_count?: number; /** * Optional. The number of remaining gifts of this type that can be sent by all users; for limited gifts only */ remaining_count?: number; /** * Optional. The total number of gifts of this type that can be sent by the bot; for limited gifts only */ personal_total_count?: number; /** * Optional. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only */ personal_remaining_count?: number; /** * Optional. Background of the gift */ background?: TelegramGiftBackground; /** * Optional. The total number of different unique gifts that can be obtained by upgrading the gift */ unique_gift_variant_count?: number; /** * Optional. Information about the chat that published the gift */ publisher_chat?: TelegramChat; } /** * This object describes the background of a gift. */ export interface TelegramGiftBackground { /** * Center color of the background in RGB format */ center_color: number; /** * Edge color of the background in RGB format */ edge_color: number; /** * Text color of the background in RGB format */ text_color: number; } /** * Describes a service message about a regular gift that was sent or received. */ export interface TelegramGiftInfo { /** * Information about the gift */ gift: TelegramGift; /** * Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts */ owned_gift_id?: string; /** * Optional. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */ convert_star_count?: number; /** * Optional. Number of Telegram Stars that were prepaid for the ability to upgrade the gift */ prepaid_upgrade_star_count?: number; /** * Optional. True, if the gift's upgrade was purchased after the gift was sent */ is_upgrade_separate?: true; /** * Optional. True, if the gift can be upgraded to a unique gift */ can_be_upgraded?: true; /** * Optional. Text of the message that was added to the gift */ text?: string; /** * Optional. Special entities that appear in the text */ entities?: TelegramMessageEntity[]; /** * Optional. True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */ is_private?: true; /** * Optional. Unique number reserved for this gift when upgraded. See the number field in UniqueGift. */ unique_gift_number?: number; } /** * This object represent a list of gifts. */ export interface TelegramGifts { /** * The list of gifts */ gifts: TelegramGift[]; } /** * This object represents a message about a scheduled giveaway. */ export interface TelegramGiveaway { /** * The list of chats which the user must join to participate in the giveaway */ chats: TelegramChat[]; /** * Point in time (Unix timestamp) when winners of the giveaway will be selected */ winners_selection_date: number; /** * The number of users which are supposed to be selected as winners of the giveaway */ winner_count: number; /** * Optional. True, if only users who join the chats after the giveaway started should be eligible to win */ only_new_members?: true; /** * Optional. True, if the list of giveaway winners will be visible to everyone */ has_public_winners?: true; /** * Optional. Description of additional giveaway prize */ prize_description?: string; /** * Optional. A list of two-letter 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. */ country_codes?: string[]; /** * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */ prize_star_count?: number; /** * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */ premium_subscription_month_count?: number; } /** * This object represents a service message about the completion of a giveaway without public winners. */ export interface TelegramGiveawayCompleted { /** * Number of winners in the giveaway */ winner_count: number; /** * Optional. Number of undistributed prizes */ unclaimed_prize_count?: number; /** * Optional. Message with the giveaway that was completed, if it wasn't deleted */ giveaway_message?: TelegramMessage; /** * Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */ is_star_giveaway?: true; } /** * This object represents a service message about the creation of a scheduled giveaway. */ export interface TelegramGiveawayCreated { /** * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */ prize_star_count?: number; } /** * This object represents a message about the completion of a giveaway with public winners. */ export interface TelegramGiveawayWinners { /** * The chat that created the giveaway */ chat: TelegramChat; /** * Identifier of the message with the giveaway in the chat */ giveaway_message_id: number; /** * Point in time (Unix timestamp) when winners of the giveaway were selected */ winners_selection_date: number; /** * Total number of winners in the giveaway */ winner_count: number; /** * List of up to 100 winners of the giveaway */ winners: TelegramUser[]; /** * Optional. The number of other chats the user had to join in order to be eligible for the giveaway */ additional_chat_count?: number; /** * Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */ prize_star_count?: number; /** * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */ premium_subscription_month_count?: number; /** * Optional. Number of undistributed prizes */ unclaimed_prize_count?: number; /** * Optional. True, if only users who had joined the chats after the giveaway started were eligible to win */ only_new_members?: true; /** * Optional. True, if the giveaway was canceled because the payment for it was refunded */ was_refunded?: true; /** * Optional. Description of additional giveaway prize */ prize_description?: string; } /** * This object describes a message that was deleted or is otherwise inaccessible to the bot. */ export interface TelegramInaccessibleMessage { /** * Chat the message belonged to */ chat: TelegramChat; /** * Unique message identifier inside the chat */ message_id: number; /** * Always 0. The field can be used to differentiate regular and inaccessible messages. */ date: number; } /** * This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. */ export interface TelegramInlineKeyboardButton { /** * Label text on the button */ text: string; /** * Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */ icon_custom_emoji_id?: string; /** * Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */ style?: "danger" | "success" | "primary"; /** * Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id= can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. */ url?: string; /** * Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */ callback_data?: string; /** * Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account. */ web_app?: TelegramWebAppInfo; /** * Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. Not supported for ephemeral messages. */ login_url?: TelegramLoginUrl; /** * Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. 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 business account. */ switch_inline_query?: string; /** * Optional. 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.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 business account. */ switch_inline_query_current_chat?: string; /** * Optional. 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 business account. */ switch_inline_query_chosen_chat?: TelegramSwitchInlineQueryChosenChat; /** * Optional. Description of the button that copies the specified text to the clipboard */ copy_text?: TelegramCopyTextButton; /** * Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. */ callback_game?: TelegramCallbackGame; /** * Optional. Specify True, to send a Pay button. Substrings “” and “XTR” in the buttons's text will be replaced with a Telegram Star icon.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */ pay?: boolean; /** * Optional. If set, then the button is disabled and does nothing */ disabled?: TelegramDisabledButton; } /** * This object represents an inline keyboard that appears right next to the message it belongs to. */ export interface TelegramInlineKeyboardMarkup { /** * Array of button rows, each represented by an Array of InlineKeyboardButton objects */ inline_keyboard: TelegramInlineKeyboardButton[][]; /** * Optional. Pass True if the reply interface must be shown to the user, as if they had manually selected the bot's message and tapped 'Reply'. The value of the field can't be changed when the inline keyboard is edited. */ force_reply?: boolean; } /** * This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */ export interface TelegramInlineQuery { /** * Unique identifier for this query */ id: string; /** * Sender */ from: TelegramUser; /** * Text of the query (up to 256 characters) */ query: string; /** * Offset of the results to be returned, can be controlled by the bot */ offset: string; /** * Optional. 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. */ chat_type?: "sender" | "private" | "group" | "supergroup" | "channel"; /** * Optional. Sender location, only for bots that request user location */ location?: TelegramLocation; } /** * This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: * Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public. */ export type TelegramInlineQueryResult = TelegramInlineQueryResultCachedAudio | TelegramInlineQueryResultCachedDocument | TelegramInlineQueryResultCachedGif | TelegramInlineQueryResultCachedMpeg4Gif | TelegramInlineQueryResultCachedPhoto | TelegramInlineQueryResultCachedSticker | TelegramInlineQueryResultCachedVideo | TelegramInlineQueryResultCachedVoice | TelegramInlineQueryResultArticle | TelegramInlineQueryResultAudio | TelegramInlineQueryResultContact | TelegramInlineQueryResultGame | TelegramInlineQueryResultDocument | TelegramInlineQueryResultGif | TelegramInlineQueryResultLocation | TelegramInlineQueryResultMpeg4Gif | TelegramInlineQueryResultPhoto | TelegramInlineQueryResultVenue | TelegramInlineQueryResultVideo | TelegramInlineQueryResultVoice; /** * Represents a link to an article or web page. */ export interface TelegramInlineQueryResultArticle { /** * Type of the result, must be article */ type: "article"; /** * Unique identifier for this result, 1-64 Bytes */ id: string; /** * Title of the result */ title: string; /** * Content of the message to be sent */ input_message_content: TelegramInputMessageContent; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. URL of the result */ url?: string; /** * Optional. Short description of the result */ description?: string; /** * Optional. Url of the thumbnail for the result */ thumbnail_url?: string; /** * Optional. Thumbnail width */ thumbnail_width?: number; /** * Optional. Thumbnail height */ thumbnail_height?: number; } /** * 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. */ export interface TelegramInlineQueryResultAudio { /** * Type of the result, must be audio */ type: "audio"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL for the audio file */ audio_url: string; /** * Title */ title: string; /** * Optional. Caption, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Performer */ performer?: string; /** * Optional. Audio duration in seconds */ audio_duration?: number; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the audio */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedAudio { /** * Type of the result, must be audio */ type: "audio"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier for the audio file */ audio_file_id: string; /** * Optional. Caption, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the audio */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedDocument { /** * Type of the result, must be document */ type: "document"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * Title for the result */ title: string; /** * A valid file identifier for the file */ document_file_id: string; /** * Optional. Short description of the result */ description?: string; /** * Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the document caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the file */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedGif { /** * Type of the result, must be gif */ type: "gif"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier for the GIF file */ gif_file_id: string; /** * Optional. Title for the result */ title?: string; /** * Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the GIF animation */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedMpeg4Gif { /** * Type of the result, must be mpeg4_gif */ type: "mpeg4_gif"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier for the MPEG4 file */ mpeg4_file_id: string; /** * Optional. Title for the result */ title?: string; /** * Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the video animation */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedPhoto { /** * Type of the result, must be photo */ type: "photo"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier of the photo */ photo_file_id: string; /** * Optional. Title for the result */ title?: string; /** * Optional. Short description of the result */ description?: string; /** * Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the photo */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedSticker { /** * Type of the result, must be sticker */ type: "sticker"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier of the sticker */ sticker_file_id: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the sticker */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedVideo { /** * Type of the result, must be video */ type: "video"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier for the video file */ video_file_id: string; /** * Title for the result */ title: string; /** * Optional. Short description of the result */ description?: string; /** * Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the video caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the video */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultCachedVoice { /** * Type of the result, must be voice */ type: "voice"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid file identifier for the voice message */ voice_file_id: string; /** * Voice message title */ title: string; /** * Optional. Caption, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the voice message */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultContact { /** * Type of the result, must be contact */ type: "contact"; /** * Unique identifier for this result, 1-64 Bytes */ id: string; /** * Contact's phone number */ phone_number: string; /** * Contact's first name */ first_name: string; /** * Optional. Contact's last name */ last_name?: string; /** * Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes */ vcard?: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the contact */ input_message_content?: TelegramInputMessageContent; /** * Optional. Url of the thumbnail for the result */ thumbnail_url?: string; /** * Optional. Thumbnail width */ thumbnail_width?: number; /** * Optional. Thumbnail height */ thumbnail_height?: number; } /** * 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. */ export interface TelegramInlineQueryResultDocument { /** * Type of the result, must be document */ type: "document"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * Title for the result */ title: string; /** * Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the document caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * A valid URL for the file */ document_url: string; /** * MIME type of the content of the file, either “application/pdf” or “application/zip” */ mime_type: "application/pdf" | "application/zip"; /** * Optional. Short description of the result */ description?: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the file */ input_message_content?: TelegramInputMessageContent; /** * Optional. URL of the thumbnail (JPEG only) for the file */ thumbnail_url?: string; /** * Optional. Thumbnail width */ thumbnail_width?: number; /** * Optional. Thumbnail height */ thumbnail_height?: number; } /** * Represents a Game. */ export interface TelegramInlineQueryResultGame { /** * Type of the result, must be game */ type: "game"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * Short name of the game */ game_short_name: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; } /** * 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. */ export interface TelegramInlineQueryResultGif { /** * Type of the result, must be gif */ type: "gif"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL for the GIF file */ gif_url: string; /** * Optional. Width of the GIF */ gif_width?: number; /** * Optional. Height of the GIF */ gif_height?: number; /** * Optional. Duration of the GIF in seconds */ gif_duration?: number; /** * URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */ thumbnail_url: string; /** * Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”. */ thumbnail_mime_type?: "image/jpeg" | "image/gif" | "video/mp4"; /** * Optional. Title for the result */ title?: string; /** * Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the GIF animation */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultLocation { /** * Type of the result, must be location */ type: "location"; /** * Unique identifier for this result, 1-64 Bytes */ id: string; /** * Location latitude in degrees */ latitude: number; /** * Location longitude in degrees */ longitude: number; /** * Location title */ title: string; /** * Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ horizontal_accuracy?: number; /** * Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely */ live_period?: number; /** * Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */ heading?: number; /** * Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */ proximity_alert_radius?: number; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the location */ input_message_content?: TelegramInputMessageContent; /** * Optional. Url of the thumbnail for the result */ thumbnail_url?: string; /** * Optional. Thumbnail width */ thumbnail_width?: number; /** * Optional. Thumbnail height */ thumbnail_height?: number; } /** * 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. */ export interface TelegramInlineQueryResultMpeg4Gif { /** * Type of the result, must be mpeg4_gif */ type: "mpeg4_gif"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL for the MPEG4 file */ mpeg4_url: string; /** * Optional. Video width */ mpeg4_width?: number; /** * Optional. Video height */ mpeg4_height?: number; /** * Optional. Video duration in seconds */ mpeg4_duration?: number; /** * URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */ thumbnail_url: string; /** * Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”. */ thumbnail_mime_type?: "image/jpeg" | "image/gif" | "video/mp4"; /** * Optional. Title for the result */ title?: string; /** * Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the video animation */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultPhoto { /** * Type of the result, must be photo */ type: "photo"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB. */ photo_url: string; /** * URL of the thumbnail for the photo */ thumbnail_url: string; /** * Optional. Width of the photo */ photo_width?: number; /** * Optional. Height of the photo */ photo_height?: number; /** * Optional. Title for the result */ title?: string; /** * Optional. Short description of the result */ description?: string; /** * Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the photo */ input_message_content?: TelegramInputMessageContent; } /** * This object represents a button to be shown above inline query results. You must use exactly one of the optional fields. */ export interface TelegramInlineQueryResultsButton { /** * Label text on the button */ text: string; /** * Optional. Description of the Web App 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 inside the Web App. */ web_app?: TelegramWebAppInfo; /** * Optional. 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.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 button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities. */ start_parameter?: string; } /** * 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. */ export interface TelegramInlineQueryResultVenue { /** * Type of the result, must be venue */ type: "venue"; /** * Unique identifier for this result, 1-64 Bytes */ id: string; /** * Latitude of the venue location in degrees */ latitude: number; /** * Longitude of the venue location in degrees */ longitude: number; /** * Title of the venue */ title: string; /** * Address of the venue */ address: string; /** * Optional. Foursquare identifier of the venue if known */ foursquare_id?: string; /** * Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ foursquare_type?: string; /** * Optional. Google Places identifier of the venue */ google_place_id?: string; /** * Optional. Google Places type of the venue. (See supported types.) */ google_place_type?: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the venue */ input_message_content?: TelegramInputMessageContent; /** * Optional. Url of the thumbnail for the result */ thumbnail_url?: string; /** * Optional. Thumbnail width */ thumbnail_width?: number; /** * Optional. Thumbnail height */ thumbnail_height?: number; } /** * 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. */ export interface TelegramInlineQueryResultVideo { /** * Type of the result, must be video */ type: "video"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL for the embedded video player or video file */ video_url: string; /** * MIME type of the content of the video URL, “text/html” or “video/mp4” */ mime_type: string; /** * URL of the thumbnail (JPEG only) for the video */ thumbnail_url: string; /** * Title for the result */ title: string; /** * Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the video caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Video width */ video_width?: number; /** * Optional. Video height */ video_height?: number; /** * Optional. Video duration in seconds */ video_duration?: number; /** * Optional. Short description of the result */ description?: string; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. 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). */ input_message_content?: TelegramInputMessageContent; } /** * 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. */ export interface TelegramInlineQueryResultVoice { /** * Type of the result, must be voice */ type: "voice"; /** * Unique identifier for this result, 1-64 bytes */ id: string; /** * A valid URL for the voice recording */ voice_url: string; /** * Recording title */ title: string; /** * Optional. Caption, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Recording duration in seconds */ voice_duration?: number; /** * Optional. Inline keyboard attached to the message */ reply_markup?: TelegramInlineKeyboardMarkup; /** * Optional. Content of the message to be sent instead of the voice recording */ input_message_content?: TelegramInputMessageContent; } /** * Describes a checklist to create. */ export interface TelegramInputChecklist { /** * Title of the checklist; 1-255 characters after entities parsing */ title: string | Formattable; /** * Optional. Mode for parsing entities in the title. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed. */ title_entities?: TelegramMessageEntity[]; /** * List of 1-30 tasks in the checklist */ tasks: TelegramInputChecklistTask[]; /** * Optional. Pass True if other users can add tasks to the checklist */ others_can_add_tasks?: boolean; /** * Optional. Pass True if other users can mark tasks as done or not done in the checklist */ others_can_mark_tasks_as_done?: boolean; } /** * Describes a task to add to a checklist. */ export interface TelegramInputChecklistTask { /** * Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist */ id: number; /** * Text of the task; 1-100 characters after entities parsing */ text: string | Formattable; /** * Optional. Mode for parsing entities in the text. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed. */ text_entities?: TelegramMessageEntity[]; } /** * Represents the content of a contact message to be sent as the result of an inline query. */ export interface TelegramInputContactMessageContent { /** * Contact's phone number */ phone_number: string; /** * Contact's first name */ first_name: string; /** * Optional. Contact's last name */ last_name?: string; /** * Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes */ vcard?: string; } /** * This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. */ export interface TelegramInputFile { } /** * Represents the content of an invoice message to be sent as the result of an inline query. */ export interface TelegramInputInvoiceMessageContent { /** * Product name, 1-32 characters */ title: string; /** * Product description, 1-255 characters */ description: string; /** * Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes. */ payload: string; /** * Optional. Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars. */ provider_token?: string; /** * Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars. */ currency: string; /** * Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars. */ prices: TelegramLabeledPrice[]; /** * Optional. 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, 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. */ max_tip_amount?: number; /** * Optional. A JSON-serialized 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. */ suggested_tip_amounts?: number[]; /** * Optional. 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. */ provider_data?: string; /** * Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. */ photo_url?: string; /** * Optional. Photo size in bytes */ photo_size?: number; /** * Optional. Photo width */ photo_width?: number; /** * Optional. Photo height */ photo_height?: number; /** * Optional. Pass True if you require the user's full name to complete the order. Ignored for payments in Telegram Stars. */ need_name?: boolean; /** * Optional. Pass True if you require the user's phone number to complete the order. Ignored for payments in Telegram Stars. */ need_phone_number?: boolean; /** * Optional. Pass True if you require the user's email address to complete the order. Ignored for payments in Telegram Stars. */ need_email?: boolean; /** * Optional. Pass True if you require the user's shipping address to complete the order. Ignored for payments in Telegram Stars. */ need_shipping_address?: boolean; /** * Optional. Pass True if the user's phone number should be sent to the provider. Ignored for payments in Telegram Stars. */ send_phone_number_to_provider?: boolean; /** * Optional. Pass True if the user's email address should be sent to the provider. Ignored for payments in Telegram Stars. */ send_email_to_provider?: boolean; /** * Optional. Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars. */ is_flexible?: boolean; } /** * Represents the content of a location message to be sent as the result of an inline query. */ export interface TelegramInputLocationMessageContent { /** * Latitude of the location in degrees */ latitude: number; /** * Longitude of the location in degrees */ longitude: number; /** * Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ horizontal_accuracy?: number; /** * Optional. Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely */ live_period?: number; /** * Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */ heading?: number; /** * Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */ proximity_alert_radius?: number; } /** * This object represents the content of a media message to be sent. It should be one of */ export type TelegramInputMedia = TelegramInputMediaAnimation | TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaLivePhoto | TelegramInputMediaPhoto | TelegramInputMediaVideo; /** * Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. */ export interface TelegramInputMediaAnimation { /** * Type of the media, must be animation */ type: "animation"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » */ thumbnail?: string; /** * Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the animation caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Animation width */ width?: number; /** * Optional. Animation height */ height?: number; /** * Optional. Animation duration in seconds */ duration?: number; /** * Optional. Pass True if the animation needs to be covered with a spoiler animation */ has_spoiler?: boolean; } /** * Represents an audio file to be treated as music to be sent. */ export interface TelegramInputMediaAudio { /** * Type of the media, must be audio */ type: "audio"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » */ thumbnail?: string; /** * Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Duration of the audio in seconds */ duration?: number; /** * Optional. Performer of the audio */ performer?: string; /** * Optional. Title of the audio */ title?: string; } /** * Represents a general file to be sent. */ export interface TelegramInputMediaDocument { /** * Type of the media, must be document */ type: "document"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » */ thumbnail?: string; /** * Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the document caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album. */ disable_content_type_detection?: boolean; } /** * Represents an HTTP link to be sent. */ export interface TelegramInputMediaLink { /** * Type of the media, must be link */ type: "link"; /** * HTTP URL of the link */ url: string; } /** * Represents a live photo to be sent. */ export interface TelegramInputMediaLivePhoto { /** * Type of the media, must be live_photo */ type: "live_photo"; /** * Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. */ media: string; /** * The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. */ photo: string; /** * Optional. Caption of the live photo to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the live photo caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Pass True if the live photo needs to be covered with a spoiler animation */ has_spoiler?: boolean; } /** * Represents a location to be sent. */ export interface TelegramInputMediaLocation { /** * Type of the media, must be location */ type: "location"; /** * Latitude of the location */ latitude: number; /** * Longitude of the location */ longitude: number; /** * Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ horizontal_accuracy?: number; } /** * Represents a photo to be sent. */ export interface TelegramInputMediaPhoto { /** * Type of the media, must be photo */ type: "photo"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Pass True if the photo needs to be covered with a spoiler animation */ has_spoiler?: boolean; } /** * Represents a sticker file to be sent. */ export interface TelegramInputMediaSticker { /** * Type of the media, must be sticker */ type: "sticker"; /** * 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 .WEBP sticker from the Internet, or pass “attach://” to upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Emoji associated with the sticker; only for just uploaded stickers */ emoji?: string; } /** * Represents a venue to be sent. */ export interface TelegramInputMediaVenue { /** * Type of the media, must be venue */ type: "venue"; /** * Latitude of the location */ latitude: number; /** * Longitude of the location */ longitude: number; /** * Name of the venue */ title: string; /** * Address of the venue */ address: string; /** * Optional. Foursquare identifier of the venue */ foursquare_id?: string; /** * Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ foursquare_type?: string; /** * Optional. Google Places identifier of the venue */ google_place_id?: string; /** * Optional. Google Places type of the venue. (See supported types.) */ google_place_type?: string; } /** * Represents a video to be sent. */ export interface TelegramInputMediaVideo { /** * Type of the media, must be video */ type: "video"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » */ thumbnail?: string; /** * Optional. 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ cover?: string; /** * Optional. Start timestamp for the video in the message */ start_timestamp?: number; /** * Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the video caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Pass True if the caption must be shown above the message media */ show_caption_above_media?: boolean; /** * Optional. Video width */ width?: number; /** * Optional. Video height */ height?: number; /** * Optional. Video duration in seconds */ duration?: number; /** * Optional. Pass True if the uploaded video is suitable for streaming */ supports_streaming?: boolean; /** * Optional. Pass True if the video needs to be covered with a spoiler animation */ has_spoiler?: boolean; } /** * Represents a voice message file to be sent. */ export interface TelegramInputMediaVoiceNote { /** * Type of the media, must be voice_note */ type: "voice_note"; /** * 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://" to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Caption of the voice message to be sent, 0-1024 characters after entities parsing */ caption?: string | Formattable; /** * Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. */ parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode */ caption_entities?: TelegramMessageEntity[]; /** * Optional. Duration of the voice message in seconds */ duration?: number; } /** * This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following types: */ export type TelegramInputMessageContent = TelegramInputTextMessageContent | TelegramInputRichMessageContent | TelegramInputLocationMessageContent | TelegramInputVenueMessageContent | TelegramInputContactMessageContent | TelegramInputInvoiceMessageContent; /** * This object describes the paid media to be sent. Currently, it can be one of */ export type TelegramInputPaidMedia = TelegramInputPaidMediaLivePhoto | TelegramInputPaidMediaPhoto | TelegramInputPaidMediaVideo; /** * The paid media to send is a live photo. */ export interface TelegramInputPaidMediaLivePhoto { /** * Type of the media, must be live_photo */ type: "live_photo"; /** * Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. */ media: string; /** * The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files ». Sending live photos by a URL is currently unsupported. */ photo: string; } /** * The paid media to send is a photo. */ export interface TelegramInputPaidMediaPhoto { /** * Type of the media, must be photo */ type: "photo"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; } /** * The paid media to send is a video. */ export interface TelegramInputPaidMediaVideo { /** * Type of the media, must be video */ type: "video"; /** * 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ media: string; /** * Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files » */ thumbnail?: string; /** * Optional. 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://” to upload a new one using multipart/form-data under name. More information on Sending Files » */ cover?: string; /** * Optional. Start timestamp for the video in the message */ start_timestamp?: number; /** * Optional. Video width */ width?: number; /** * Optional. Video height */ height?: number; /** * Optional. Video duration in seconds */ duration?: number; /** * Optional. Pass True if the uploaded video is suitable for streaming */ supports_streaming?: boolean; } /** * This object represents the content of a poll description or a quiz explanation to be sent. It should be one of */ export type TelegramInputPollMedia = TelegramInputMediaAnimation | TelegramInputMediaAudio | TelegramInputMediaDocument | TelegramInputMediaLivePhoto | TelegramInputMediaLocation | TelegramInputMediaPhoto | TelegramInputMediaVenue | TelegramInputMediaVideo; /** * This object contains information about one answer option in a poll to be sent. */ export interface TelegramInputPollOption { /** * Option text, 1-100 characters */ text: string | Formattable; /** * Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed. */ text_parse_mode?: "HTML" | "Markdown" | "MarkdownV2" | (string & {}); /** * Optional. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of text_parse_mode. */ text_entities?: TelegramMessageEntity[]; /** * Optional. Media added to the poll option */ media?: TelegramInputPollOptionMedia; } /** * This object represents the content of a poll option to be sent. It should be one of */ export type TelegramInputPollOptionMedia = TelegramInputMediaAnimation | TelegramInputMediaLink | TelegramInputMediaLivePhoto | TelegramInputMediaLocation | TelegramInputMediaPhoto | TelegramInputMediaSticker | TelegramInputMediaVenue | TelegramInputMediaVideo; /** * This object describes a profile photo to set. Currently, it can be one of */ export type TelegramInputProfilePhoto = TelegramInputProfilePhotoStatic | TelegramInputProfilePhotoAnimated; /** * An animated profile photo in the MPEG4 format. */ export interface TelegramInputProfilePhotoAnimated { /** * Type of the profile photo, must be animated */ type: "animated"; /** * The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the photo was uploaded using multipart/form-data under . More information on Sending Files » */ animation: string; /** * Optional. Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0. */ main_frame_timestamp?: number; } /** * A static profile photo in the .JPG format. */ export interface TelegramInputProfilePhotoStatic { /** * Type of the profile photo, must be static */ type: "static"; /** * The static profile photo. Profile photos can't be reused and can only be uploaded as a new file, so you can pass “attach://” if the photo was uploaded using multipart/form-data under . More information on Sending Files » */ photo: string; } /** * This object represents a block in a rich formatted message to be sent. Currently, it can be any of the following types: */ export type TelegramInputRichBlock = TelegramInputRichBlockParagraph | TelegramInputRichBlockSectionHeading | TelegramInputRichBlockPreformatted | TelegramInputRichBlockFooter | TelegramInputRichBlockDivider | TelegramInputRichBlockMathematicalExpression | TelegramInputRichBlockAnchor | TelegramInputRichBlockList | TelegramInputRichBlockBlockQuotation | TelegramInputRichBlockExpandableBlockQuotation | TelegramInputRichBlockPullQuotation | TelegramInputRichBlockCollage | TelegramInputRichBlockSlideshow | TelegramInputRichBlockTable | TelegramInputRichBlockDetails | TelegramInputRichBlockMap | TelegramInputRichBlockButtons | TelegramInputRichBlockAnimation | TelegramInputRichBlockAudio | TelegramInputRichBlockDocument | TelegramInputRichBlockPhoto | TelegramInputRichBlockVideo | TelegramInputRichBlockVoiceNote | TelegramInputRichBlockThinking; /** * A block with an anchor, corresponding to the HTML tag with the attribute name. */ export interface TelegramInputRichBlockAnchor { /** * Type of the block, always “anchor” */ type: "anchor"; /** * The name of the anchor */ name: string; } /** * A block with an animation, corresponding to the HTML tag