Skip to main content
Module

x/grammy_types/message.ts

Type declarations of the Telegram Bot API.
Very Popular
Go to Latest
File
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
// deno-lint-ignore-file no-irregular-whitespaceimport type { Chat, User } from "./manage.ts";import type { InlineKeyboardMarkup } from "./markup.ts";import type { PassportData } from "./passport.ts";import type { Invoice, SuccessfulPayment } from "./payment.ts";
type MsgWith<P extends keyof Message> = Record<P, NonNullable<Message[P]>>;
export declare namespace Message { interface ServiceMessage { /** Unique message identifier inside this chat */ message_id: number; /** Unique identifier of a message thread or a forum topic to which the message belongs; for supergroups only */ message_thread_id?: number; /** Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */ from?: User; /** Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */ sender_chat?: Chat; /** Date the message was sent in Unix time. It is always a positive number, representing a valid date. */ date: number; /** Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier. */ business_connection_id?: string; /** Chat the message belongs to */ chat: Chat; /** True, if the message is sent to a forum topic */ is_topic_message?: boolean; } export interface CommonMessage extends ServiceMessage { /** If the sender of the message boosted the chat, the number of boosts added by the user */ sender_boost_count?: number; /** The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account. */ sender_business_bot?: User; /** Information about the original message for forwarded messages */ forward_origin?: MessageOrigin; /** True, if the message is a channel post that was automatically forwarded to the connected discussion group */ is_automatic_forward?: true; /** For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */ reply_to_message?: ReplyMessage; /** Information about the message that is being replied to, which may come from another chat or forum topic */ external_reply?: ExternalReplyInfo; /** For replies that quote part of the original message, the quoted part of the message */ quote?: TextQuote; /** For replies to a story, the original message */ reply_to_story?: Story; /** Bot through which the message was sent */ via_bot?: User; /** Date the message was last edited in Unix time */ edit_date?: number; /** True, if the message can't be forwarded */ has_protected_content?: true; /** True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message */ is_from_offline?: true; /** Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */ author_signature?: string; /** Options used for link preview generation for the message, if it is a text message and link preview options were changed */ link_preview_options?: LinkPreviewOptions; /** Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ reply_markup?: InlineKeyboardMarkup; } export interface CaptionableMessage extends CommonMessage { /** Caption for the animation, audio, document, photo, video or voice */ caption?: string; /** For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */ caption_entities?: MessageEntity[]; } export interface MediaMessage extends CaptionableMessage { /** The unique identifier of a media message group this message belongs to */ media_group_id?: string; /** True, if the message media is covered by a spoiler animation */ has_media_spoiler?: true; }
export type TextMessage = CommonMessage & MsgWith<"text">; export type AudioMessage = CaptionableMessage & MsgWith<"audio">; export type DocumentMessage = CaptionableMessage & MsgWith<"document">; export type AnimationMessage = DocumentMessage & MsgWith<"animation">; export type PhotoMessage = MediaMessage & MsgWith<"photo">; export type StickerMessage = CommonMessage & MsgWith<"sticker">; export type StoryMessage = CommonMessage & MsgWith<"story">; export type VideoMessage = MediaMessage & MsgWith<"video">; export type VideoNoteMessage = CommonMessage & MsgWith<"video_note">; export type VoiceMessage = CaptionableMessage & MsgWith<"voice">; export type ContactMessage = CommonMessage & MsgWith<"contact">; export type DiceMessage = CommonMessage & MsgWith<"dice">; export type GameMessage = CommonMessage & MsgWith<"game">; export type PollMessage = CommonMessage & MsgWith<"poll">; export type LocationMessage = CommonMessage & MsgWith<"location">; export type VenueMessage = LocationMessage & MsgWith<"venue">; export type NewChatMembersMessage = & ServiceMessage & MsgWith<"new_chat_members">; export type LeftChatMemberMessage = & ServiceMessage & MsgWith<"left_chat_member">; export type NewChatTitleMessage = ServiceMessage & MsgWith<"new_chat_title">; export type NewChatPhotoMessage = ServiceMessage & MsgWith<"new_chat_photo">; export type DeleteChatPhotoMessage = & ServiceMessage & MsgWith<"delete_chat_photo">; export type GroupChatCreatedMessage = & ServiceMessage & MsgWith<"group_chat_created">; export type SupergroupChatCreated = & ServiceMessage & MsgWith<"supergroup_chat_created">; export type ChannelChatCreatedMessage = & ServiceMessage & MsgWith<"channel_chat_created">; export type MessageAutoDeleteTimerChangedMessage = & ServiceMessage & MsgWith<"message_auto_delete_timer_changed">; export type MigrateToChatIdMessage = & ServiceMessage & MsgWith<"migrate_to_chat_id">; export type MigrateFromChatIdMessage = & ServiceMessage & MsgWith<"migrate_from_chat_id">; export type PinnedMessageMessage = ServiceMessage & MsgWith<"pinned_message">; export type InvoiceMessage = ServiceMessage & MsgWith<"invoice">; export type SuccessfulPaymentMessage = & ServiceMessage & MsgWith<"successful_payment">; export type UsersSharedMessage = ServiceMessage & MsgWith<"users_shared">; export type ChatSharedMessage = ServiceMessage & MsgWith<"chat_shared">; export type ConnectedWebsiteMessage = & ServiceMessage & MsgWith<"connected_website">; export type WriteAccessAllowedMessage = & ServiceMessage & MsgWith<"write_access_allowed">; export type PassportDataMessage = ServiceMessage & MsgWith<"passport_data">; export type ProximityAlertTriggeredMessage = & ServiceMessage & MsgWith<"proximity_alert_triggered">; export type BoostAddedMessage = & ServiceMessage & MsgWith<"boost_added">; export type ForumTopicCreatedMessage = & ServiceMessage & MsgWith<"forum_topic_created">; export type ForumTopicEditedMessage = & ServiceMessage & MsgWith<"forum_topic_edited">; export type ForumTopicClosedMessage = & ServiceMessage & MsgWith<"forum_topic_closed">; export type ForumTopicReopenedMessage = & ServiceMessage & MsgWith<"forum_topic_reopened">; export type GeneralForumTopicHiddenMessage = & ServiceMessage & MsgWith<"general_forum_topic_hidden">; export type GeneralForumTopicUnhiddenMessage = & ServiceMessage & MsgWith<"general_forum_topic_unhidden">; export type GiveawayCreatedMessage = & ServiceMessage & MsgWith<"giveaway_created">; export type GiveawayMessage = ServiceMessage & MsgWith<"giveaway">; export type GiveawayWinnersMessage = & ServiceMessage & MsgWith<"giveaway_winners">; export type GiveawayCompletedMessage = & ServiceMessage & MsgWith<"giveaway_completed">; export type VideoChatScheduledMessage = & ServiceMessage & MsgWith<"video_chat_scheduled">; export type VideoChatStartedMessage = & ServiceMessage & MsgWith<"video_chat_started">; export type VideoChatEndedMessage = & ServiceMessage & MsgWith<"video_chat_ended">; export type VideoChatParticipantsInvitedMessage = & ServiceMessage & MsgWith<"video_chat_participants_invited">; export type WebAppDataMessage = ServiceMessage & MsgWith<"web_app_data">;}
type ReplyMessage = Message & { reply_to_message: undefined };
export interface Message extends Message.MediaMessage { /** For text messages, the actual UTF-8 text of the message */ text?: string; /** For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */ entities?: MessageEntity[]; /** Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */ animation?: Animation; /** Message is an audio file, information about the file */ audio?: Audio; /** Message is a general file, information about the file */ document?: Document; /** Message is a photo, available sizes of the photo */ photo?: PhotoSize[]; /** Message is a sticker, information about the sticker */ sticker?: Sticker; /** Message is a forwarded story */ story?: Story; /** Message is a video, information about the video */ video?: Video; /** Message is a video note, information about the video message */ video_note?: VideoNote; /** Message is a voice message, information about the file */ voice?: Voice; /** Message is a shared contact, information about the contact */ contact?: Contact; /** Message is a dice with random value */ dice?: Dice; /** Message is a game, information about the game. More about games » */ game?: Game; /** Message is a native poll, information about the poll */ poll?: Poll; /** Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */ venue?: Venue; /** Message is a shared location, information about the location */ location?: Location; /** New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */ new_chat_members?: User[]; /** A member was removed from the group, information about them (this member may be the bot itself) */ left_chat_member?: User; /** A chat title was changed to this value */ new_chat_title?: string; /** A chat photo was change to this value */ new_chat_photo?: PhotoSize[]; /** Service message: the chat photo was deleted */ delete_chat_photo?: true; /** Service message: the group has been created */ group_chat_created?: true; /** Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */ supergroup_chat_created?: true; /** Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */ channel_chat_created?: true; /** Service message: auto-delete timer settings changed in the chat */ message_auto_delete_timer_changed?: MessageAutoDeleteTimerChanged; /** The group has been migrated to a supergroup with the specified identifier. */ migrate_to_chat_id?: number; /** The supergroup has been migrated from a group with the specified identifier. */ migrate_from_chat_id?: number; /** Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */ pinned_message?: MaybeInaccessibleMessage; /** Message is an invoice for a payment, information about the invoice. More about payments » */ invoice?: Invoice; /** Message is a service message about a successful payment, information about the payment. More about payments » */ successful_payment?: SuccessfulPayment; /** Service message: users were shared with the bot */ users_shared?: UsersShared; /** Service message: a chat was shared with the bot */ chat_shared?: ChatShared; /** The domain name of the website on which the user has logged in. More about Telegram Login » */ connected_website?: string; /** Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess */ write_access_allowed?: WriteAccessAllowed; /** Telegram Passport data */ passport_data?: PassportData; /** Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */ proximity_alert_triggered?: ProximityAlertTriggered; /** Service message: user boosted the chat */ boost_added?: ChatBoostAdded; /** Service message: forum topic created */ forum_topic_created?: ForumTopicCreated; /** Service message: forum topic edited */ forum_topic_edited?: ForumTopicEdited; /** Service message: forum topic closed */ forum_topic_closed?: ForumTopicClosed; /** Service message: forum topic reopened */ forum_topic_reopened?: ForumTopicReopened; /** Service message: the 'General' forum topic hidden */ general_forum_topic_hidden?: GeneralForumTopicHidden; /** Service message: the 'General' forum topic unhidden */ general_forum_topic_unhidden?: GeneralForumTopicUnhidden; /** Service message: a scheduled giveaway was created */ giveaway_created?: GiveawayCreated; /** The message is a scheduled giveaway message */ giveaway?: Giveaway; /** A giveaway with public winners was completed */ giveaway_winners?: GiveawayWinners; /** Service message: a giveaway without public winners was completed */ giveaway_completed?: GiveawayCompleted; /** Service message: video chat scheduled */ video_chat_scheduled?: VideoChatScheduled; /** Service message: video chat started */ video_chat_started?: VideoChatStarted; /** Service message: video chat ended */ video_chat_ended?: VideoChatEnded; /** Service message: new participants invited to a video chat */ video_chat_participants_invited?: VideoChatParticipantsInvited; /** Service message: data sent by a Web App */ web_app_data?: WebAppData;}
/** This object represents a unique message identifier. */export interface MessageId { /** Unique message identifier */ message_id: number;}
/** Describes an inline message sent by a Web App on behalf of a user. */export interface SentWebAppMessage { /** Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */ inline_message_id: string;}
/** This object describes a message that was deleted or is otherwise inaccessible to the bot. */export interface InaccessibleMessage extends Omit< // TypeScript cannot discriminate union types based on `0` and `number` so // we work around this by including all other properties here. This mostly // negates the benefit of having this interface in the first place, but not // extending Message is not very ergonomic to use. If you have a better idea // how to model this, please let us know! Message, "chat" | "message_id" | "date" > { /** Chat the message belonged to */ chat: Chat; /** Unique message identifier inside the chat */ message_id: number; /** Always 0. The field can be used to differentiate regular and inaccessible messages. */ date: 0;}
/** This object describes a message that can be inaccessible to the bot. It can be one of- Message- InaccessibleMessage */export type MaybeInaccessibleMessage = Message | InaccessibleMessage;
/** The Bot API supports basic formatting for messages. You can use bold, italic, underlined, strikethrough, spoiler text, block quotations as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can specify text entities directly, or use markdown-style or HTML-style formatting.
Note that Telegram clients will display an **alert** to the user before opening an inline link ('Open this link?' together with the full URL).
Message entities can be nested, providing following restrictions are met:- If two entities have common characters, then one of them is fully contained inside another.- bold, italic, underline, strikethrough, and spoiler entities can contain and can be part of any other entities, except pre and code.- blockquote entities can't be nested.- All other entities can't contain each other.
Links `tg://user?id=<user_id>` can be used to mention a user by their identifier without using a username. Please note:
- These links will work only if they are used inside an inline link or in an inline keyboard button. For example, they will not work, when used in a message text.- Unless the user is a member of the chat where they were mentioned, these mentions are only guaranteed to work if the user has contacted the bot in private in the past or has sent a callback query to the bot via an inline button and doesn't have Forwarded Messages privacy enabled for the bot.
You can find the list of programming and markup languages for which syntax highlighting is supported at [libprisma#supported-languages](https://github.com/TelegramMessenger/libprisma#supported-languages).
#### MarkdownV2 styleTo use this mode, pass *MarkdownV2* in the *parse_mode* field. Use the following syntax in your message:
```*bold \*text*_italic \*text___underline__~strikethrough~||spoiler||*bold _italic bold ~italic bold strikethrough ||italic bold strikethrough spoiler||~ __underline italic bold___ bold*[inline URL](http://www.example.com/)[inline mention of a user](tg://user?id=123456789)![👍](tg://emoji?id=5368324170671202286)`inline fixed-width code``​`​`pre-formatted fixed-width code block`​`​``​`​`pythonpre-formatted fixed-width code block written in the Python programming language`​`​`>Block quotation started>Block quotation continued>The last line of the block quotation**>The second block quotation started right after the previous\r>The third block quotation started right after the previous```Please note:
- Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.- Inside `pre` and `code` entities, all '`' and '\' characters must be escaped with a preceding '\' character.- Inside the `(...)` part of the inline link and custom emoji definition, all ')' and '\' must be escaped with a preceding '\' character.- In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.- In case of ambiguity between `italic` and `underline` entities `__` is always greadily treated from left to right as beginning or end of `underline` entity, so instead of `___italic underline___` use `___italic underline_\r__`, where `\r` is a character with code 13, which will be ignored.- A valid emoji must be provided as an alternative value for the custom emoji. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
#### HTML styleTo use this mode, pass *HTML* in the *parse_mode* field. The following tags are currently supported:
```html<b>bold</b>, <strong>bold</strong><i>italic</i>, <em>italic</em><u>underline</u>, <ins>underline</ins><s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del><span class="tg-spoiler">spoiler</span>, <tg-spoiler>spoiler</tg-spoiler><b>bold <i>italic bold <s>italic bold strikethrough <span class="tg-spoiler">italic bold strikethrough spoiler</span></s> <u>underline italic bold</u></i> bold</b><a href="http://www.example.com/">inline URL</a><a href="tg://user?id=123456789">inline mention of a user</a><tg-emoji emoji-id="5368324170671202286">👍</tg-emoji><code>inline fixed-width code</code><pre>pre-formatted fixed-width code block</pre><pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre><blockquote>Block quotation started\nBlock quotation continued\nThe last line of the block quotation</blockquote>```Please note:
- Only the tags mentioned above are currently supported.- All `<`, `>` and `&` symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (`<` with `&lt;`, `>` with `&gt;` and `&` with `&amp;`).- All numerical HTML entities are supported.- The API currently supports only the following named HTML entities: `&lt;`, `&gt;`, `&amp;` and `&quot;`.- Use nested `pre` and `code` tags, to define programming language for pre entity.- Programming language can't be specified for standalone `code` tags.- A valid emoji must be used as the content of the tg-emoji tag. The emoji will be shown instead of the custom emoji in places where a custom emoji cannot be displayed (e.g., system notifications) or if the message is forwarded by a non-premium user. It is recommended to use the emoji from the emoji field of the custom emoji sticker.- Custom emoji entities can only be used by bots that purchased additional usernames on Fragment.
#### Markdown styleThis is a legacy mode, retained for backward compatibility. To use this mode, pass *Markdown* in the *parse_mode* field. Use the following syntax in your message:
```*bold text*_italic text_[inline URL](http://www.example.com/)[inline mention of a user](tg://user?id=123456789)`inline fixed-width code``​`​`pre-formatted fixed-width code block`​`​``​`​`pythonpre-formatted fixed-width code block written in the Python programming language`​`​````Please note:
- Entities must not be nested, use parse mode MarkdownV2 instead.- There is no way to specify “underline”, “strikethrough”, “spoiler”, “blockquote” and “custom_emoji” entities, use parse mode MarkdownV2 instead.- To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.- Escaping inside entities is not allowed, so entity must be closed first and reopened again: use `_snake_\__case_` for italic `snake_case` and `*2*\**2=4*` for bold `2*2=4`. */export type ParseMode = "Markdown" | "MarkdownV2" | "HTML";
export declare namespace MessageEntity { interface AbstractMessageEntity { /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers) */ type: string; /** Offset in UTF-16 code units to the start of the entity */ offset: number; /** Length of the entity in UTF-16 code units */ length: number; } export interface CommonMessageEntity extends AbstractMessageEntity { type: | "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "code"; } export interface PreMessageEntity extends AbstractMessageEntity { type: "pre"; /** For “pre” only, the programming language of the entity text */ language?: string; } export interface TextLinkMessageEntity extends AbstractMessageEntity { type: "text_link"; /** For “text_link” only, URL that will be opened after user taps on the text */ url: string; } export interface TextMentionMessageEntity extends AbstractMessageEntity { type: "text_mention"; /** For “text_mention” only, the mentioned user */ user: User; } export interface CustomEmojiMessageEntity extends AbstractMessageEntity { type: "custom_emoji"; /** For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker */ custom_emoji_id: string; }}
/** This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */export type MessageEntity = | MessageEntity.CommonMessageEntity | MessageEntity.CustomEmojiMessageEntity | MessageEntity.PreMessageEntity | MessageEntity.TextLinkMessageEntity | MessageEntity.TextMentionMessageEntity;
/** This object contains information about the quoted part of a message that is replied to by the given message. */export interface TextQuote { /** Text of the quoted part of a message that is replied to by the given message */ text: string; /** Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, and custom_emoji entities are kept in quotes. */ entities?: MessageEntity[]; /** Approximate quote position in the original message in UTF-16 code units as specified by the sender */ position: number; /** True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */ is_manual?: true;}
/** This object contains information about a message that is being replied to, which may come from another chat or forum topic. */export interface ExternalReplyInfo { /** Origin of the message replied to by the given message */ origin: MessageOrigin; /** Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */ chat?: Chat; /** Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */ message_id?: number; /** Options used for link preview generation for the original message, if it is a text message */ link_preview_options?: LinkPreviewOptions; /** Message is an animation, information about the animation */ animation?: Animation; /** Message is an audio file, information about the file */ audio?: Audio; /** Message is a general file, information about the file */ document?: Document; /** Message is a photo, available sizes of the photo */ photo?: PhotoSize[]; /** Message is a sticker, information about the sticker */ sticker?: Sticker; /** Message is a forwarded story */ story?: Story; /** Message is a video, information about the video */ video?: Video; /** Message is a video note, information about the video message */ video_note?: VideoNote; /** Message is a voice message, information about the file */ voice?: Voice; /** True, if the message media is covered by a spoiler animation */ has_media_spoiler?: true; /** Message is a shared contact, information about the contact */ contact?: Contact; /** Message is a dice with random value */ dice?: Dice; /** Message is a game, information about the game. More about games » */ game?: Game; /** Message is a scheduled giveaway, information about the giveaway */ giveaway?: Giveaway; /** A giveaway with public winners was completed */ giveaway_winners?: GiveawayWinners; /** Message is an invoice for a payment, information about the invoice. More about payments » */ invoice?: Invoice; /** Message is a shared location, information about the location */ location?: Location; /** Message is a native poll, information about the poll */ poll?: Poll; /** Message is a venue, information about the venue */ venue?: Venue;}
/** Describes reply parameters for the message that is being sent. */export interface ReplyParameters { /** Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified */ message_id: number; /** If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format @channelusername). Not supported for messages sent on behalf of a business account. */ chat_id?: number | string; /** Pass True if the message should be sent even if the specified message to be replied to is not found; can be used only for replies in the same chat and forum topic. Always True for messages sent on behalf of a business account. */ allow_sending_without_reply?: boolean; /** Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, and custom_emoji entities. The message will fail to send if the quote isn't found in the original message. */ quote?: string; /** Mode for parsing entities in the quote. See formatting options for more details. */ quote_parse_mode?: string; /** A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode. */ quote_entities?: MessageEntity[]; /** Position of the quote in the original message in UTF-16 code units */ quote_position?: number;}
/** This object describes the origin of a message. It can be one of- MessageOriginUser- MessageOriginHiddenUser- MessageOriginChat- MessageOriginChannel */export type MessageOrigin = | MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel;
/** The message was originally sent by a known user. */export interface MessageOriginUser { /** Type of the message origin, always “user” */ type: "user"; /** Date the message was sent originally in Unix time */ date: number; /** User that sent the message originally */ sender_user: User;}
/** The message was originally sent by an unknown user. */export interface MessageOriginHiddenUser { /** Type of the message origin, always “hidden_user” */ type: "hidden_user"; /** Date the message was sent originally in Unix time */ date: number; /** Name of the user that sent the message originally */ sender_user_name: string;}
/** The message was originally sent on behalf of a chat to a group chat. */export interface MessageOriginChat { /** Type of the message origin, always “chat” */ type: "chat"; /** Date the message was sent originally in Unix time */ date: number; /** Chat that sent the message originally */ sender_chat: Chat; /** For messages originally sent by an anonymous chat administrator, original message author signature */ author_signature?: string;}
/** The message was originally sent to a channel chat. */export interface MessageOriginChannel { /** Type of the message origin, always “channel” */ type: "channel"; /** Date the message was sent originally in Unix time */ date: number; /** Channel chat to which the message was originally sent */ chat: Chat.ChannelChat; /** Unique message identifier inside the chat */ message_id: number; /** Signature of the original post author */ author_signature?: string;}
/** This object represents one size of a photo or a file / sticker thumbnail. */export interface PhotoSize { /** 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; /** Photo width */ width: number; /** Photo height */ height: number; /** File size in bytes */ file_size?: number;}
/** This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */export interface Animation { /** 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 sender */ width: number; /** Video height as defined by sender */ height: number; /** Duration of the video in seconds as defined by sender */ duration: number; /** Animation thumbnail as defined by sender */ thumbnail?: PhotoSize; /** Original animation filename as defined by sender */ file_name?: string; /** MIME type of the file as defined by sender */ mime_type?: string; /** File size in bytes */ file_size?: number;}
/** This object represents an audio file to be treated as music by the Telegram clients. */export interface Audio { /** 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 sender */ duration: number; /** Performer of the audio as defined by sender or by audio tags */ performer?: string; /** Title of the audio as defined by sender or by audio tags */ title?: string; /** Original filename as defined by sender */ file_name?: string; /** MIME type of the file as defined by sender */ mime_type?: string; /** File size in bytes */ file_size?: number; /** Thumbnail of the album cover to which the music file belongs */ thumbnail?: PhotoSize;}
/** This object represents a general file (as opposed to photos, voice messages and audio files). */export interface Document { /** 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; /** Document thumbnail as defined by sender */ thumbnail?: PhotoSize; /** Original filename as defined by sender */ file_name?: string; /** MIME type of the file as defined by sender */ mime_type?: string; /** File size in bytes */ file_size?: number;}
/** This object represents a video file. */export interface Video { /** 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 sender */ width: number; /** Video height as defined by sender */ height: number; /** Duration of the video in seconds as defined by sender */ duration: number; /** Video thumbnail */ thumbnail?: PhotoSize; /** Original filename as defined by sender */ file_name?: string; /** MIME type of the file as defined by sender */ mime_type?: string; /** File size in bytes */ file_size?: number;}
/** This object represents a video message (available in Telegram apps as of v.4.0). */export interface VideoNote { /** 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 and height (diameter of the video message) as defined by sender */ length: number; /** Duration of the video in seconds as defined by sender */ duration: number; /** Video thumbnail */ thumbnail?: PhotoSize; /** File size in bytes */ file_size?: number;}
/** This object represents a voice note. */export interface Voice { /** 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 sender */ duration: number; /** MIME type of the file as defined by sender */ mime_type?: string; /** File size in bytes */ file_size?: number;}
/** This object represents a phone contact. */export interface Contact { /** Contact's phone number */ phone_number: string; /** Contact's first name */ first_name: string; /** Contact's last name */ last_name?: string; /** Contact's user identifier in Telegram. */ user_id?: number; /** Additional data about the contact in the form of a vCard */ vcard?: string;}
/** This object represents an animated emoji that displays a random value. */export interface Dice { /** 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;}
/** This object contains information about one answer option in a poll. */export interface PollOption { /** Option text, 1-100 characters */ text: string; /** Number of users that voted for this option */ voter_count: number;}
/** This object represents an answer of a user in a non-anonymous poll. */export interface PollAnswer { /** Unique poll identifier */ poll_id: string; /** The chat that changed the answer to the poll, if the voter is anonymous */ voter_chat?: Chat; /** The user that changed the answer to the poll, if the voter isn't anonymous */ user?: User; /** 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */ option_ids: number[];}
/** This object contains information about a poll. */export interface Poll { /** Unique poll identifier */ id: string; /** Poll question, 1-300 characters */ question: string; /** List of poll options */ options: PollOption[]; /** Total number of users that voted in the poll */ total_voter_count: number; /** True, if the poll is closed */ is_closed: boolean; /** True, if the poll is anonymous */ is_anonymous: boolean; /** Poll type, currently can be “regular” or “quiz” */ type: "regular" | "quiz"; /** True, if the poll allows multiple answers */ allows_multiple_answers: boolean; /** 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */ correct_option_id?: number; /** Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */ explanation?: string; /** Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */ explanation_entities?: MessageEntity[]; /** Amount of time in seconds the poll will be active after creation */ open_period?: number; /** Point in time (Unix timestamp) when the poll will be automatically closed */ close_date?: number;}
/** This object represents a point on the map. */export interface Location { /** Latitude as defined by sender */ latitude: number; /** Longitude as defined by sender */ longitude: number; /** The radius of uncertainty for the location, measured in meters; 0-1500 */ horizontal_accuracy?: number; /** Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */ live_period?: number; /** The direction in which user is moving, in degrees; 1-360. For active live locations only. */ heading?: number; /** The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ proximity_alert_radius?: number;}
/** This object represents a venue. */export interface Venue { /** Venue location. Can't be a live location */ location: Location; /** Name of the venue */ title: string; /** Address of the venue */ address: string; /** Foursquare identifier of the venue */ foursquare_id?: string; /** Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ foursquare_type?: string; /** Google Places identifier of the venue */ google_place_id?: string; /** Google Places type of the venue. (See supported types.) */ google_place_type?: string;}
/** This object represents a story. */export interface Story { /** Chat that posted the story */ chat: Chat; /** Unique identifier for the story in the chat */ id: number;}
/** This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. */export interface ProximityAlertTriggered { /** User that triggered the alert */ traveler: User; /** User that set the alert */ watcher: User; /** The distance between the users */ distance: number;}
/** This object represents a service message about a change in auto-delete timer settings. */export interface MessageAutoDeleteTimerChanged { /** New auto-delete time for messages in the chat; in seconds */ message_auto_delete_time: number;}
/** This object represents a service message about a new forum topic created in the chat. */export interface ForumTopicCreated { /** Name of the topic */ name: string; /** Color of the topic icon in RGB format */ icon_color: number; /** Unique identifier of the custom emoji shown as the topic icon */ icon_custom_emoji_id?: string;}
/** This object represents a service message about an edited forum topic. */export interface ForumTopicEdited { /** New name of the topic, if it was edited */ name?: string; /** 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 closed in the chat. Currently holds no information. */export interface ForumTopicClosed {}
/** This object represents a service message about a forum topic reopened in the chat. Currently holds no information. */export interface ForumTopicReopened {}
/** This object represents a service message about General forum topic hidden in the chat. Currently holds no information. */export interface GeneralForumTopicHidden {}
/** This object represents a service message about General forum topic unhidden in the chat. Currently holds no information. */export interface GeneralForumTopicUnhidden {}
/** This object represents a service message about a user boosting a chat. */export interface ChatBoostAdded { /** Number of boosts added by the user */ boost_count: number;}
/** This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUser button. */export interface SharedUser { /** Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means. */ user_id: number; /** First name of the user, if the name was requested by the bot */ first_name?: string; /** Last name of the user, if the name was requested by the bot */ last_name?: string; /** Username of the user, if the username was requested by the bot */ username?: string; /** Available sizes of the chat photo, if the photo was requested by the bot */ photo?: PhotoSize[];}
/** This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUsers button. */export interface UsersShared { /** Identifier of the request */ request_id: number; /** Information about users shared with the bot. */ users: SharedUser[];}
/** This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */export interface ChatShared { /** Identifier of the request */ request_id: number; /** Identifier of the shared chat. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means. */ chat_id: number; /** Title of the chat, if the title was requested by the bot. */ title?: string; /** Username of the chat, if the username was requested by the bot and available. */ username?: string; /** Available sizes of the chat photo, if the photo was requested by the bot */ photo?: PhotoSize[];}
/** This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. */export interface WriteAccessAllowed { /** True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */ from_request?: boolean; /** Name of the Web App, if the access was granted when the Web App was launched from a link */ web_app_name?: string; /** True, if the access was granted when the bot was added to the attachment or side menu */ from_attachment_menu?: boolean;}
/** This object represents a service message about a video chat scheduled in the chat. */export interface VideoChatScheduled { /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */ start_date: number;}
/** This object represents a service message about a video chat started in the chat. Currently holds no information. */export interface VideoChatStarted {}
/** This object represents a service message about a video chat ended in the chat. */export interface VideoChatEnded { /** Video chat duration in seconds */ duration: number;}
/** This object represents a service message about new members invited to a video chat. */export interface VideoChatParticipantsInvited { /** New members that were invited to the video chat */ users: User[];}
/** This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. */export interface GiveawayCreated {}
/** This object represents a message about a scheduled giveaway. */export interface Giveaway { /** The list of chats which the user must join to participate in the giveaway */ chats: Chat[]; /** 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; /** True, if only users who join the chats after the giveaway started should be eligible to win */ only_new_members?: true; /** True, if the list of giveaway winners will be visible to everyone */ has_public_winners?: true; /** Description of additional giveaway prize */ prize_description?: string; /** 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[]; /** The number of months the Telegram Premium subscription won from the giveaway will be active for */ premium_subscription_month_count?: number;}
/** This object represents a message about the completion of a giveaway with public winners. */export interface GiveawayWinners { /** The chat that created the giveaway */ chat: Chat; /** 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: User[]; /** The number of other chats the user had to join in order to be eligible for the giveaway */ additional_chat_count?: number; /** The number of months the Telegram Premium subscription won from the giveaway will be active for */ premium_subscription_month_count?: number; /** Number of undistributed prizes */ unclaimed_prize_count?: number; /** True, if only users who had joined the chats after the giveaway started were eligible to win */ only_new_members?: true; /** True, if the giveaway was canceled because the payment for it was refunded */ was_refunded?: true; /** Description of additional giveaway prize */ prize_description?: string;}
/** This object represents a service message about the completion of a giveaway without public winners. */export interface GiveawayCompleted { /** Number of winners in the giveaway */ winner_count: number; /** Number of undistributed prizes */ unclaimed_prize_count?: number; /** Message with the giveaway that was completed, if it wasn't deleted */ giveaway_message?: Message;}
/** Describes the options used for link preview generation. */export interface LinkPreviewOptions { /** True, if the link preview is disabled */ is_disabled?: boolean; /** URL to use for the link preview. If empty, then the first URL found in the message text will be used */ url?: string; /** True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */ prefer_small_media?: boolean; /** True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview */ prefer_large_media?: boolean; /** True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */ show_above_text?: boolean;}
/** Describes data sent from a Web App to the bot. */export interface WebAppData { /** The data. Be aware that a bad client can send arbitrary data in this field. */ data: string; /** Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */ button_text: string;}
/** This object represents a sticker. */export interface Sticker { /** 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; /** Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. */ type: "regular" | "mask" | "custom_emoji"; /** Sticker width */ width: number; /** Sticker height */ height: number; /** True, if the sticker is animated */ is_animated: boolean; /** True, if the sticker is a video sticker */ is_video: boolean; /** Sticker thumbnail in the .WEBP or .JPG format */ thumbnail?: PhotoSize; /** Emoji associated with the sticker */ emoji?: string; /** Name of the sticker set to which the sticker belongs */ set_name?: string; /** For premium regular stickers, premium animation for the sticker */ premium_animation?: File; /** For mask stickers, the position where the mask should be placed */ mask_position?: MaskPosition; /** For custom emoji stickers, unique identifier of the custom emoji */ custom_emoji_id?: string; /** File size in bytes */ file_size?: number;}
/** This object represents a sticker set. */export interface StickerSet { /** Sticker set name */ name: string; /** Sticker set title */ title: string; /** Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */ sticker_type: "regular" | "mask" | "custom_emoji"; /** List of all set stickers */ stickers: Sticker[]; /** Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */ thumbnail?: PhotoSize;}
/** This object describes the position on faces where a mask should be placed by default. */export interface MaskPosition { /** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */ point: "forehead" | "eyes" | "mouth" | "chin"; /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */ x_shift: number; /** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */ y_shift: number; /** Mask scaling coefficient. For example, 2.0 means double size. */ scale: number;}
/** This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */export interface Game { /** Title of the game */ title: string; /** Description of the game */ description: string; /** Photo that will be displayed in the game message in chats. */ photo: PhotoSize[]; /** 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; /** Special entities that appear in text, such as usernames, URLs, bot commands, etc. */ text_entities: MessageEntity[]; /** Animation that will be displayed in the game message in chats. Upload via BotFather */ animation: Animation;}
/** This object represents one row of the high scores table for a game. */export interface GameHighScore { /** Position in high score table for the game */ position: number; /** User */ user: User; /** Score */ score: number;}
/** This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. */export interface File { /** 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; /** File size in bytes */ file_size?: number; /** File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. */ file_path?: string;}
/** This object describes the type of a reaction. Currently, it can be one of */export type ReactionType = ReactionTypeEmoji | ReactionTypeCustomEmoji;
/** The reaction is based on an emoji. */export interface ReactionTypeEmoji { /** Type of the reaction, always “emoji” */ type: "emoji"; /** Reaction emoji. Currently, it can be one of "👍", "👎", "❤", "🔥", "🥰", "👏", "😁", "🤔", "🤯", "😱", "🤬", "😢", "🎉", "🤩", "🤮", "💩", "🙏", "👌", "🕊", "🤡", "🥱", "🥴", "😍", "🐳", "❤‍🔥", "🌚", "🌭", "💯", "🤣", "⚡", "🍌", "🏆", "💔", "🤨", "😐", "🍓", "🍾", "💋", "🖕", "😈", "😴", "😭", "🤓", "👻", "👨‍💻", "👀", "🎃", "🙈", "😇", "😨", "🤝", "✍", "🤗", "🫡", "🎅", "🎄", "☃", "💅", "🤪", "🗿", "🆒", "💘", "🙉", "🦄", "😘", "💊", "🙊", "😎", "👾", "🤷‍♂", "🤷", "🤷‍♀", "😡" */ emoji: | "👍" | "👎" | "❤" | "🔥" | "🥰" | "👏" | "😁" | "🤔" | "🤯" | "😱" | "🤬" | "😢" | "🎉" | "🤩" | "🤮" | "💩" | "🙏" | "👌" | "🕊" | "🤡" | "🥱" | "🥴" | "😍" | "🐳" | "❤‍🔥" | "🌚" | "🌭" | "💯" | "🤣" | "⚡" | "🍌" | "🏆" | "💔" | "🤨" | "😐" | "🍓" | "🍾" | "💋" | "🖕" | "😈" | "😴" | "😭" | "🤓" | "👻" | "👨‍💻" | "👀" | "🎃" | "🙈" | "😇" | "😨" | "🤝" | "✍" | "🤗" | "🫡" | "🎅" | "🎄" | "☃" | "💅" | "🤪" | "🗿" | "🆒" | "💘" | "🙉" | "🦄" | "😘" | "💊" | "🙊" | "😎" | "👾" | "🤷‍♂" | "🤷" | "🤷‍♀" | "😡";}
/** The reaction is based on a custom emoji. */export interface ReactionTypeCustomEmoji { /** Type of the reaction, always “custom_emoji” */ type: "custom_emoji"; /** Custom emoji identifier */ custom_emoji_id: string;}
/** Represents a reaction added to a message along with the number of times it was added. */export interface ReactionCount { /** Type of the reaction */ type: ReactionType; /** Number of times the reaction was added */ total_count: number;}
/** This object represents a change of a reaction on a message performed by a user. */export interface MessageReactionUpdated { /** The chat containing the message the user reacted to */ chat: Chat; /** Unique identifier of the message inside the chat */ message_id: number; /** The user that changed the reaction, if the user isn't anonymous */ user?: User; /** The chat on behalf of which the reaction was changed, if the user is anonymous */ actor_chat?: Chat; /** Date of the change in Unix time */ date: number; /** Previous list of reaction types that were set by the user */ old_reaction: ReactionType[]; /** New list of reaction types that have been set by the user */ new_reaction: ReactionType[];}
/** This object represents reaction changes on a message with anonymous reactions. */export interface MessageReactionCountUpdated { /** The chat containing the message */ chat: Chat; /** Unique message identifier inside the chat */ message_id: number; /** Date of the change in Unix time */ date: number; /** List of reactions that are present on the message */ reactions: ReactionCount[];}