import type { TelegramAnimation, TelegramAudio, TelegramCallbackGame, TelegramChat, TelegramChatBackground, TelegramChatBoost, TelegramChatBoostAdded, TelegramChatBoostRemoved, TelegramChatBoostSource, TelegramChatBoostUpdated, TelegramChatInviteLink, TelegramChatJoinRequest, TelegramChatLocation, TelegramChatMember, TelegramChatMemberUpdated, TelegramChatOwnerChanged, TelegramChatOwnerLeft, TelegramChatPermissions, TelegramChatPhoto, TelegramChatShared, TelegramChecklist, TelegramChecklistTasksAdded, TelegramChecklistTasksDone, TelegramChosenInlineResult, TelegramCommunityChatAdded, TelegramCommunityChatJoined, TelegramCommunityChatRemoved, TelegramContact, TelegramCopyTextButton, TelegramDice, TelegramDirectMessagePriceChanged, TelegramDirectMessagesTopic, TelegramDisabledButton, TelegramDocument, TelegramEncryptedCredentials, TelegramEncryptedPassportElement, TelegramExternalReplyInfo, TelegramFile, TelegramForumTopicClosed, TelegramForumTopicCreated, TelegramForumTopicEdited, TelegramForumTopicReopened, TelegramGame, TelegramGeneralForumTopicHidden, TelegramGeneralForumTopicUnhidden, TelegramGiftInfo, TelegramGiveaway, TelegramGiveawayCompleted, TelegramGiveawayCreated, TelegramGiveawayWinners, TelegramInlineKeyboardButton, TelegramInlineKeyboardMarkup, TelegramInlineQuery, TelegramInvoice, TelegramLink, TelegramLinkPreviewOptions, TelegramLivePhoto, TelegramLocation, TelegramLoginUrl, TelegramManagedBotCreated, TelegramMaskPosition, TelegramMaybeInaccessibleMessage, TelegramMessage, TelegramMessageAutoDeleteTimerChanged, TelegramMessageEntity, TelegramMessageId, TelegramMessageOrigin, TelegramMessageReactionCountUpdated, TelegramMessageReactionUpdated, TelegramOrderInfo, TelegramPaidMediaInfo, TelegramPaidMessagePriceChanged, TelegramPassportData, TelegramPhotoSize, TelegramPoll, TelegramPollAnswer, TelegramPollMedia, TelegramPollOption, TelegramPollOptionAdded, TelegramPollOptionDeleted, TelegramPreCheckoutQuery, TelegramProximityAlertTriggered, TelegramReactionCount, TelegramReactionType, TelegramRefundedPayment, TelegramRichMessage, TelegramSharedUser, TelegramShippingAddress, TelegramShippingQuery, TelegramSticker, TelegramStickerSet, TelegramStory, TelegramSuccessfulPayment, TelegramSuggestedPostApprovalFailed, TelegramSuggestedPostApproved, TelegramSuggestedPostDeclined, TelegramSuggestedPostInfo, TelegramSuggestedPostPaid, TelegramSuggestedPostRefunded, TelegramSwitchInlineQueryChosenChat, TelegramTextQuote, TelegramUniqueGiftInfo, TelegramUser, TelegramUserProfilePhotos, TelegramUsersShared, TelegramVenue, TelegramVideo, TelegramVideoChatEnded, TelegramVideoChatParticipantsInvited, TelegramVideoChatScheduled, TelegramVideoChatStarted, TelegramVideoNote, TelegramVideoQuality, TelegramVoice, TelegramWebAppData, TelegramWebAppInfo, TelegramWriteAccessAllowed } from "./types.js"; import { INSPECT } from "./inspect.js"; import { Photo, PollOptions, ReactionCounts, Reactions, VideoQualities } from "../structures-handcrafted/index.js"; /** * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). */ export declare class Animation { raw: TelegramAnimation; private _thumbnail?; constructor(raw: TelegramAnimation); static fromPayload(raw: TelegramAnimation): Animation; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Video width as defined by the sender */ get width(): number; /** * Video height as defined by the sender */ get height(): number; /** * Duration of the video in seconds as defined by the sender */ get duration(): number; /** * Optional. Animation thumbnail as defined by the sender */ get thumbnail(): PhotoSize | undefined; /** * Optional. Original animation filename as defined by the sender */ get fileName(): string | undefined; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; /** * true if `file_name` is set */ hasFileName(): this is this & { fileName: string; }; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents an audio file to be treated as music by the Telegram clients. */ export declare class Audio { raw: TelegramAudio; private _thumbnail?; constructor(raw: TelegramAudio); static fromPayload(raw: TelegramAudio): Audio; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Duration of the audio in seconds as defined by the sender */ get duration(): number; /** * Optional. Performer of the audio as defined by the sender or by audio tags */ get performer(): string | undefined; /** * Optional. Title of the audio as defined by the sender or by audio tags */ get title(): string | undefined; /** * Optional. Original filename as defined by the sender */ get fileName(): string | undefined; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * Optional. Thumbnail of the album cover to which the music file belongs */ get thumbnail(): PhotoSize | undefined; /** * true if `performer` is set */ hasPerformer(): this is this & { performer: string; }; /** * true if `title` is set */ hasTitle(): this is this & { title: string; }; /** * true if `file_name` is set */ hasFileName(): this is this & { fileName: string; }; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a chat. */ export declare class Chat { raw: TelegramChat; constructor(raw: TelegramChat); static fromPayload(raw: TelegramChat): Chat; /** * 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. */ get id(): number; /** * Type of the chat, can be either “private”, “group”, “supergroup” or “channel” */ get type(): "private" | "group" | "supergroup" | "channel"; /** * Optional. Title, for supergroups, channels and group chats */ get title(): string | undefined; /** * Optional. Username, for private chats, supergroups and channels if available */ get username(): string | undefined; /** * Optional. First name of the other party in a private chat */ get firstName(): string | undefined; /** * Optional. Last name of the other party in a private chat */ get lastName(): string | undefined; /** * Optional. True, if the supergroup chat is a forum (has topics enabled) */ get isForum(): true | undefined; /** * Optional. True, if the chat is the direct messages chat of a channel */ get isDirectMessages(): true | undefined; /** * true if `title` is set */ hasTitle(): this is this & { title: string; }; /** * true if `username` is set */ hasUsername(): this is this & { username: string; }; /** * true if `first_name` is set */ hasFirstName(): this is this & { firstName: string; }; /** * true if `last_name` is set */ hasLastName(): this is this & { lastName: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type PrivateChat = Omit & { type: "private"; }; export type GroupChat = Omit & { type: "group"; }; export type SupergroupChat = Omit & { type: "supergroup"; }; export type ChannelChat = Omit & { type: "channel"; }; /** * This object contains information about a chat boost. */ export declare class ChatBoost { raw: TelegramChatBoost; constructor(raw: TelegramChatBoost); static fromPayload(raw: TelegramChatBoost): ChatBoost; /** * Unique identifier of the boost */ get boostId(): string; /** * Point in time (Unix timestamp) when the chat was boosted */ get addDate(): number; /** * Point in time (Unix timestamp) when the boost will automatically expire, unless the booster's Telegram Premium subscription is prolonged */ get expirationDate(): number; /** * Source of the added boost */ get source(): TelegramChatBoostSource; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a boost removed from a chat. */ export declare class ChatBoostRemoved { raw: TelegramChatBoostRemoved; private _chat?; constructor(raw: TelegramChatBoostRemoved); static fromPayload(raw: TelegramChatBoostRemoved): ChatBoostRemoved; /** * Chat which was boosted */ get chat(): Chat; /** * Unique identifier of the boost */ get boostId(): string; /** * Point in time (Unix timestamp) when the boost was removed */ get removeDate(): number; /** * Source of the removed boost */ get source(): TelegramChatBoostSource; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a boost added to a chat or changed. */ export declare class ChatBoostUpdated { raw: TelegramChatBoostUpdated; private _chat?; private _boost?; constructor(raw: TelegramChatBoostUpdated); static fromPayload(raw: TelegramChatBoostUpdated): ChatBoostUpdated; /** * Chat which was boosted */ get chat(): Chat; /** * Information about the chat boost */ get boost(): ChatBoost; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Represents an invite link for a chat. */ export declare class ChatInviteLink { raw: TelegramChatInviteLink; private _creator?; constructor(raw: TelegramChatInviteLink); static fromPayload(raw: TelegramChatInviteLink): ChatInviteLink; /** * The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */ get inviteLink(): string; /** * Creator of the link */ get creator(): User; /** * True, if users joining the chat via the link need to be approved by chat administrators */ get createsJoinRequest(): boolean; /** * True, if the link is primary */ get isPrimary(): boolean; /** * True, if the link is revoked */ get isRevoked(): boolean; /** * Optional. Invite link name */ get name(): string | undefined; /** * Optional. Point in time (Unix timestamp) when the link will expire or has been expired */ get expireDate(): number | undefined; /** * Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ get memberLimit(): number | undefined; /** * Optional. Number of pending join requests created using this link */ get pendingJoinRequestCount(): number | undefined; /** * Optional. The number of seconds the subscription will be active for before the next payment */ get subscriptionPeriod(): number | undefined; /** * 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 */ get subscriptionPrice(): number | undefined; /** * true if `name` is set */ hasName(): this is this & { name: string; }; /** * true if `expire_date` is set */ hasExpireDate(): this is this & { expireDate: number; }; /** * true if `member_limit` is set */ hasMemberLimit(): this is this & { memberLimit: number; }; /** * true if `pending_join_request_count` is set */ hasPendingJoinRequestCount(): this is this & { pendingJoinRequestCount: number; }; /** * true if `subscription_period` is set */ hasSubscriptionPeriod(): this is this & { subscriptionPeriod: number; }; /** * true if `subscription_price` is set */ hasSubscriptionPrice(): this is this & { subscriptionPrice: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Represents a join request sent to a chat. */ export declare class ChatJoinRequest { raw: TelegramChatJoinRequest; private _chat?; private _from?; private _inviteLink?; constructor(raw: TelegramChatJoinRequest); static fromPayload(raw: TelegramChatJoinRequest): ChatJoinRequest; /** * Chat to which the request was sent */ get chat(): Chat; /** * User that sent the join request */ get from(): User; /** * 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. */ get userChatId(): number; /** * Date the request was sent in Unix time */ get date(): number; /** * Optional. Bio of the user */ get bio(): string | undefined; /** * Optional. Chat invite link that was used by the user to send the join request */ get inviteLink(): ChatInviteLink | undefined; /** * 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. */ get queryId(): string | undefined; /** * true if `bio` is set */ hasBio(): this is this & { bio: string; }; /** * true if `invite_link` is set */ hasInviteLink(): this is this & { inviteLink: ChatInviteLink; }; /** * true if `query_id` is set */ hasQueryId(): this is this & { queryId: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Represents a location to which a chat is connected. */ export declare class ChatLocation { raw: TelegramChatLocation; private _location?; constructor(raw: TelegramChatLocation); static fromPayload(raw: TelegramChatLocation): ChatLocation; /** * The location to which the supergroup is connected. Can't be a live location. */ get location(): Location; /** * Location address; 1-64 characters, as defined by the chat owner */ get address(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: */ export declare class ChatMember { raw: TelegramChatMember; constructor(raw: TelegramChatMember); static fromPayload(raw: TelegramChatMember): ChatMember; /** * true when the member's status is 'administrator' */ isAdmin(): boolean; /** * true when the member's status is 'creator' (chat owner) */ isCreator(): boolean; /** * true when the member's status is 'member' (regular non-admin participant) */ isMember(): boolean; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents changes in the status of a chat member. */ export declare class ChatMemberUpdated { raw: TelegramChatMemberUpdated; private _chat?; private _from?; private _oldChatMember?; private _newChatMember?; private _inviteLink?; constructor(raw: TelegramChatMemberUpdated); static fromPayload(raw: TelegramChatMemberUpdated): ChatMemberUpdated; /** * Chat the user belongs to */ get chat(): Chat; /** * Performer of the action, which resulted in the change */ get from(): User; /** * Date the change was done in Unix time */ get date(): number; /** * Previous information about the chat member */ get oldChatMember(): ChatMember; /** * New information about the chat member */ get newChatMember(): ChatMember; /** * Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only */ get inviteLink(): ChatInviteLink | undefined; /** * 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 */ get viaJoinRequest(): boolean | undefined; /** * Optional. True, if the user joined the chat via a chat folder invite link */ get viaChatFolderInviteLink(): boolean | undefined; /** * true if `invite_link` is set */ hasInviteLink(): this is this & { inviteLink: ChatInviteLink; }; /** * true if `via_join_request` is set */ hasViaJoinRequest(): this is this & { viaJoinRequest: boolean; }; /** * true if `via_chat_folder_invite_link` is set */ hasViaChatFolderInviteLink(): this is this & { viaChatFolderInviteLink: boolean; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Describes actions that a non-administrator user is allowed to take in a chat. */ export declare class ChatPermissions { raw: TelegramChatPermissions; constructor(raw: TelegramChatPermissions); static fromPayload(raw: TelegramChatPermissions): ChatPermissions; /** * Optional. True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues */ get canSendMessages(): boolean | undefined; /** * Optional. True, if the user is allowed to send audios */ get canSendAudios(): boolean | undefined; /** * Optional. True, if the user is allowed to send documents */ get canSendDocuments(): boolean | undefined; /** * Optional. True, if the user is allowed to send photos */ get canSendPhotos(): boolean | undefined; /** * Optional. True, if the user is allowed to send videos */ get canSendVideos(): boolean | undefined; /** * Optional. True, if the user is allowed to send video notes */ get canSendVideoNotes(): boolean | undefined; /** * Optional. True, if the user is allowed to send voice notes */ get canSendVoiceNotes(): boolean | undefined; /** * Optional. True, if the user is allowed to send polls and checklists */ get canSendPolls(): boolean | undefined; /** * Optional. True, if the user is allowed to send animations, games, stickers and use inline bots */ get canSendOtherMessages(): boolean | undefined; /** * Optional. True, if the user is allowed to add web page previews to their messages */ get canAddWebPagePreviews(): boolean | undefined; /** * Optional. True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages. */ get canReactToMessages(): boolean | undefined; /** * Optional. True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages. */ get canEditTag(): boolean | undefined; /** * Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups. */ get canChangeInfo(): boolean | undefined; /** * Optional. True, if the user is allowed to invite new users to the chat */ get canInviteUsers(): boolean | undefined; /** * Optional. True, if the user is allowed to pin messages. Ignored in public supergroups. */ get canPinMessages(): boolean | undefined; /** * Optional. True, if the user is allowed to create forum topics. If omitted, defaults to the value of can_pin_messages. */ get canManageTopics(): boolean | undefined; /** * true if `can_send_messages` is set */ hasCanSendMessages(): this is this & { canSendMessages: boolean; }; /** * true if `can_send_audios` is set */ hasCanSendAudios(): this is this & { canSendAudios: boolean; }; /** * true if `can_send_documents` is set */ hasCanSendDocuments(): this is this & { canSendDocuments: boolean; }; /** * true if `can_send_photos` is set */ hasCanSendPhotos(): this is this & { canSendPhotos: boolean; }; /** * true if `can_send_videos` is set */ hasCanSendVideos(): this is this & { canSendVideos: boolean; }; /** * true if `can_send_video_notes` is set */ hasCanSendVideoNotes(): this is this & { canSendVideoNotes: boolean; }; /** * true if `can_send_voice_notes` is set */ hasCanSendVoiceNotes(): this is this & { canSendVoiceNotes: boolean; }; /** * true if `can_send_polls` is set */ hasCanSendPolls(): this is this & { canSendPolls: boolean; }; /** * true if `can_send_other_messages` is set */ hasCanSendOtherMessages(): this is this & { canSendOtherMessages: boolean; }; /** * true if `can_add_web_page_previews` is set */ hasCanAddWebPagePreviews(): this is this & { canAddWebPagePreviews: boolean; }; /** * true if `can_react_to_messages` is set */ hasCanReactToMessages(): this is this & { canReactToMessages: boolean; }; /** * true if `can_edit_tag` is set */ hasCanEditTag(): this is this & { canEditTag: boolean; }; /** * true if `can_change_info` is set */ hasCanChangeInfo(): this is this & { canChangeInfo: boolean; }; /** * true if `can_invite_users` is set */ hasCanInviteUsers(): this is this & { canInviteUsers: boolean; }; /** * true if `can_pin_messages` is set */ hasCanPinMessages(): this is this & { canPinMessages: boolean; }; /** * true if `can_manage_topics` is set */ hasCanManageTopics(): this is this & { canManageTopics: boolean; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a chat photo. */ export declare class ChatPhoto { raw: TelegramChatPhoto; constructor(raw: TelegramChatPhoto); static fromPayload(raw: TelegramChatPhoto): ChatPhoto; /** * 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. */ get smallFileId(): 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. */ get smallFileUniqueId(): 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. */ get bigFileId(): 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. */ get bigFileUniqueId(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button. */ export declare class ChatShared { raw: TelegramChatShared; private _photo?; constructor(raw: TelegramChatShared); static fromPayload(raw: TelegramChatShared): ChatShared; /** * Identifier of the request */ get requestId(): 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. */ get chatId(): number; /** * Optional. Title of the chat, if the title was requested by the bot */ get title(): string | undefined; /** * Optional. Username of the chat, if the username was requested by the bot and available */ get username(): string | undefined; /** * Optional. Available sizes of the chat photo, if the photo was requested by the bot */ get photo(): Photo | undefined; /** * true if `title` is set */ hasTitle(): this is this & { title: string; }; /** * true if `username` is set */ hasUsername(): this is this & { username: string; }; /** * true if `photo` has at least one item */ hasPhoto(): this is this & { photo: Photo; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Represents a result of an inline query that was chosen by the user and sent to their chat partner. */ export declare class ChosenInlineResult { raw: TelegramChosenInlineResult; private _from?; private _location?; constructor(raw: TelegramChosenInlineResult); static fromPayload(raw: TelegramChosenInlineResult): ChosenInlineResult; /** * The unique identifier for the result that was chosen */ get resultId(): string; /** * The user that chose the result */ get from(): User; /** * Optional. Sender location, only for bots that require user location */ get location(): Location | undefined; /** * 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. */ get inlineMessageId(): string | undefined; /** * The query that was used to obtain the result */ get query(): string; /** * true if `location` is set */ hasLocation(): this is this & { location: Location; }; /** * true if `inline_message_id` is set */ hasInlineMessageId(): this is this & { inlineMessageId: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a phone contact. */ export declare class Contact { raw: TelegramContact; constructor(raw: TelegramContact); static fromPayload(raw: TelegramContact): Contact; /** * Contact's phone number */ get phoneNumber(): string; /** * Contact's first name */ get firstName(): string; /** * Optional. Contact's last name */ get lastName(): string | undefined; /** * 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. */ get userId(): number | undefined; /** * Optional. Additional data about the contact in the form of a vCard */ get vcard(): string | undefined; /** * true if `last_name` is set */ hasLastName(): this is this & { lastName: string; }; /** * true if `user_id` is set */ hasUserId(): this is this & { userId: number; }; /** * true if `vcard` is set */ hasVcard(): this is this & { vcard: string; }; /** * display name; first name plus last name when present, otherwise just first name */ get displayName(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents an animated emoji that displays a random value. */ export declare class Dice { raw: TelegramDice; constructor(raw: TelegramDice); static fromPayload(raw: TelegramDice): Dice; /** * Emoji on which the dice throw animation is based */ get emoji(): string; /** * Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji */ get value(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a general file (as opposed to photos, voice messages and audio files). */ export declare class Document { raw: TelegramDocument; private _thumbnail?; constructor(raw: TelegramDocument); static fromPayload(raw: TelegramDocument): Document; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Optional. Document thumbnail as defined by the sender */ get thumbnail(): PhotoSize | undefined; /** * Optional. Original filename as defined by the sender */ get fileName(): string | undefined; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; /** * true if `file_name` is set */ hasFileName(): this is this & { fileName: string; }; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about a message that is being replied to, which may come from another chat or forum topic. */ export declare class ExternalReplyInfo { raw: TelegramExternalReplyInfo; private _chat?; private _linkPreviewOptions?; private _animation?; private _audio?; private _document?; private _livePhoto?; private _photo?; private _sticker?; private _story?; private _video?; private _videoNote?; private _voice?; private _contact?; private _dice?; private _game?; private _giveaway?; private _giveawayWinners?; private _invoice?; private _location?; private _poll?; private _venue?; constructor(raw: TelegramExternalReplyInfo); static fromPayload(raw: TelegramExternalReplyInfo): ExternalReplyInfo; /** * Origin of the message replied to by the given message */ get origin(): TelegramMessageOrigin; /** * Optional. Chat the original message belongs to. Available only if the chat is a supergroup or a channel. */ get chat(): Chat | undefined; /** * Optional. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel. */ get id(): number | undefined; /** * Optional. Options used for link preview generation for the original message, if it is a text message */ get linkPreviewOptions(): LinkPreviewOptions | undefined; /** * Optional. Message is an animation, information about the animation */ get animation(): Animation | undefined; /** * Optional. Message is an audio file, information about the file */ get audio(): Audio | undefined; /** * Optional. Message is a general file, information about the file */ get document(): Document | undefined; /** * Optional. Message is a live photo, information about the live photo */ get livePhoto(): LivePhoto | undefined; /** * Optional. Message contains paid media; information about the paid media */ get paidMedia(): TelegramPaidMediaInfo | undefined; /** * Optional. Message is a photo, available sizes of the photo */ get photo(): Photo | undefined; /** * Optional. Message is a sticker, information about the sticker */ get sticker(): Sticker | undefined; /** * Optional. Message is a forwarded story */ get story(): Story | undefined; /** * Optional. Message is a video, information about the video */ get video(): Video | undefined; /** * Optional. Message is a video note, information about the video message */ get videoNote(): VideoNote | undefined; /** * Optional. Message is a voice message, information about the file */ get voice(): Voice | undefined; /** * Optional. True, if the message media is covered by a spoiler animation */ get hasMediaSpoiler(): true | undefined; /** * Optional. Message is a checklist */ get checklist(): TelegramChecklist | undefined; /** * Optional. Message is a shared contact, information about the contact */ get contact(): Contact | undefined; /** * Optional. Message is a dice with random value */ get dice(): Dice | undefined; /** * Optional. Message is a game, information about the game. More about games » */ get game(): Game | undefined; /** * Optional. Message is a scheduled giveaway, information about the giveaway */ get giveaway(): Giveaway | undefined; /** * Optional. A giveaway with public winners was completed */ get giveawayWinners(): GiveawayWinners | undefined; /** * Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ get invoice(): Invoice | undefined; /** * Optional. Message is a shared location, information about the location */ get location(): Location | undefined; /** * Optional. Message is a native poll, information about the poll */ get poll(): Poll | undefined; /** * Optional. Message is a venue, information about the venue */ get venue(): Venue | undefined; /** * true if `chat` is set */ hasChat(): this is this & { chat: Chat; }; /** * true if `message_id` is set */ hasId(): this is this & { id: number; }; /** * true if `link_preview_options` is set */ hasLinkPreviewOptions(): this is this & { linkPreviewOptions: LinkPreviewOptions; }; /** * true if `animation` is set */ hasAnimation(): this is this & { animation: Animation; }; /** * true if `audio` is set */ hasAudio(): this is this & { audio: Audio; }; /** * true if `document` is set */ hasDocument(): this is this & { document: Document; }; /** * true if `live_photo` is set */ hasLivePhoto(): this is this & { livePhoto: LivePhoto; }; /** * true if `paid_media` is set */ hasPaidMedia(): this is this & { paidMedia: TelegramPaidMediaInfo; }; /** * true if `photo` has at least one item */ hasPhoto(): this is this & { photo: Photo; }; /** * true if `sticker` is set */ hasSticker(): this is this & { sticker: Sticker; }; /** * true if `story` is set */ hasStory(): this is this & { story: Story; }; /** * true if `video` is set */ hasVideo(): this is this & { video: Video; }; /** * true if `video_note` is set */ hasVideoNote(): this is this & { videoNote: VideoNote; }; /** * true if `voice` is set */ hasVoice(): this is this & { voice: Voice; }; /** * true if `checklist` is set */ hasChecklist(): this is this & { checklist: TelegramChecklist; }; /** * true if `contact` is set */ hasContact(): this is this & { contact: Contact; }; /** * true if `dice` is set */ hasDice(): this is this & { dice: Dice; }; /** * true if `game` is set */ hasGame(): this is this & { game: Game; }; /** * true if `giveaway` is set */ hasGiveaway(): this is this & { giveaway: Giveaway; }; /** * true if `giveaway_winners` is set */ hasGiveawayWinners(): this is this & { giveawayWinners: GiveawayWinners; }; /** * true if `invoice` is set */ hasInvoice(): this is this & { invoice: Invoice; }; /** * true if `location` is set */ hasLocation(): this is this & { location: Location; }; /** * true if `poll` is set */ hasPoll(): this is this & { poll: Poll; }; /** * true if `venue` is set */ hasVenue(): this is this & { venue: Venue; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * 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 declare class File { raw: TelegramFile; constructor(raw: TelegramFile); static fromPayload(raw: TelegramFile): File; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): 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. */ get fileSize(): number | undefined; /** * Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. */ get filePath(): string | undefined; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; /** * true if `file_path` is set */ hasFilePath(): this is this & { filePath: string; }; /** * full download url for this file using the given bot token; undefined when file_path is missing */ link(token: string): string | undefined; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about a new forum topic created in the chat. */ export declare class ForumTopicCreated { raw: TelegramForumTopicCreated; constructor(raw: TelegramForumTopicCreated); static fromPayload(raw: TelegramForumTopicCreated): ForumTopicCreated; /** * Name of the topic */ get name(): string; /** * Color of the topic icon in RGB format */ get iconColor(): number; /** * Optional. Unique identifier of the custom emoji shown as the topic icon */ get iconCustomEmojiId(): string | undefined; /** * Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */ get isNameImplicit(): true | undefined; /** * true if `icon_custom_emoji_id` is set */ hasIconCustomEmojiId(): this is this & { iconCustomEmojiId: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about an edited forum topic. */ export declare class ForumTopicEdited { raw: TelegramForumTopicEdited; constructor(raw: TelegramForumTopicEdited); static fromPayload(raw: TelegramForumTopicEdited): ForumTopicEdited; /** * Optional. New name of the topic, if it was edited */ get name(): string | undefined; /** * Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed */ get iconCustomEmojiId(): string | undefined; /** * true if `name` is set */ hasName(): this is this & { name: string; }; /** * true if `icon_custom_emoji_id` is set */ hasIconCustomEmojiId(): this is this & { iconCustomEmojiId: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. */ export declare class Game { raw: TelegramGame; private _photo?; private _textEntities?; private _animation?; constructor(raw: TelegramGame); static fromPayload(raw: TelegramGame): Game; /** * Title of the game */ get title(): string; /** * Description of the game */ get description(): string; /** * Photo that will be displayed in the game message in chats */ get photo(): Photo; /** * 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. */ get text(): string | undefined; /** * Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. */ get textEntities(): MessageEntity[] | undefined; /** * Optional. Animation that will be displayed in the game message in chats. Upload via BotFather. */ get animation(): Animation | undefined; /** * true if `text` is set */ hasText(): this is this & { text: string; }; /** * true if `text_entities` has at least one item */ hasTextEntities(): this is this & { textEntities: MessageEntity[]; }; /** * true if `animation` is set */ hasAnimation(): this is this & { animation: Animation; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a message about a scheduled giveaway. */ export declare class Giveaway { raw: TelegramGiveaway; private _chats?; constructor(raw: TelegramGiveaway); static fromPayload(raw: TelegramGiveaway): Giveaway; /** * The list of chats which the user must join to participate in the giveaway */ get chats(): Chat[]; /** * Point in time (Unix timestamp) when winners of the giveaway will be selected */ get winnersSelectionDate(): number; /** * The number of users which are supposed to be selected as winners of the giveaway */ get winnerCount(): number; /** * Optional. True, if only users who join the chats after the giveaway started should be eligible to win */ get onlyNewMembers(): true | undefined; /** * Optional. True, if the list of giveaway winners will be visible to everyone */ get hasPublicWinners(): true | undefined; /** * Optional. Description of additional giveaway prize */ get prizeDescription(): string | undefined; /** * 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. */ get countryCodes(): string[] | undefined; /** * Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only */ get prizeStarCount(): number | undefined; /** * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */ get premiumSubscriptionMonthCount(): number | undefined; /** * true if `only_new_members` is set */ hasOnlyNewMembers(): this is this & { onlyNewMembers: true; }; /** * true if `prize_description` is set */ hasPrizeDescription(): this is this & { prizeDescription: string; }; /** * true if `country_codes` has at least one item */ hasCountryCodes(): this is this & { countryCodes: string[]; }; /** * true if `prize_star_count` is set */ hasPrizeStarCount(): this is this & { prizeStarCount: number; }; /** * true if `premium_subscription_month_count` is set */ hasPremiumSubscriptionMonthCount(): this is this & { premiumSubscriptionMonthCount: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about the completion of a giveaway without public winners. */ export declare class GiveawayCompleted { raw: TelegramGiveawayCompleted; private _giveawayMessage?; constructor(raw: TelegramGiveawayCompleted); static fromPayload(raw: TelegramGiveawayCompleted): GiveawayCompleted; /** * Number of winners in the giveaway */ get winnerCount(): number; /** * Optional. Number of undistributed prizes */ get unclaimedPrizeCount(): number | undefined; /** * Optional. Message with the giveaway that was completed, if it wasn't deleted */ get giveawayMessage(): Message | undefined; /** * Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway. */ get isStarGiveaway(): true | undefined; /** * true if `unclaimed_prize_count` is set */ hasUnclaimedPrizeCount(): this is this & { unclaimedPrizeCount: number; }; /** * true if `giveaway_message` is set */ hasGiveawayMessage(): this is this & { giveawayMessage: Message; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a message about the completion of a giveaway with public winners. */ export declare class GiveawayWinners { raw: TelegramGiveawayWinners; private _chat?; private _winners?; constructor(raw: TelegramGiveawayWinners); static fromPayload(raw: TelegramGiveawayWinners): GiveawayWinners; /** * The chat that created the giveaway */ get chat(): Chat; /** * Identifier of the message with the giveaway in the chat */ get giveawayMessageId(): number; /** * Point in time (Unix timestamp) when winners of the giveaway were selected */ get winnersSelectionDate(): number; /** * Total number of winners in the giveaway */ get winnerCount(): number; /** * List of up to 100 winners of the giveaway */ get winners(): User[]; /** * Optional. The number of other chats the user had to join in order to be eligible for the giveaway */ get additionalChatCount(): number | undefined; /** * Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only */ get prizeStarCount(): number | undefined; /** * Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only */ get premiumSubscriptionMonthCount(): number | undefined; /** * Optional. Number of undistributed prizes */ get unclaimedPrizeCount(): number | undefined; /** * Optional. True, if only users who had joined the chats after the giveaway started were eligible to win */ get onlyNewMembers(): true | undefined; /** * Optional. True, if the giveaway was canceled because the payment for it was refunded */ get wasRefunded(): true | undefined; /** * Optional. Description of additional giveaway prize */ get prizeDescription(): string | undefined; /** * true if `additional_chat_count` is set */ hasAdditionalChatCount(): this is this & { additionalChatCount: number; }; /** * true if `prize_star_count` is set */ hasPrizeStarCount(): this is this & { prizeStarCount: number; }; /** * true if `premium_subscription_month_count` is set */ hasPremiumSubscriptionMonthCount(): this is this & { premiumSubscriptionMonthCount: number; }; /** * true if `unclaimed_prize_count` is set */ hasUnclaimedPrizeCount(): this is this & { unclaimedPrizeCount: number; }; /** * true if `only_new_members` is set */ hasOnlyNewMembers(): this is this & { onlyNewMembers: true; }; /** * true if `was_refunded` is set */ hasWasRefunded(): this is this & { wasRefunded: true; }; /** * true if `prize_description` is set */ hasPrizeDescription(): this is this & { prizeDescription: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * 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 declare class InlineKeyboardButton { raw: TelegramInlineKeyboardButton; private _webApp?; constructor(raw: TelegramInlineKeyboardButton); static fromPayload(raw: TelegramInlineKeyboardButton): InlineKeyboardButton; /** * Label text on the button */ get 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. */ get iconCustomEmojiId(): string | undefined; /** * 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. */ get style(): ("danger" | "success" | "primary") | undefined; /** * 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. */ get url(): string | undefined; /** * Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes */ get callbackData(): string | undefined; /** * 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. */ get webApp(): WebAppInfo | undefined; /** * 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. */ get loginUrl(): TelegramLoginUrl | undefined; /** * 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. */ get switchInlineQuery(): string | undefined; /** * 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. */ get switchInlineQueryCurrentChat(): string | undefined; /** * 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. */ get switchInlineQueryChosenChat(): TelegramSwitchInlineQueryChosenChat | undefined; /** * Optional. Description of the button that copies the specified text to the clipboard */ get copyText(): TelegramCopyTextButton | undefined; /** * 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. */ get callbackGame(): TelegramCallbackGame | undefined; /** * 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. */ get pay(): boolean | undefined; /** * Optional. If set, then the button is disabled and does nothing */ get disabled(): TelegramDisabledButton | undefined; /** * true if `icon_custom_emoji_id` is set */ hasIconCustomEmojiId(): this is this & { iconCustomEmojiId: string; }; /** * true if `style` is set */ hasStyle(): this is this & { style: "danger" | "success" | "primary"; }; /** * true if `url` is set */ hasUrl(): this is this & { url: string; }; /** * true if `callback_data` is set */ hasCallbackData(): this is this & { callbackData: string; }; /** * true if `web_app` is set */ hasWebApp(): this is this & { webApp: WebAppInfo; }; /** * true if `login_url` is set */ hasLoginUrl(): this is this & { loginUrl: TelegramLoginUrl; }; /** * true if `switch_inline_query` is set */ hasSwitchInlineQuery(): this is this & { switchInlineQuery: string; }; /** * true if `switch_inline_query_current_chat` is set */ hasSwitchInlineQueryCurrentChat(): this is this & { switchInlineQueryCurrentChat: string; }; /** * true if `switch_inline_query_chosen_chat` is set */ hasSwitchInlineQueryChosenChat(): this is this & { switchInlineQueryChosenChat: TelegramSwitchInlineQueryChosenChat; }; /** * true if `copy_text` is set */ hasCopyText(): this is this & { copyText: TelegramCopyTextButton; }; /** * true if `callback_game` is set */ hasCallbackGame(): this is this & { callbackGame: TelegramCallbackGame; }; /** * true if `pay` is set */ hasPay(): this is this & { pay: boolean; }; /** * true if `disabled` is set */ hasDisabled(): this is this & { disabled: TelegramDisabledButton; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type DangerInlineKeyboardButton = Omit & { style: "danger"; }; export type SuccessInlineKeyboardButton = Omit & { style: "success"; }; export type PrimaryInlineKeyboardButton = Omit & { style: "primary"; }; /** * This object represents an inline keyboard that appears right next to the message it belongs to. */ export declare class InlineKeyboardMarkup { raw: TelegramInlineKeyboardMarkup; constructor(raw: TelegramInlineKeyboardMarkup); static fromPayload(raw: TelegramInlineKeyboardMarkup): InlineKeyboardMarkup; /** * Array of button rows, each represented by an Array of InlineKeyboardButton objects */ get inlineKeyboard(): 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. */ get forceReply(): boolean | undefined; /** * true if `force_reply` is set */ hasForceReply(): this is this & { forceReply: boolean; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. */ export declare class InlineQuery { raw: TelegramInlineQuery; private _from?; private _location?; constructor(raw: TelegramInlineQuery); static fromPayload(raw: TelegramInlineQuery): InlineQuery; /** * Unique identifier for this query */ get id(): string; /** * Sender */ get from(): User; /** * Text of the query (up to 256 characters) */ get query(): string; /** * Offset of the results to be returned, can be controlled by the bot */ get 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. */ get chatType(): ("sender" | "private" | "group" | "supergroup" | "channel") | undefined; /** * Optional. Sender location, only for bots that request user location */ get location(): Location | undefined; /** * true if `chat_type` is set */ hasChatType(): this is this & { chatType: "sender" | "private" | "group" | "supergroup" | "channel"; }; /** * true if `location` is set */ hasLocation(): this is this & { location: Location; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type SenderInlineQuery = Omit & { chatType: "sender"; }; export type PrivateInlineQuery = Omit & { chatType: "private"; }; export type GroupInlineQuery = Omit & { chatType: "group"; }; export type SupergroupInlineQuery = Omit & { chatType: "supergroup"; }; export type ChannelInlineQuery = Omit & { chatType: "channel"; }; /** * This object contains basic information about an invoice. */ export declare class Invoice { raw: TelegramInvoice; constructor(raw: TelegramInvoice); static fromPayload(raw: TelegramInvoice): Invoice; /** * Product name */ get title(): string; /** * Product description */ get description(): string; /** * Unique bot deep-linking parameter that can be used to generate this invoice */ get startParameter(): string; /** * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */ get currency(): string; /** * Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ get totalAmount(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Describes the options used for link preview generation. */ export declare class LinkPreviewOptions { raw: TelegramLinkPreviewOptions; constructor(raw: TelegramLinkPreviewOptions); static fromPayload(raw: TelegramLinkPreviewOptions): LinkPreviewOptions; /** * Optional. True, if the link preview is disabled */ get isDisabled(): boolean | undefined; /** * Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used. */ get url(): string | undefined; /** * Optional. 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 */ get preferSmallMedia(): boolean | undefined; /** * Optional. 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 */ get preferLargeMedia(): boolean | undefined; /** * Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text */ get showAboveText(): boolean | undefined; /** * true if `url` is set */ hasUrl(): this is this & { url: string; }; /** * true if `prefer_small_media` is set */ hasPreferSmallMedia(): this is this & { preferSmallMedia: boolean; }; /** * true if `prefer_large_media` is set */ hasPreferLargeMedia(): this is this & { preferLargeMedia: boolean; }; /** * true if `show_above_text` is set */ hasShowAboveText(): this is this & { showAboveText: boolean; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a live photo. */ export declare class LivePhoto { raw: TelegramLivePhoto; private _photo?; constructor(raw: TelegramLivePhoto); static fromPayload(raw: TelegramLivePhoto): LivePhoto; /** * Optional. Available sizes of the corresponding static photo */ get photo(): Photo | undefined; /** * Identifier for the video file which can be used to download or reuse the file */ get fileId(): string; /** * Unique identifier for the video file which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. */ get fileUniqueId(): string; /** * Video width as defined by the sender */ get width(): number; /** * Video height as defined by the sender */ get height(): number; /** * Duration of the video in seconds as defined by the sender */ get duration(): number; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * true if `photo` has at least one item */ hasPhoto(): this is this & { photo: Photo; }; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a point on the map. */ export declare class Location { raw: TelegramLocation; constructor(raw: TelegramLocation); static fromPayload(raw: TelegramLocation): Location; /** * Latitude as defined by the sender */ get latitude(): number; /** * Longitude as defined by the sender */ get longitude(): number; /** * Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ get horizontalAccuracy(): number | undefined; /** * Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */ get livePeriod(): number | undefined; /** * Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. */ get heading(): number | undefined; /** * Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ get proximityAlertRadius(): number | undefined; /** * true if `horizontal_accuracy` is set */ hasHorizontalAccuracy(): this is this & { horizontalAccuracy: number; }; /** * true if `live_period` is set */ hasLivePeriod(): this is this & { livePeriod: number; }; /** * true if `heading` is set */ hasHeading(): this is this & { heading: number; }; /** * true if `proximity_alert_radius` is set */ hasProximityAlertRadius(): this is this & { proximityAlertRadius: number; }; /** * tuple of [latitude, longitude] */ get coordinates(): [number, number]; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object describes the position on faces where a mask should be placed by default. */ export declare class MaskPosition { raw: TelegramMaskPosition; constructor(raw: TelegramMaskPosition); static fromPayload(raw: TelegramMaskPosition): MaskPosition; /** * The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */ get 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. */ get xShift(): 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. */ get yShift(): number; /** * Mask scaling coefficient. For example, 2.0 means double size. */ get scale(): number; [INSPECT](depth: any, options: any, inspect: any): string; } export type ForeheadMaskPosition = Omit & { point: "forehead"; }; export type EyesMaskPosition = Omit & { point: "eyes"; }; export type MouthMaskPosition = Omit & { point: "mouth"; }; export type ChinMaskPosition = Omit & { point: "chin"; }; /** * This object represents a message. */ export declare class Message { raw: TelegramMessage; private _from?; private _senderChat?; private _senderBusinessBot?; private _receiverUser?; private _chat?; private _replyToMessage?; private _externalReply?; private _quote?; private _replyToStory?; private _viaBot?; private _guestBotCallerUser?; private _guestBotCallerChat?; private _entities?; private _linkPreviewOptions?; private _animation?; private _audio?; private _document?; private _livePhoto?; private _photo?; private _sticker?; private _story?; private _video?; private _videoNote?; private _voice?; private _captionEntities?; private _contact?; private _dice?; private _game?; private _poll?; private _venue?; private _location?; private _newChatMembers?; private _leftChatMember?; private _newChatPhoto?; private _invoice?; private _successfulPayment?; private _usersShared?; private _chatShared?; private _writeAccessAllowed?; private _passportData?; private _proximityAlertTriggered?; private _forumTopicCreated?; private _forumTopicEdited?; private _giveaway?; private _giveawayWinners?; private _giveawayCompleted?; private _videoChatScheduled?; private _videoChatEnded?; private _videoChatParticipantsInvited?; private _webAppData?; private _replyMarkup?; constructor(raw: TelegramMessage); static fromPayload(raw: TelegramMessage): Message; /** * Unique message identifier inside this chat; 0 for ephemeral messages. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. */ get id(): number; /** * Optional. Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only */ get messageThreadId(): number | undefined; /** * Optional. Information about the direct messages chat topic that contains the message */ get directMessagesTopic(): TelegramDirectMessagesTopic | undefined; /** * Optional. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats. */ get from(): User | undefined; /** * Optional. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats. */ get senderChat(): Chat | undefined; /** * Optional. If the sender of the message boosted the chat, the number of boosts added by the user */ get senderBoostCount(): number | undefined; /** * Optional. 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. */ get senderBusinessBot(): User | undefined; /** * Optional. Tag or custom title of the sender of the message; for supergroups only */ get senderTag(): string | undefined; /** * Optional. For ephemeral messages, the user who received the message */ get receiverUser(): User | undefined; /** * Optional. For ephemeral messages, identifier of the ephemeral message inside this chat. The identifier may be reused for another ephemeral message after the message is deleted or expires. */ get ephemeralMessageId(): number | undefined; /** * Date the message was sent in Unix time. It is always a positive number, representing a valid date. */ get date(): number; /** * Optional. The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier. */ get guestQueryId(): string | undefined; /** * Optional. 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. */ get businessConnectionId(): string | undefined; /** * Chat the message belongs to */ get chat(): Chat; /** * Optional. Information about the original message for forwarded messages */ get forwardOrigin(): TelegramMessageOrigin | undefined; /** * Optional. True, if the message is sent to a topic in a forum supergroup or a private chat with the bot */ get isTopicMessage(): true | undefined; /** * Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group */ get isAutomaticForward(): true | undefined; /** * Optional. 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. If the message is a reply to an ephemeral message, then this field may be omitted. */ get replyToMessage(): Message | undefined; /** * Optional. Information about the message that is being replied to, which may come from another chat or forum topic */ get externalReply(): ExternalReplyInfo | undefined; /** * Optional. For replies that quote part of the original message, the quoted part of the message */ get quote(): TextQuote | undefined; /** * Optional. For replies to a story, the original story */ get replyToStory(): Story | undefined; /** * Optional. Identifier of the specific checklist task that is being replied to */ get replyToChecklistTaskId(): number | undefined; /** * Optional. Persistent identifier of the specific poll option that is being replied to */ get replyToPollOptionId(): string | undefined; /** * Optional. Bot through which the message was sent */ get viaBot(): User | undefined; /** * Optional. For a message sent by a guest bot, this is the user whose original message triggered the bot's response */ get guestBotCallerUser(): User | undefined; /** * Optional. For a message sent by a guest bot, this is the chat whose original message triggered the bot's response */ get guestBotCallerChat(): Chat | undefined; /** * Optional. Date the message was last edited in Unix time */ get editDate(): number | undefined; /** * Optional. True, if the message can't be forwarded */ get hasProtectedContent(): true | undefined; /** * Optional. 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 */ get isFromOffline(): true | undefined; /** * Optional. True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can't be edited. */ get isPaidPost(): true | undefined; /** * Optional. The unique identifier inside this chat of a media message group this message belongs to */ get mediaGroupId(): string | undefined; /** * Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */ get authorSignature(): string | undefined; /** * Optional. The number of Telegram Stars that were paid by the sender of the message to send it */ get paidStarCount(): number | undefined; /** * Optional. For text messages, the actual UTF-8 text of the message */ get text(): string | undefined; /** * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text */ get entities(): MessageEntity[] | undefined; /** * Optional. Options used for link preview generation for the message, if it is a text message and link preview options were changed */ get linkPreviewOptions(): LinkPreviewOptions | undefined; /** * Optional. Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can't be edited. */ get suggestedPostInfo(): TelegramSuggestedPostInfo | undefined; /** * Optional. Unique identifier of the message effect added to the message */ get effectId(): string | undefined; /** * Optional. Message is a rich formatted message */ get richMessage(): TelegramRichMessage | undefined; /** * Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set. */ get animation(): Animation | undefined; /** * Optional. Message is an audio file, information about the file */ get audio(): Audio | undefined; /** * Optional. Message is a general file, information about the file */ get document(): Document | undefined; /** * Optional. Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set. */ get livePhoto(): LivePhoto | undefined; /** * Optional. Message contains paid media; information about the paid media */ get paidMedia(): TelegramPaidMediaInfo | undefined; /** * Optional. Message is a photo, available sizes of the photo */ get photo(): Photo | undefined; /** * Optional. Message is a sticker, information about the sticker */ get sticker(): Sticker | undefined; /** * Optional. Message is a forwarded story */ get story(): Story | undefined; /** * Optional. Message is a video, information about the video */ get video(): Video | undefined; /** * Optional. Message is a video note, information about the video message */ get videoNote(): VideoNote | undefined; /** * Optional. Message is a voice message, information about the file */ get voice(): Voice | undefined; /** * Optional. Caption for the animation, audio, document, paid media, photo, video or voice */ get caption(): string | undefined; /** * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption */ get captionEntities(): MessageEntity[] | undefined; /** * Optional. True, if the caption must be shown above the message media */ get showCaptionAboveMedia(): true | undefined; /** * Optional. True, if the message media is covered by a spoiler animation */ get hasMediaSpoiler(): true | undefined; /** * Optional. Message is a checklist */ get checklist(): TelegramChecklist | undefined; /** * Optional. Message is a shared contact, information about the contact */ get contact(): Contact | undefined; /** * Optional. Message is a dice with random value */ get dice(): Dice | undefined; /** * Optional. Message is a game, information about the game. More about games » */ get game(): Game | undefined; /** * Optional. Message is a native poll, information about the poll */ get poll(): Poll | undefined; /** * Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set. */ get venue(): Venue | undefined; /** * Optional. Message is a shared location, information about the location */ get location(): Location | undefined; /** * Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) */ get newChatMembers(): User[] | undefined; /** * Optional. A member was removed from the group, information about them (this member may be the bot itself) */ get leftChatMember(): User | undefined; /** * Optional. Service message: chat owner has left */ get chatOwnerLeft(): TelegramChatOwnerLeft | undefined; /** * Optional. Service message: chat owner has changed */ get chatOwnerChanged(): TelegramChatOwnerChanged | undefined; /** * Optional. A chat title was changed to this value */ get newChatTitle(): string | undefined; /** * Optional. A chat photo was change to this value */ get newChatPhoto(): Photo | undefined; /** * Optional. Service message: the chat photo was deleted */ get deleteChatPhoto(): true | undefined; /** * Optional. Service message: the group has been created */ get groupChatCreated(): true | undefined; /** * Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */ get supergroupChatCreated(): true | undefined; /** * Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */ get channelChatCreated(): true | undefined; /** * Optional. Service message: auto-delete timer settings changed in the chat */ get messageAutoDeleteTimerChanged(): TelegramMessageAutoDeleteTimerChanged | undefined; /** * Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ get migrateToChatId(): number | undefined; /** * Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ get migrateFromChatId(): number | undefined; /** * Optional. 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. */ get pinnedMessage(): TelegramMaybeInaccessibleMessage | undefined; /** * Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ get invoice(): Invoice | undefined; /** * Optional. Message is a service message about a successful payment, information about the payment. More about payments » */ get successfulPayment(): SuccessfulPayment | undefined; /** * Optional. Message is a service message about a refunded payment, information about the payment. More about payments » */ get refundedPayment(): TelegramRefundedPayment | undefined; /** * Optional. Service message: users were shared with the bot */ get usersShared(): UsersShared | undefined; /** * Optional. Service message: a chat was shared with the bot */ get chatShared(): ChatShared | undefined; /** * Optional. Service message: a regular gift was sent or received */ get gift(): TelegramGiftInfo | undefined; /** * Optional. Service message: a unique gift was sent or received */ get uniqueGift(): TelegramUniqueGiftInfo | undefined; /** * Optional. Service message: upgrade of a gift was purchased after the gift was sent */ get giftUpgradeSent(): TelegramGiftInfo | undefined; /** * Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */ get connectedWebsite(): string | undefined; /** * Optional. 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 */ get writeAccessAllowed(): WriteAccessAllowed | undefined; /** * Optional. Telegram Passport data */ get passportData(): PassportData | undefined; /** * Optional. Service message: a user in the chat triggered another user's proximity alert while sharing Live Location */ get proximityAlertTriggered(): ProximityAlertTriggered | undefined; /** * Optional. Service message: user boosted the chat */ get boostAdded(): TelegramChatBoostAdded | undefined; /** * Optional. Service message: chat background set */ get chatBackgroundSet(): TelegramChatBackground | undefined; /** * Optional. Service message: some tasks in a checklist were marked as done or not done */ get checklistTasksDone(): TelegramChecklistTasksDone | undefined; /** * Optional. Service message: tasks were added to a checklist */ get checklistTasksAdded(): TelegramChecklistTasksAdded | undefined; /** * Optional. Service message: chat or bot added to a Community */ get communityChatAdded(): TelegramCommunityChatAdded | undefined; /** * Optional. Service message: chat was joined by a user from a Community */ get communityChatJoined(): TelegramCommunityChatJoined | undefined; /** * Optional. Service message: chat or bot removed from a Community */ get communityChatRemoved(): TelegramCommunityChatRemoved | undefined; /** * Optional. Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed */ get directMessagePriceChanged(): TelegramDirectMessagePriceChanged | undefined; /** * Optional. Service message: forum topic created */ get forumTopicCreated(): ForumTopicCreated | undefined; /** * Optional. Service message: forum topic edited */ get forumTopicEdited(): ForumTopicEdited | undefined; /** * Optional. Service message: forum topic closed */ get forumTopicClosed(): TelegramForumTopicClosed | undefined; /** * Optional. Service message: forum topic reopened */ get forumTopicReopened(): TelegramForumTopicReopened | undefined; /** * Optional. Service message: the 'General' forum topic hidden */ get generalForumTopicHidden(): TelegramGeneralForumTopicHidden | undefined; /** * Optional. Service message: the 'General' forum topic unhidden */ get generalForumTopicUnhidden(): TelegramGeneralForumTopicUnhidden | undefined; /** * Optional. Service message: a scheduled giveaway was created */ get giveawayCreated(): TelegramGiveawayCreated | undefined; /** * Optional. The message is a scheduled giveaway message */ get giveaway(): Giveaway | undefined; /** * Optional. A giveaway with public winners was completed */ get giveawayWinners(): GiveawayWinners | undefined; /** * Optional. Service message: a giveaway without public winners was completed */ get giveawayCompleted(): GiveawayCompleted | undefined; /** * Optional. Service message: user created a bot that will be managed by the current bot */ get managedBotCreated(): TelegramManagedBotCreated | undefined; /** * Optional. Service message: the price for paid messages has changed in the chat */ get paidMessagePriceChanged(): TelegramPaidMessagePriceChanged | undefined; /** * Optional. Service message: answer option was added to a poll */ get pollOptionAdded(): TelegramPollOptionAdded | undefined; /** * Optional. Service message: answer option was deleted from a poll */ get pollOptionDeleted(): TelegramPollOptionDeleted | undefined; /** * Optional. Service message: a suggested post was approved */ get suggestedPostApproved(): TelegramSuggestedPostApproved | undefined; /** * Optional. Service message: approval of a suggested post has failed */ get suggestedPostApprovalFailed(): TelegramSuggestedPostApprovalFailed | undefined; /** * Optional. Service message: a suggested post was declined */ get suggestedPostDeclined(): TelegramSuggestedPostDeclined | undefined; /** * Optional. Service message: payment for a suggested post was received */ get suggestedPostPaid(): TelegramSuggestedPostPaid | undefined; /** * Optional. Service message: payment for a suggested post was refunded */ get suggestedPostRefunded(): TelegramSuggestedPostRefunded | undefined; /** * Optional. Service message: video chat scheduled */ get videoChatScheduled(): VideoChatScheduled | undefined; /** * Optional. Service message: video chat started */ get videoChatStarted(): TelegramVideoChatStarted | undefined; /** * Optional. Service message: video chat ended */ get videoChatEnded(): VideoChatEnded | undefined; /** * Optional. Service message: new participants invited to a video chat */ get videoChatParticipantsInvited(): VideoChatParticipantsInvited | undefined; /** * Optional. Service message: data sent by a Web App */ get webAppData(): WebAppData | undefined; /** * Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ get replyMarkup(): InlineKeyboardMarkup | undefined; /** * true if `message_thread_id` is set */ hasMessageThreadId(): this is this & { messageThreadId: number; }; /** * true if `direct_messages_topic` is set */ hasDirectMessagesTopic(): this is this & { directMessagesTopic: TelegramDirectMessagesTopic; }; /** * true if `from` is set */ hasFrom(): this is this & { from: User; }; /** * true if `sender_chat` is set */ hasSenderChat(): this is this & { senderChat: Chat; }; /** * true if `sender_boost_count` is set */ hasSenderBoostCount(): this is this & { senderBoostCount: number; }; /** * true if `sender_business_bot` is set */ hasSenderBusinessBot(): this is this & { senderBusinessBot: User; }; /** * true if `sender_tag` is set */ hasSenderTag(): this is this & { senderTag: string; }; /** * true if `receiver_user` is set */ hasReceiverUser(): this is this & { receiverUser: User; }; /** * true if `ephemeral_message_id` is set */ hasEphemeralMessageId(): this is this & { ephemeralMessageId: number; }; /** * true if `guest_query_id` is set */ hasGuestQueryId(): this is this & { guestQueryId: string; }; /** * true if `business_connection_id` is set */ hasBusinessConnectionId(): this is this & { businessConnectionId: string; }; /** * true if `forward_origin` is set */ hasForwardOrigin(): this is this & { forwardOrigin: TelegramMessageOrigin; }; /** * true if `reply_to_message` is set */ hasReplyToMessage(): this is this & { replyToMessage: Message; }; /** * true if `external_reply` is set */ hasExternalReply(): this is this & { externalReply: ExternalReplyInfo; }; /** * true if `quote` is set */ hasQuote(): this is this & { quote: TextQuote; }; /** * true if `reply_to_story` is set */ hasReplyToStory(): this is this & { replyToStory: Story; }; /** * true if `reply_to_checklist_task_id` is set */ hasReplyToChecklistTaskId(): this is this & { replyToChecklistTaskId: number; }; /** * true if `reply_to_poll_option_id` is set */ hasReplyToPollOptionId(): this is this & { replyToPollOptionId: string; }; /** * true if `via_bot` is set */ hasViaBot(): this is this & { viaBot: User; }; /** * true if `guest_bot_caller_user` is set */ hasGuestBotCallerUser(): this is this & { guestBotCallerUser: User; }; /** * true if `guest_bot_caller_chat` is set */ hasGuestBotCallerChat(): this is this & { guestBotCallerChat: Chat; }; /** * true if `edit_date` is set */ hasEditDate(): this is this & { editDate: number; }; /** * true if `media_group_id` is set */ hasMediaGroupId(): this is this & { mediaGroupId: string; }; /** * true if `author_signature` is set */ hasAuthorSignature(): this is this & { authorSignature: string; }; /** * true if `paid_star_count` is set */ hasPaidStarCount(): this is this & { paidStarCount: number; }; /** * true if `text` is set */ hasText(): this is this & { text: string; }; /** * true if `entities` has at least one item */ hasEntities(): this is this & { entities: MessageEntity[]; }; /** * true if `link_preview_options` is set */ hasLinkPreviewOptions(): this is this & { linkPreviewOptions: LinkPreviewOptions; }; /** * true if `suggested_post_info` is set */ hasSuggestedPostInfo(): this is this & { suggestedPostInfo: TelegramSuggestedPostInfo; }; /** * true if `effect_id` is set */ hasEffectId(): this is this & { effectId: string; }; /** * true if `rich_message` is set */ hasRichMessage(): this is this & { richMessage: TelegramRichMessage; }; /** * true if `animation` is set */ hasAnimation(): this is this & { animation: Animation; }; /** * true if `audio` is set */ hasAudio(): this is this & { audio: Audio; }; /** * true if `document` is set */ hasDocument(): this is this & { document: Document; }; /** * true if `live_photo` is set */ hasLivePhoto(): this is this & { livePhoto: LivePhoto; }; /** * true if `paid_media` is set */ hasPaidMedia(): this is this & { paidMedia: TelegramPaidMediaInfo; }; /** * true if `photo` has at least one item */ hasPhoto(): this is this & { photo: Photo; }; /** * true if `sticker` is set */ hasSticker(): this is this & { sticker: Sticker; }; /** * true if `story` is set */ hasStory(): this is this & { story: Story; }; /** * true if `video` is set */ hasVideo(): this is this & { video: Video; }; /** * true if `video_note` is set */ hasVideoNote(): this is this & { videoNote: VideoNote; }; /** * true if `voice` is set */ hasVoice(): this is this & { voice: Voice; }; /** * true if `caption` is set */ hasCaption(): this is this & { caption: string; }; /** * true if `caption_entities` has at least one item */ hasCaptionEntities(): this is this & { captionEntities: MessageEntity[]; }; /** * true if `show_caption_above_media` is set */ hasShowCaptionAboveMedia(): this is this & { showCaptionAboveMedia: true; }; /** * true if `checklist` is set */ hasChecklist(): this is this & { checklist: TelegramChecklist; }; /** * true if `contact` is set */ hasContact(): this is this & { contact: Contact; }; /** * true if `dice` is set */ hasDice(): this is this & { dice: Dice; }; /** * true if `game` is set */ hasGame(): this is this & { game: Game; }; /** * true if `poll` is set */ hasPoll(): this is this & { poll: Poll; }; /** * true if `venue` is set */ hasVenue(): this is this & { venue: Venue; }; /** * true if `location` is set */ hasLocation(): this is this & { location: Location; }; /** * true if `new_chat_members` has at least one item */ hasNewChatMembers(): this is this & { newChatMembers: User[]; }; /** * true if `left_chat_member` is set */ hasLeftChatMember(): this is this & { leftChatMember: User; }; /** * true if `chat_owner_left` is set */ hasChatOwnerLeft(): this is this & { chatOwnerLeft: TelegramChatOwnerLeft; }; /** * true if `chat_owner_changed` is set */ hasChatOwnerChanged(): this is this & { chatOwnerChanged: TelegramChatOwnerChanged; }; /** * true if `new_chat_title` is set */ hasNewChatTitle(): this is this & { newChatTitle: string; }; /** * true if `new_chat_photo` has at least one item */ hasNewChatPhoto(): this is this & { newChatPhoto: Photo; }; /** * true if `delete_chat_photo` is set */ hasDeleteChatPhoto(): this is this & { deleteChatPhoto: true; }; /** * true if `group_chat_created` is set */ hasGroupChatCreated(): this is this & { groupChatCreated: true; }; /** * true if `supergroup_chat_created` is set */ hasSupergroupChatCreated(): this is this & { supergroupChatCreated: true; }; /** * true if `channel_chat_created` is set */ hasChannelChatCreated(): this is this & { channelChatCreated: true; }; /** * true if `message_auto_delete_timer_changed` is set */ hasMessageAutoDeleteTimerChanged(): this is this & { messageAutoDeleteTimerChanged: TelegramMessageAutoDeleteTimerChanged; }; /** * true if `migrate_to_chat_id` is set */ hasMigrateToChatId(): this is this & { migrateToChatId: number; }; /** * true if `migrate_from_chat_id` is set */ hasMigrateFromChatId(): this is this & { migrateFromChatId: number; }; /** * true if `pinned_message` is set */ hasPinnedMessage(): this is this & { pinnedMessage: TelegramMaybeInaccessibleMessage; }; /** * true if `invoice` is set */ hasInvoice(): this is this & { invoice: Invoice; }; /** * true if `successful_payment` is set */ hasSuccessfulPayment(): this is this & { successfulPayment: SuccessfulPayment; }; /** * true if `refunded_payment` is set */ hasRefundedPayment(): this is this & { refundedPayment: TelegramRefundedPayment; }; /** * true if `users_shared` is set */ hasUsersShared(): this is this & { usersShared: UsersShared; }; /** * true if `chat_shared` is set */ hasChatShared(): this is this & { chatShared: ChatShared; }; /** * true if `gift` is set */ hasGift(): this is this & { gift: TelegramGiftInfo; }; /** * true if `unique_gift` is set */ hasUniqueGift(): this is this & { uniqueGift: TelegramUniqueGiftInfo; }; /** * true if `gift_upgrade_sent` is set */ hasGiftUpgradeSent(): this is this & { giftUpgradeSent: TelegramGiftInfo; }; /** * true if `connected_website` is set */ hasConnectedWebsite(): this is this & { connectedWebsite: string; }; /** * true if `write_access_allowed` is set */ hasWriteAccessAllowed(): this is this & { writeAccessAllowed: WriteAccessAllowed; }; /** * true if `passport_data` is set */ hasPassportData(): this is this & { passportData: PassportData; }; /** * true if `proximity_alert_triggered` is set */ hasProximityAlertTriggered(): this is this & { proximityAlertTriggered: ProximityAlertTriggered; }; /** * true if `boost_added` is set */ hasBoostAdded(): this is this & { boostAdded: TelegramChatBoostAdded; }; /** * true if `chat_background_set` is set */ hasChatBackgroundSet(): this is this & { chatBackgroundSet: TelegramChatBackground; }; /** * true if `checklist_tasks_done` is set */ hasChecklistTasksDone(): this is this & { checklistTasksDone: TelegramChecklistTasksDone; }; /** * true if `checklist_tasks_added` is set */ hasChecklistTasksAdded(): this is this & { checklistTasksAdded: TelegramChecklistTasksAdded; }; /** * true if `community_chat_added` is set */ hasCommunityChatAdded(): this is this & { communityChatAdded: TelegramCommunityChatAdded; }; /** * true if `community_chat_joined` is set */ hasCommunityChatJoined(): this is this & { communityChatJoined: TelegramCommunityChatJoined; }; /** * true if `community_chat_removed` is set */ hasCommunityChatRemoved(): this is this & { communityChatRemoved: TelegramCommunityChatRemoved; }; /** * true if `direct_message_price_changed` is set */ hasDirectMessagePriceChanged(): this is this & { directMessagePriceChanged: TelegramDirectMessagePriceChanged; }; /** * true if `forum_topic_created` is set */ hasForumTopicCreated(): this is this & { forumTopicCreated: ForumTopicCreated; }; /** * true if `forum_topic_edited` is set */ hasForumTopicEdited(): this is this & { forumTopicEdited: ForumTopicEdited; }; /** * true if `forum_topic_closed` is set */ hasForumTopicClosed(): this is this & { forumTopicClosed: TelegramForumTopicClosed; }; /** * true if `forum_topic_reopened` is set */ hasForumTopicReopened(): this is this & { forumTopicReopened: TelegramForumTopicReopened; }; /** * true if `general_forum_topic_hidden` is set */ hasGeneralForumTopicHidden(): this is this & { generalForumTopicHidden: TelegramGeneralForumTopicHidden; }; /** * true if `general_forum_topic_unhidden` is set */ hasGeneralForumTopicUnhidden(): this is this & { generalForumTopicUnhidden: TelegramGeneralForumTopicUnhidden; }; /** * true if `giveaway_created` is set */ hasGiveawayCreated(): this is this & { giveawayCreated: TelegramGiveawayCreated; }; /** * true if `giveaway` is set */ hasGiveaway(): this is this & { giveaway: Giveaway; }; /** * true if `giveaway_winners` is set */ hasGiveawayWinners(): this is this & { giveawayWinners: GiveawayWinners; }; /** * true if `giveaway_completed` is set */ hasGiveawayCompleted(): this is this & { giveawayCompleted: GiveawayCompleted; }; /** * true if `managed_bot_created` is set */ hasManagedBotCreated(): this is this & { managedBotCreated: TelegramManagedBotCreated; }; /** * true if `paid_message_price_changed` is set */ hasPaidMessagePriceChanged(): this is this & { paidMessagePriceChanged: TelegramPaidMessagePriceChanged; }; /** * true if `poll_option_added` is set */ hasPollOptionAdded(): this is this & { pollOptionAdded: TelegramPollOptionAdded; }; /** * true if `poll_option_deleted` is set */ hasPollOptionDeleted(): this is this & { pollOptionDeleted: TelegramPollOptionDeleted; }; /** * true if `suggested_post_approved` is set */ hasSuggestedPostApproved(): this is this & { suggestedPostApproved: TelegramSuggestedPostApproved; }; /** * true if `suggested_post_approval_failed` is set */ hasSuggestedPostApprovalFailed(): this is this & { suggestedPostApprovalFailed: TelegramSuggestedPostApprovalFailed; }; /** * true if `suggested_post_declined` is set */ hasSuggestedPostDeclined(): this is this & { suggestedPostDeclined: TelegramSuggestedPostDeclined; }; /** * true if `suggested_post_paid` is set */ hasSuggestedPostPaid(): this is this & { suggestedPostPaid: TelegramSuggestedPostPaid; }; /** * true if `suggested_post_refunded` is set */ hasSuggestedPostRefunded(): this is this & { suggestedPostRefunded: TelegramSuggestedPostRefunded; }; /** * true if `video_chat_scheduled` is set */ hasVideoChatScheduled(): this is this & { videoChatScheduled: VideoChatScheduled; }; /** * true if `video_chat_started` is set */ hasVideoChatStarted(): this is this & { videoChatStarted: TelegramVideoChatStarted; }; /** * true if `video_chat_ended` is set */ hasVideoChatEnded(): this is this & { videoChatEnded: VideoChatEnded; }; /** * true if `video_chat_participants_invited` is set */ hasVideoChatParticipantsInvited(): this is this & { videoChatParticipantsInvited: VideoChatParticipantsInvited; }; /** * true if `web_app_data` is set */ hasWebAppData(): this is this & { webAppData: WebAppData; }; /** * true if `reply_markup` is set */ hasReplyMarkup(): this is this & { replyMarkup: InlineKeyboardMarkup; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. */ export declare class MessageEntity { raw: TelegramMessageEntity; private _user?; constructor(raw: TelegramMessageEntity); static fromPayload(raw: TelegramMessageEntity): MessageEntity; /** * Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time). */ get type(): "mention" | "hashtag" | "cashtag" | "bot_command" | "url" | "email" | "phone_number" | "bold" | "italic" | "underline" | "strikethrough" | "spoiler" | "blockquote" | "expandable_blockquote" | "code" | "pre" | "text_link" | "text_mention" | "custom_emoji" | "date_time"; /** * Offset in UTF-16 code units to the start of the entity */ get offset(): number; /** * Length of the entity in UTF-16 code units */ get length(): number; /** * Optional. For “text_link” only, URL that will be opened after user taps on the text */ get url(): string | undefined; /** * Optional. For “text_mention” only, the mentioned user */ get user(): User | undefined; /** * Optional. For “pre” only, the programming language of the entity text */ get language(): string | undefined; /** * Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker. */ get customEmojiId(): string | undefined; /** * Optional. For “date_time” only, the Unix time associated with the entity */ get unixTime(): number | undefined; /** * Optional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details. */ get dateTimeFormat(): string | undefined; /** * true if `url` is set */ hasUrl(): this is this & { url: string; }; /** * true if `user` is set */ hasUser(): this is this & { user: User; }; /** * true if `language` is set */ hasLanguage(): this is this & { language: string; }; /** * true if `custom_emoji_id` is set */ hasCustomEmojiId(): this is this & { customEmojiId: string; }; /** * true if `unix_time` is set */ hasUnixTime(): this is this & { unixTime: number; }; /** * true if `date_time_format` is set */ hasDateTimeFormat(): this is this & { dateTimeFormat: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type MentionMessageEntity = Omit & { type: "mention"; }; export type HashtagMessageEntity = Omit & { type: "hashtag"; }; export type CashtagMessageEntity = Omit & { type: "cashtag"; }; export type BotCommandMessageEntity = Omit & { type: "bot_command"; }; export type UrlMessageEntity = Omit & { type: "url"; }; export type EmailMessageEntity = Omit & { type: "email"; }; export type PhoneNumberMessageEntity = Omit & { type: "phone_number"; }; export type BoldMessageEntity = Omit & { type: "bold"; }; export type ItalicMessageEntity = Omit & { type: "italic"; }; export type UnderlineMessageEntity = Omit & { type: "underline"; }; export type StrikethroughMessageEntity = Omit & { type: "strikethrough"; }; export type SpoilerMessageEntity = Omit & { type: "spoiler"; }; export type BlockquoteMessageEntity = Omit & { type: "blockquote"; }; export type ExpandableBlockquoteMessageEntity = Omit & { type: "expandable_blockquote"; }; export type CodeMessageEntity = Omit & { type: "code"; }; export type PreMessageEntity = Omit & { type: "pre"; }; export type TextLinkMessageEntity = Omit & { type: "text_link"; }; export type TextMentionMessageEntity = Omit & { type: "text_mention"; }; export type CustomEmojiMessageEntity = Omit & { type: "custom_emoji"; }; export type DateTimeMessageEntity = Omit & { type: "date_time"; }; /** * This object represents a unique message identifier. */ export declare class MessageId { raw: TelegramMessageId; constructor(raw: TelegramMessageId); static fromPayload(raw: TelegramMessageId): MessageId; /** * Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent. */ get id(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents reaction changes on a message with anonymous reactions. */ export declare class MessageReactionCountUpdated { raw: TelegramMessageReactionCountUpdated; private _chat?; private _reactions?; constructor(raw: TelegramMessageReactionCountUpdated); static fromPayload(raw: TelegramMessageReactionCountUpdated): MessageReactionCountUpdated; /** * The chat containing the message */ get chat(): Chat; /** * Unique message identifier inside the chat */ get id(): number; /** * Date of the change in Unix time */ get date(): number; /** * List of reactions that are present on the message */ get reactions(): ReactionCounts; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a change of a reaction on a message performed by a user. */ export declare class MessageReactionUpdated { raw: TelegramMessageReactionUpdated; private _chat?; private _user?; private _actorChat?; private _oldReaction?; private _newReaction?; constructor(raw: TelegramMessageReactionUpdated); static fromPayload(raw: TelegramMessageReactionUpdated): MessageReactionUpdated; /** * The chat containing the message the user reacted to */ get chat(): Chat; /** * Unique identifier of the message inside the chat */ get id(): number; /** * Optional. The user that changed the reaction, if the user isn't anonymous */ get user(): User | undefined; /** * Optional. The chat on behalf of which the reaction was changed, if the user is anonymous */ get actorChat(): Chat | undefined; /** * Date of the change in Unix time */ get date(): number; /** * Previous list of reaction types that were set by the user */ get oldReaction(): Reactions; /** * New list of reaction types that have been set by the user */ get newReaction(): Reactions; /** * true if `user` is set */ hasUser(): this is this & { user: User; }; /** * true if `actor_chat` is set */ hasActorChat(): this is this & { actorChat: Chat; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents information about an order. */ export declare class OrderInfo { raw: TelegramOrderInfo; private _shippingAddress?; constructor(raw: TelegramOrderInfo); static fromPayload(raw: TelegramOrderInfo): OrderInfo; /** * Optional. User name */ get name(): string | undefined; /** * Optional. User's phone number */ get phoneNumber(): string | undefined; /** * Optional. User email */ get email(): string | undefined; /** * Optional. User shipping address */ get shippingAddress(): ShippingAddress | undefined; /** * true if `name` is set */ hasName(): this is this & { name: string; }; /** * true if `phone_number` is set */ hasPhoneNumber(): this is this & { phoneNumber: string; }; /** * true if `email` is set */ hasEmail(): this is this & { email: string; }; /** * true if `shipping_address` is set */ hasShippingAddress(): this is this & { shippingAddress: ShippingAddress; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Describes Telegram Passport data shared with the bot by the user. */ export declare class PassportData { raw: TelegramPassportData; constructor(raw: TelegramPassportData); static fromPayload(raw: TelegramPassportData): PassportData; /** * Array with information about documents and other Telegram Passport elements that was shared with the bot */ get data(): TelegramEncryptedPassportElement[]; /** * Encrypted credentials required to decrypt the data */ get credentials(): TelegramEncryptedCredentials; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents one size of a photo or a file / sticker thumbnail. */ export declare class PhotoSize { raw: TelegramPhotoSize; constructor(raw: TelegramPhotoSize); static fromPayload(raw: TelegramPhotoSize): PhotoSize; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Photo width */ get width(): number; /** * Photo height */ get height(): number; /** * Optional. File size in bytes */ get fileSize(): number | undefined; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about a poll. */ export declare class Poll { raw: TelegramPoll; private _questionEntities?; private _options?; private _explanationEntities?; private _explanationMedia?; private _descriptionEntities?; private _media?; constructor(raw: TelegramPoll); static fromPayload(raw: TelegramPoll): Poll; /** * Unique poll identifier */ get id(): string; /** * Poll question, 1-300 characters */ get question(): string; /** * Optional. Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions */ get questionEntities(): MessageEntity[] | undefined; /** * List of poll options */ get options(): PollOptions; /** * Total number of users that voted in the poll */ get totalVoterCount(): number; /** * True, if the poll is closed */ get isClosed(): boolean; /** * True, if the poll is anonymous */ get isAnonymous(): boolean; /** * Poll type, currently can be “regular” or “quiz” */ get type(): "regular" | "quiz"; /** * True, if the poll allows multiple answers */ get allowsMultipleAnswers(): boolean; /** * True, if the poll allows to change the chosen answer options */ get allowsRevoting(): boolean; /** * True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours */ get membersOnly(): boolean; /** * Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code “FT” is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll. */ get countryCodes(): string[] | undefined; /** * Optional. Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot. */ get correctOptionIds(): number[] | undefined; /** * Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */ get explanation(): string | undefined; /** * Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation */ get explanationEntities(): MessageEntity[] | undefined; /** * Optional. Media added to the quiz explanation */ get explanationMedia(): PollMedia | undefined; /** * Optional. Amount of time in seconds the poll will be active after creation */ get openPeriod(): number | undefined; /** * Optional. Point in time (Unix timestamp) when the poll will be automatically closed */ get closeDate(): number | undefined; /** * Optional. Description of the poll; for polls inside the Message object only */ get description(): string | undefined; /** * Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the description */ get descriptionEntities(): MessageEntity[] | undefined; /** * Optional. Media added to the poll description; for polls inside the Message object only */ get media(): PollMedia | undefined; /** * true if `question_entities` has at least one item */ hasQuestionEntities(): this is this & { questionEntities: MessageEntity[]; }; /** * true if `country_codes` has at least one item */ hasCountryCodes(): this is this & { countryCodes: string[]; }; /** * true if `correct_option_ids` has at least one item */ hasCorrectOptionIds(): this is this & { correctOptionIds: number[]; }; /** * true if `explanation` is set */ hasExplanation(): this is this & { explanation: string; }; /** * true if `explanation_entities` has at least one item */ hasExplanationEntities(): this is this & { explanationEntities: MessageEntity[]; }; /** * true if `explanation_media` is set */ hasExplanationMedia(): this is this & { explanationMedia: PollMedia; }; /** * true if `open_period` is set */ hasOpenPeriod(): this is this & { openPeriod: number; }; /** * true if `close_date` is set */ hasCloseDate(): this is this & { closeDate: number; }; /** * true if `description` is set */ hasDescription(): this is this & { description: string; }; /** * true if `description_entities` has at least one item */ hasDescriptionEntities(): this is this & { descriptionEntities: MessageEntity[]; }; /** * true if `media` is set */ hasMedia(): this is this & { media: PollMedia; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type RegularPoll = Omit & { type: "regular"; }; export type QuizPoll = Omit & { type: "quiz"; }; /** * This object represents an answer of a user in a non-anonymous poll. */ export declare class PollAnswer { raw: TelegramPollAnswer; private _voterChat?; private _user?; constructor(raw: TelegramPollAnswer); static fromPayload(raw: TelegramPollAnswer): PollAnswer; /** * Unique poll identifier */ get pollId(): string; /** * Optional. The chat that changed the answer to the poll, if the voter is anonymous */ get voterChat(): Chat | undefined; /** * Optional. The user that changed the answer to the poll, if the voter isn't anonymous */ get user(): User | undefined; /** * 0-based identifiers of chosen answer options. May be empty if the vote was retracted. */ get optionIds(): number[]; /** * Persistent identifiers of the chosen answer options. May be empty if the vote was retracted. */ get optionPersistentIds(): string[]; /** * true if `voter_chat` is set */ hasVoterChat(): this is this & { voterChat: Chat; }; /** * true if `user` is set */ hasUser(): this is this & { user: User; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * At most one of the optional fields can be present in any given object. */ export declare class PollMedia { raw: TelegramPollMedia; private _animation?; private _audio?; private _document?; private _livePhoto?; private _location?; private _photo?; private _sticker?; private _venue?; private _video?; constructor(raw: TelegramPollMedia); static fromPayload(raw: TelegramPollMedia): PollMedia; /** * Optional. Media is an animation, information about the animation */ get animation(): Animation | undefined; /** * Optional. Media is an audio file, information about the file; currently, can't be received in a poll option */ get audio(): Audio | undefined; /** * Optional. Media is a general file, information about the file; currently, can't be received in a poll option */ get document(): Document | undefined; /** * Optional. The HTTP link attached to the poll option */ get link(): TelegramLink | undefined; /** * Optional. Media is a live photo, information about the live photo */ get livePhoto(): LivePhoto | undefined; /** * Optional. Media is a shared location, information about the location */ get location(): Location | undefined; /** * Optional. Media is a photo, available sizes of the photo */ get photo(): Photo | undefined; /** * Optional. Media is a sticker, information about the sticker; currently, for poll options only */ get sticker(): Sticker | undefined; /** * Optional. Media is a venue, information about the venue */ get venue(): Venue | undefined; /** * Optional. Media is a video, information about the video */ get video(): Video | undefined; /** * true if `animation` is set */ hasAnimation(): this is this & { animation: Animation; }; /** * true if `audio` is set */ hasAudio(): this is this & { audio: Audio; }; /** * true if `document` is set */ hasDocument(): this is this & { document: Document; }; /** * true if `link` is set */ hasLink(): this is this & { link: TelegramLink; }; /** * true if `live_photo` is set */ hasLivePhoto(): this is this & { livePhoto: LivePhoto; }; /** * true if `location` is set */ hasLocation(): this is this & { location: Location; }; /** * true if `photo` has at least one item */ hasPhoto(): this is this & { photo: Photo; }; /** * true if `sticker` is set */ hasSticker(): this is this & { sticker: Sticker; }; /** * true if `venue` is set */ hasVenue(): this is this & { venue: Venue; }; /** * true if `video` is set */ hasVideo(): this is this & { video: Video; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about one answer option in a poll. */ export declare class PollOption { raw: TelegramPollOption; private _textEntities?; private _media?; private _addedByUser?; private _addedByChat?; constructor(raw: TelegramPollOption); static fromPayload(raw: TelegramPollOption): PollOption; /** * Unique identifier of the option, persistent on option addition and deletion */ get persistentId(): string; /** * Option text, 1-100 characters */ get text(): string; /** * Optional. Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts */ get textEntities(): MessageEntity[] | undefined; /** * Optional. Media added to the poll option */ get media(): PollMedia | undefined; /** * Number of users who voted for this option; may be 0 if unknown */ get voterCount(): number; /** * Optional. User who added the option; omitted if the option wasn't added by a user after poll creation */ get addedByUser(): User | undefined; /** * Optional. Chat that added the option; omitted if the option wasn't added by a chat after poll creation */ get addedByChat(): Chat | undefined; /** * Optional. Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll */ get additionDate(): number | undefined; /** * true if `text_entities` has at least one item */ hasTextEntities(): this is this & { textEntities: MessageEntity[]; }; /** * true if `media` is set */ hasMedia(): this is this & { media: PollMedia; }; /** * true if `added_by_user` is set */ hasAddedByUser(): this is this & { addedByUser: User; }; /** * true if `added_by_chat` is set */ hasAddedByChat(): this is this & { addedByChat: Chat; }; /** * true if `addition_date` is set */ hasAdditionDate(): this is this & { additionDate: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about an incoming pre-checkout query. */ export declare class PreCheckoutQuery { raw: TelegramPreCheckoutQuery; private _from?; private _orderInfo?; constructor(raw: TelegramPreCheckoutQuery); static fromPayload(raw: TelegramPreCheckoutQuery): PreCheckoutQuery; /** * Unique query identifier */ get id(): string; /** * User who sent the query */ get from(): User; /** * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */ get currency(): string; /** * Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ get totalAmount(): number; /** * Bot-specified invoice payload */ get invoicePayload(): string; /** * Optional. Identifier of the shipping option chosen by the user */ get shippingOptionId(): string | undefined; /** * Optional. Order information provided by the user */ get orderInfo(): OrderInfo | undefined; /** * true if `shipping_option_id` is set */ hasShippingOptionId(): this is this & { shippingOptionId: string; }; /** * true if `order_info` is set */ hasOrderInfo(): this is this & { orderInfo: OrderInfo; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * 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 declare class ProximityAlertTriggered { raw: TelegramProximityAlertTriggered; private _traveler?; private _watcher?; constructor(raw: TelegramProximityAlertTriggered); static fromPayload(raw: TelegramProximityAlertTriggered): ProximityAlertTriggered; /** * User that triggered the alert */ get traveler(): User; /** * User that set the alert */ get watcher(): User; /** * The distance between the users */ get distance(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Represents a reaction added to a message along with the number of times it was added. */ export declare class ReactionCount { raw: TelegramReactionCount; constructor(raw: TelegramReactionCount); static fromPayload(raw: TelegramReactionCount): ReactionCount; /** * Type of the reaction */ get type(): TelegramReactionType; /** * Number of times the reaction was added */ get totalCount(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a shipping address. */ export declare class ShippingAddress { raw: TelegramShippingAddress; constructor(raw: TelegramShippingAddress); static fromPayload(raw: TelegramShippingAddress): ShippingAddress; /** * Two-letter ISO 3166-1 alpha-2 country code */ get countryCode(): string; /** * State, if applicable */ get state(): string; /** * City */ get city(): string; /** * First line for the address */ get streetLine1(): string; /** * Second line for the address */ get streetLine2(): string; /** * Address post code */ get postCode(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about an incoming shipping query. */ export declare class ShippingQuery { raw: TelegramShippingQuery; private _from?; private _shippingAddress?; constructor(raw: TelegramShippingQuery); static fromPayload(raw: TelegramShippingQuery): ShippingQuery; /** * Unique query identifier */ get id(): string; /** * User who sent the query */ get from(): User; /** * Bot-specified invoice payload */ get invoicePayload(): string; /** * User specified shipping address */ get shippingAddress(): ShippingAddress; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a sticker. */ export declare class Sticker { raw: TelegramSticker; private _thumbnail?; private _premiumAnimation?; private _maskPosition?; constructor(raw: TelegramSticker); static fromPayload(raw: TelegramSticker): Sticker; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): 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. */ get type(): "regular" | "mask" | "custom_emoji"; /** * Sticker width */ get width(): number; /** * Sticker height */ get height(): number; /** * True, if the sticker is animated */ get isAnimated(): boolean; /** * True, if the sticker is a video sticker */ get isVideo(): boolean; /** * Optional. Sticker thumbnail in the .WEBP or .JPG format */ get thumbnail(): PhotoSize | undefined; /** * Optional. Emoji associated with the sticker */ get emoji(): string | undefined; /** * Optional. Name of the sticker set to which the sticker belongs */ get setName(): string | undefined; /** * Optional. For premium regular stickers, premium animation for the sticker */ get premiumAnimation(): File | undefined; /** * Optional. For mask stickers, the position where the mask should be placed */ get maskPosition(): MaskPosition | undefined; /** * Optional. For custom emoji stickers, unique identifier of the custom emoji */ get customEmojiId(): string | undefined; /** * Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places */ get needsRepainting(): true | undefined; /** * Optional. File size in bytes */ get fileSize(): number | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; /** * true if `emoji` is set */ hasEmoji(): this is this & { emoji: string; }; /** * true if `set_name` is set */ hasSetName(): this is this & { setName: string; }; /** * true if `premium_animation` is set */ hasPremiumAnimation(): this is this & { premiumAnimation: File; }; /** * true if `mask_position` is set */ hasMaskPosition(): this is this & { maskPosition: MaskPosition; }; /** * true if `custom_emoji_id` is set */ hasCustomEmojiId(): this is this & { customEmojiId: string; }; /** * true if `needs_repainting` is set */ hasNeedsRepainting(): this is this & { needsRepainting: true; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type RegularSticker = Omit & { type: "regular"; }; export type MaskSticker = Omit & { type: "mask"; }; export type CustomEmojiSticker = Omit & { type: "custom_emoji"; }; /** * This object represents a sticker set. */ export declare class StickerSet { raw: TelegramStickerSet; private _stickers?; private _thumbnail?; constructor(raw: TelegramStickerSet); static fromPayload(raw: TelegramStickerSet): StickerSet; /** * Sticker set name */ get name(): string; /** * Sticker set title */ get title(): string; /** * Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” */ get stickerType(): "regular" | "mask" | "custom_emoji"; /** * List of all set stickers */ get stickers(): Sticker[]; /** * Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */ get thumbnail(): PhotoSize | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; [INSPECT](depth: any, options: any, inspect: any): string; } export type RegularStickerSet = Omit & { stickerType: "regular"; }; export type MaskStickerSet = Omit & { stickerType: "mask"; }; export type CustomEmojiStickerSet = Omit & { stickerType: "custom_emoji"; }; /** * This object represents a story. */ export declare class Story { raw: TelegramStory; private _chat?; constructor(raw: TelegramStory); static fromPayload(raw: TelegramStory): Story; /** * Chat that posted the story */ get chat(): Chat; /** * Unique identifier for the story in the chat */ get id(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control. */ export declare class SuccessfulPayment { raw: TelegramSuccessfulPayment; private _orderInfo?; constructor(raw: TelegramSuccessfulPayment); static fromPayload(raw: TelegramSuccessfulPayment): SuccessfulPayment; /** * Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars */ get currency(): string; /** * Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ get totalAmount(): number; /** * Bot-specified invoice payload */ get invoicePayload(): string; /** * Optional. Expiration date of the subscription, in Unix time; for recurring payments only */ get subscriptionExpirationDate(): number | undefined; /** * Optional. True, if the payment is a recurring payment for a subscription */ get isRecurring(): true | undefined; /** * Optional. True, if the payment is the first payment for a subscription */ get isFirstRecurring(): true | undefined; /** * Optional. Identifier of the shipping option chosen by the user */ get shippingOptionId(): string | undefined; /** * Optional. Order information provided by the user */ get orderInfo(): OrderInfo | undefined; /** * Telegram payment identifier */ get telegramPaymentChargeId(): string; /** * Provider payment identifier */ get providerPaymentChargeId(): string; /** * true if `subscription_expiration_date` is set */ hasSubscriptionExpirationDate(): this is this & { subscriptionExpirationDate: number; }; /** * true if `shipping_option_id` is set */ hasShippingOptionId(): this is this & { shippingOptionId: string; }; /** * true if `order_info` is set */ hasOrderInfo(): this is this & { orderInfo: OrderInfo; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about the quoted part of a message that is replied to by the given message. */ export declare class TextQuote { raw: TelegramTextQuote; private _entities?; constructor(raw: TelegramTextQuote); static fromPayload(raw: TelegramTextQuote): TextQuote; /** * Text of the quoted part of a message that is replied to by the given message */ get text(): string; /** * Optional. Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes. */ get entities(): MessageEntity[] | undefined; /** * Approximate quote position in the original message in UTF-16 code units as specified by the sender */ get position(): number; /** * Optional. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server. */ get isManual(): true | undefined; /** * true if `entities` has at least one item */ hasEntities(): this is this & { entities: MessageEntity[]; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a Telegram user or bot. */ export declare class User { raw: TelegramUser; constructor(raw: TelegramUser); static fromPayload(raw: TelegramUser): User; /** * Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ get id(): number; /** * True, if this user is a bot */ get isBot(): boolean; /** * User's or bot's first name */ get firstName(): string; /** * Optional. User's or bot's last name */ get lastName(): string | undefined; /** * Optional. User's or bot's username */ get username(): string | undefined; /** * Optional. IETF language tag of the user's language */ get languageCode(): string | undefined; /** * Optional. True, if this user is a Telegram Premium user */ get isPremium(): true | undefined; /** * Optional. True, if this user added the bot to the attachment menu */ get addedToAttachmentMenu(): true | undefined; /** * Optional. True, if the bot can be invited to groups. Returned only in getMe. */ get canJoinGroups(): boolean | undefined; /** * Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. */ get canReadAllGroupMessages(): boolean | undefined; /** * Optional. True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe. */ get supportsGuestQueries(): boolean | undefined; /** * Optional. True, if the bot supports inline queries. Returned only in getMe. */ get supportsInlineQueries(): boolean | undefined; /** * Optional. True, if the bot can be connected to a user account to manage it. Returned only in getMe. */ get canConnectToBusiness(): boolean | undefined; /** * Optional. True, if the bot has a main Web App. Returned only in getMe. */ get hasMainWebApp(): boolean | undefined; /** * Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe. */ get hasTopicsEnabled(): boolean | undefined; /** * Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe. */ get allowsUsersToCreateTopics(): boolean | undefined; /** * Optional. True, if other bots can be created to be controlled by the bot. Returned only in getMe. */ get canManageBots(): boolean | undefined; /** * Optional. True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe. */ get supportsJoinRequestQueries(): boolean | undefined; /** * true if `last_name` is set */ hasLastName(): this is this & { lastName: string; }; /** * true if `username` is set */ hasUsername(): this is this & { username: string; }; /** * true if `language_code` is set */ hasLanguageCode(): this is this & { languageCode: string; }; /** * true if `added_to_attachment_menu` is set */ hasAddedToAttachmentMenu(): this is this & { addedToAttachmentMenu: true; }; /** * true if `can_join_groups` is set */ hasCanJoinGroups(): this is this & { canJoinGroups: boolean; }; /** * true if `can_read_all_group_messages` is set */ hasCanReadAllGroupMessages(): this is this & { canReadAllGroupMessages: boolean; }; /** * true if `supports_guest_queries` is set */ hasSupportsGuestQueries(): this is this & { supportsGuestQueries: boolean; }; /** * true if `supports_inline_queries` is set */ hasSupportsInlineQueries(): this is this & { supportsInlineQueries: boolean; }; /** * true if `can_connect_to_business` is set */ hasCanConnectToBusiness(): this is this & { canConnectToBusiness: boolean; }; /** * true if `allows_users_to_create_topics` is set */ hasAllowsUsersToCreateTopics(): this is this & { allowsUsersToCreateTopics: boolean; }; /** * true if `can_manage_bots` is set */ hasCanManageBots(): this is this & { canManageBots: boolean; }; /** * true if `supports_join_request_queries` is set */ hasSupportsJoinRequestQueries(): this is this & { supportsJoinRequestQueries: boolean; }; /** * display name; first name plus last name when present, otherwise just first name */ get displayName(): string; /** * render a clickable mention pointing at this user; defaults to 'html' */ mention(parseMode?: 'html' | 'markdown' | 'markdownv2'): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represent a user's profile pictures. */ export declare class UserProfilePhotos { raw: TelegramUserProfilePhotos; private _photos?; constructor(raw: TelegramUserProfilePhotos); static fromPayload(raw: TelegramUserProfilePhotos): UserProfilePhotos; /** * Total number of profile pictures the target user has */ get totalCount(): number; /** * Requested profile pictures (in up to 4 sizes each) */ get photos(): Photo[]; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button. */ export declare class UsersShared { raw: TelegramUsersShared; constructor(raw: TelegramUsersShared); static fromPayload(raw: TelegramUsersShared): UsersShared; /** * Identifier of the request */ get requestId(): number; /** * Information about users shared with the bot */ get users(): TelegramSharedUser[]; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a venue. */ export declare class Venue { raw: TelegramVenue; private _location?; constructor(raw: TelegramVenue); static fromPayload(raw: TelegramVenue): Venue; /** * Venue location. Can't be a live location. */ get location(): Location; /** * Name of the venue */ get title(): string; /** * Address of the venue */ get address(): string; /** * Optional. Foursquare identifier of the venue */ get foursquareId(): string | undefined; /** * Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ get foursquareType(): string | undefined; /** * Optional. Google Places identifier of the venue */ get googlePlaceId(): string | undefined; /** * Optional. Google Places type of the venue. (See supported types.) */ get googlePlaceType(): string | undefined; /** * true if `foursquare_id` is set */ hasFoursquareId(): this is this & { foursquareId: string; }; /** * true if `foursquare_type` is set */ hasFoursquareType(): this is this & { foursquareType: string; }; /** * true if `google_place_id` is set */ hasGooglePlaceId(): this is this & { googlePlaceId: string; }; /** * true if `google_place_type` is set */ hasGooglePlaceType(): this is this & { googlePlaceType: string; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a video file. */ export declare class Video { raw: TelegramVideo; private _thumbnail?; private _cover?; private _qualities?; constructor(raw: TelegramVideo); static fromPayload(raw: TelegramVideo): Video; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Video width as defined by the sender */ get width(): number; /** * Video height as defined by the sender */ get height(): number; /** * Duration of the video in seconds as defined by the sender */ get duration(): number; /** * Optional. Video thumbnail */ get thumbnail(): PhotoSize | undefined; /** * Optional. Available sizes of the cover of the video in the message */ get cover(): Photo | undefined; /** * Optional. Timestamp in seconds from which the video will play in the message */ get startTimestamp(): number | undefined; /** * Optional. List of available qualities of the video */ get qualities(): VideoQualities | undefined; /** * Optional. Original filename as defined by the sender */ get fileName(): string | undefined; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; /** * true if `cover` has at least one item */ hasCover(): this is this & { cover: Photo; }; /** * true if `start_timestamp` is set */ hasStartTimestamp(): this is this & { startTimestamp: number; }; /** * true if `qualities` has at least one item */ hasQualities(): this is this & { qualities: VideoQualities; }; /** * true if `file_name` is set */ hasFileName(): this is this & { fileName: string; }; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about a video chat ended in the chat. */ export declare class VideoChatEnded { raw: TelegramVideoChatEnded; constructor(raw: TelegramVideoChatEnded); static fromPayload(raw: TelegramVideoChatEnded): VideoChatEnded; /** * Video chat duration in seconds */ get duration(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about new members invited to a video chat. */ export declare class VideoChatParticipantsInvited { raw: TelegramVideoChatParticipantsInvited; private _users?; constructor(raw: TelegramVideoChatParticipantsInvited); static fromPayload(raw: TelegramVideoChatParticipantsInvited): VideoChatParticipantsInvited; /** * New members that were invited to the video chat */ get users(): User[]; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a service message about a video chat scheduled in the chat. */ export declare class VideoChatScheduled { raw: TelegramVideoChatScheduled; constructor(raw: TelegramVideoChatScheduled); static fromPayload(raw: TelegramVideoChatScheduled): VideoChatScheduled; /** * Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */ get startDate(): number; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a video message. */ export declare class VideoNote { raw: TelegramVideoNote; private _thumbnail?; constructor(raw: TelegramVideoNote); static fromPayload(raw: TelegramVideoNote): VideoNote; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Video width and height (diameter of the video message) as defined by the sender */ get length(): number; /** * Duration of the video in seconds as defined by the sender */ get duration(): number; /** * Optional. Video thumbnail */ get thumbnail(): PhotoSize | undefined; /** * Optional. File size in bytes */ get fileSize(): number | undefined; /** * true if `thumbnail` is set */ hasThumbnail(): this is this & { thumbnail: PhotoSize; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a video file of a specific quality. */ export declare class VideoQuality { raw: TelegramVideoQuality; constructor(raw: TelegramVideoQuality); static fromPayload(raw: TelegramVideoQuality): VideoQuality; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Video width */ get width(): number; /** * Video height */ get height(): number; /** * Codec that was used to encode the video, for example, “h264”, “h265”, or “av01” */ get codec(): 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. */ get fileSize(): number | undefined; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * This object represents a voice note. */ export declare class Voice { raw: TelegramVoice; constructor(raw: TelegramVoice); static fromPayload(raw: TelegramVoice): Voice; /** * Identifier for this file, which can be used to download or reuse the file */ get fileId(): 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. */ get fileUniqueId(): string; /** * Duration of the audio in seconds as defined by the sender */ get duration(): number; /** * Optional. MIME type of the file as defined by the sender */ get mimeType(): string | undefined; /** * 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. */ get fileSize(): number | undefined; /** * true if `mime_type` is set */ hasMimeType(): this is this & { mimeType: string; }; /** * true if `file_size` is set */ hasFileSize(): this is this & { fileSize: number; }; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Describes data sent from a Web App to the bot. */ export declare class WebAppData { raw: TelegramWebAppData; constructor(raw: TelegramWebAppData); static fromPayload(raw: TelegramWebAppData): WebAppData; /** * The data. Be aware that a bad client can send arbitrary data in this field. */ get 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. */ get buttonText(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * Describes a Web App. */ export declare class WebAppInfo { raw: TelegramWebAppInfo; constructor(raw: TelegramWebAppInfo); static fromPayload(raw: TelegramWebAppInfo): WebAppInfo; /** * An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */ get url(): string; [INSPECT](depth: any, options: any, inspect: any): string; } /** * 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 declare class WriteAccessAllowed { raw: TelegramWriteAccessAllowed; constructor(raw: TelegramWriteAccessAllowed); static fromPayload(raw: TelegramWriteAccessAllowed): WriteAccessAllowed; /** * Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess */ get fromRequest(): boolean | undefined; /** * Optional. Name of the Web App, if the access was granted when the Web App was launched from a link */ get webAppName(): string | undefined; /** * Optional. True, if the access was granted when the bot was added to the attachment or side menu */ get fromAttachmentMenu(): boolean | undefined; /** * true if `from_request` is set */ hasFromRequest(): this is this & { fromRequest: boolean; }; /** * true if `web_app_name` is set */ hasWebAppName(): this is this & { webAppName: string; }; /** * true if `from_attachment_menu` is set */ hasFromAttachmentMenu(): this is this & { fromAttachmentMenu: boolean; }; [INSPECT](depth: any, options: any, inspect: any): string; } //# sourceMappingURL=structures.d.ts.map