Skip to main content

@smol/gram@2.3.0
Built and signed on GitHub Actions

Tiny (smol) Telegram Bot API client library with TypeScript types

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (2.3.0)

default

Main Telegram Bot API client module.

f
callTgApi

Calls a Telegram Bot API method.

f
getTgFileData

Fetches the contents of a file that you get from TgApi.getFile.

f
initTgBot

Returns a TgBot wrapped in a Proxy which allows to call methods from TgApi directly.

f
listTgUpdates

Returns an iterator over updates from the Telegram Bot API.

v
TG_API_URL

Telegram API URL.

v
TG_API_VERSION
No documentation available
T
TgAddStickerToSetParams

Parameters of TgApi.addStickerToSet method.

T
TgAnimation

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

T
TgAnswerCallbackQueryParams

Parameters of TgApi.answerCallbackQuery method.

T
TgAnswerInlineQueryParams

Parameters of TgApi.answerInlineQuery method.

T
TgAnswerPreCheckoutQueryParams

Parameters of TgApi.answerPreCheckoutQuery method.

T
TgAnswerShippingQueryParams

Parameters of TgApi.answerShippingQuery method.

T
TgAnswerWebAppQueryParams

Parameters of TgApi.answerWebAppQuery method.

I
TgApi
No documentation available
I
TgApiOptions

Options for callTgApi.

T
TgApproveChatJoinRequestParams

Parameters of TgApi.approveChatJoinRequest method.

T
TgAudio

This object represents an audio file to be treated as music by the Telegram clients.

T
TgBackgroundFill

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

T
TgBackgroundFillFreeformGradient

The background is a freeform gradient that rotates after every message in the chat.

T
TgBackgroundFillGradient

The background is a gradient fill.

T
TgBackgroundFillSolid

The background is filled using the selected color.

T
TgBackgroundType

This object describes the type of a background. Currently, it can be one of

T
TgBackgroundTypeChatTheme

The background is taken directly from a built-in chat theme.

T
TgBackgroundTypeFill

The background is automatically filled based on the selected colors.

T
TgBackgroundTypePattern

The background is a PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user.

T
TgBackgroundTypeWallpaper

The background is a wallpaper in the JPEG format.

T
TgBanChatMemberParams

Parameters of TgApi.banChatMember method.

T
TgBanChatSenderChatParams

Parameters of TgApi.banChatSenderChat method.

T
TgBirthdate

Describes the birthdate of a user.

c
TgBot

Wraps callTgApi and other functions into a single easy-to-use class.

T
TgBotCommand

This object represents a bot command.

T
TgBotCommandScope

This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:

T
TgBotCommandScopeAllChatAdministrators

Represents the scope of bot commands, covering all group and supergroup chat administrators.

T
TgBotCommandScopeAllGroupChats

Represents the scope of bot commands, covering all group and supergroup chats.

T
TgBotCommandScopeAllPrivateChats

Represents the scope of bot commands, covering all private chats.

T
TgBotCommandScopeChat

Represents the scope of bot commands, covering a specific chat.

T
TgBotCommandScopeChatAdministrators

Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

T
TgBotCommandScopeChatMember

Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

T
TgBotCommandScopeDefault

Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.

I
TgBotConfig

TgBot config.

T
TgBotDescription

This object represents the bot's description.

T
TgBotName

This object represents the bot's name.

T
TgBotShortDescription

This object represents the bot's short description.

T
TgBusinessConnection

Describes the connection of the bot with a business account.

T
TgBusinessIntro

Contains information about the start page settings of a Telegram Business account.

T
TgBusinessLocation

Contains information about the location of a Telegram Business account.

T
TgBusinessMessagesDeleted

This object is received when messages are deleted from a connected business account.

T
TgBusinessOpeningHours

Describes the opening hours of a business.

T
TgBusinessOpeningHoursInterval

Describes an interval of time during which a business is open.

T
TgCallbackGame

A placeholder, currently holds no information. Use BotFather to set up your game.

T
TgCallbackQuery

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

T
TgChat

This object represents a chat.

T
TgChatAdministratorRights

Represents the rights of an administrator in a chat.

T
TgChatBackground

This object represents a chat background.

T
TgChatBoost

This object contains information about a chat boost.

T
TgChatBoostAdded

This object represents a service message about a user boosting a chat.

T
TgChatBoostRemoved

This object represents a boost removed from a chat.

T
TgChatBoostSource

This object describes the source of a chat boost. It can be one of

T
TgChatBoostSourceGiftCode

The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

T
TgChatBoostSourceGiveaway

The boost was obtained by the creation of a Telegram Premium giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

T
TgChatBoostSourcePremium

The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

T
TgChatBoostUpdated

This object represents a boost added to a chat or changed.

T
TgChatFullInfo

This object contains full information about a chat.

T
TgChatJoinRequest

Represents a join request sent to a chat.

T
TgChatLocation

Represents a location to which a chat is connected.

T
TgChatMember

This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

T
TgChatMemberAdministrator

Represents a chat member that has some additional privileges.

T
TgChatMemberBanned

Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.

T
TgChatMemberLeft

Represents a chat member that isn't currently a member of the chat, but may join it themselves.

T
TgChatMemberMember

Represents a chat member that has no additional privileges or restrictions.

T
TgChatMemberOwner

Represents a chat member that owns the chat and has all administrator privileges.

T
TgChatMemberRestricted

Represents a chat member that is under certain restrictions in the chat. Supergroups only.

T
TgChatMemberUpdated

This object represents changes in the status of a chat member.

T
TgChatPermissions

Describes actions that a non-administrator user is allowed to take in a chat.

T
TgChatPhoto

This object represents a chat photo.

T
TgChatShared

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

T
TgChosenInlineResult

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

T
TgCloseForumTopicParams

Parameters of TgApi.closeForumTopic method.

T
TgCloseGeneralForumTopicParams

Parameters of TgApi.closeGeneralForumTopic method.

T
TgContact

This object represents a phone contact.

T
TgCopyMessageParams

Parameters of TgApi.copyMessage method.

T
TgCopyMessagesParams

Parameters of TgApi.copyMessages method.

T
TgCreateChatInviteLinkParams

Parameters of TgApi.createChatInviteLink method.

T
TgCreateForumTopicParams

Parameters of TgApi.createForumTopic method.

T
TgCreateInvoiceLinkParams

Parameters of TgApi.createInvoiceLink method.

T
TgCreateNewStickerSetParams

Parameters of TgApi.createNewStickerSet method.

T
TgDeclineChatJoinRequestParams

Parameters of TgApi.declineChatJoinRequest method.

T
TgDeleteChatPhotoParams

Parameters of TgApi.deleteChatPhoto method.

T
TgDeleteChatStickerSetParams

Parameters of TgApi.deleteChatStickerSet method.

T
TgDeleteForumTopicParams

Parameters of TgApi.deleteForumTopic method.

T
TgDeleteMessageParams

Parameters of TgApi.deleteMessage method.

T
TgDeleteMessagesParams

Parameters of TgApi.deleteMessages method.

T
TgDeleteMyCommandsParams

Parameters of TgApi.deleteMyCommands method.

T
TgDeleteStickerFromSetParams

Parameters of TgApi.deleteStickerFromSet method.

T
TgDeleteStickerSetParams

Parameters of TgApi.deleteStickerSet method.

T
TgDeleteWebhookParams

Parameters of TgApi.deleteWebhook method.

T
TgDice

This object represents an animated emoji that displays a random value.

T
TgDocument

This object represents a general file (as opposed to photos, voice messages and audio files).

T
TgEditChatInviteLinkParams

Parameters of TgApi.editChatInviteLink method.

T
TgEditForumTopicParams

Parameters of TgApi.editForumTopic method.

T
TgEditGeneralForumTopicParams

Parameters of TgApi.editGeneralForumTopic method.

T
TgEditMessageCaptionParams

Parameters of TgApi.editMessageCaption method.

T
TgEditMessageLiveLocationParams

Parameters of TgApi.editMessageLiveLocation method.

T
TgEditMessageMediaParams

Parameters of TgApi.editMessageMedia method.

T
TgEditMessageReplyMarkupParams

Parameters of TgApi.editMessageReplyMarkup method.

T
TgEditMessageTextParams

Parameters of TgApi.editMessageText method.

T
TgEncryptedCredentials

Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

T
TgEncryptedPassportElement

Describes documents or other Telegram Passport elements shared with the bot by the user.

c
TgError

Error returned from the Telegram Bot API.

T
TgExportChatInviteLinkParams

Parameters of TgApi.exportChatInviteLink method.

T
TgExternalReplyInfo

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

T
TgFile

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

T
TgForceReply

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a Telegram Business account.

T
TgForumTopic

This object represents a forum topic.

T
TgForumTopicClosed

This object represents a service message about a forum topic closed in the chat. Currently holds no information.

T
TgForumTopicCreated

This object represents a service message about a new forum topic created in the chat.

T
TgForumTopicEdited

This object represents a service message about an edited forum topic.

T
TgForumTopicReopened

This object represents a service message about a forum topic reopened in the chat. Currently holds no information.

T
TgForwardMessageParams

Parameters of TgApi.forwardMessage method.

T
TgForwardMessagesParams

Parameters of TgApi.forwardMessages method.

T
TgGame

This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

T
TgGameHighScore

This object represents one row of the high scores table for a game.

T
TgGeneralForumTopicHidden

This object represents a service message about General forum topic hidden in the chat. Currently holds no information.

T
TgGeneralForumTopicUnhidden

This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.

T
TgGetBusinessConnectionParams

Parameters of TgApi.getBusinessConnection method.

T
TgGetChatAdministratorsParams

Parameters of TgApi.getChatAdministrators method.

T
TgGetChatMemberCountParams

Parameters of TgApi.getChatMemberCount method.

T
TgGetChatMemberParams

Parameters of TgApi.getChatMember method.

T
TgGetChatMenuButtonParams

Parameters of TgApi.getChatMenuButton method.

T
TgGetChatParams

Parameters of TgApi.getChat method.

T
TgGetCustomEmojiStickersParams

Parameters of TgApi.getCustomEmojiStickers method.

T
TgGetFileParams

Parameters of TgApi.getFile method.

T
TgGetGameHighScoresParams

Parameters of TgApi.getGameHighScores method.

T
TgGetMyCommandsParams

Parameters of TgApi.getMyCommands method.

T
TgGetMyDefaultAdministratorRightsParams

Parameters of TgApi.getMyDefaultAdministratorRights method.

T
TgGetMyDescriptionParams

Parameters of TgApi.getMyDescription method.

T
TgGetMyNameParams

Parameters of TgApi.getMyName method.

T
TgGetMyShortDescriptionParams

Parameters of TgApi.getMyShortDescription method.

T
TgGetStarTransactionsParams

Parameters of TgApi.getStarTransactions method.

T
TgGetStickerSetParams

Parameters of TgApi.getStickerSet method.

T
TgGetUpdatesParams

Parameters of TgApi.getUpdates method.

T
TgGetUserChatBoostsParams

Parameters of TgApi.getUserChatBoosts method.

T
TgGetUserProfilePhotosParams

Parameters of TgApi.getUserProfilePhotos method.

T
TgGiveaway

This object represents a message about a scheduled giveaway.

T
TgGiveawayCompleted

This object represents a service message about the completion of a giveaway without public winners.

T
TgGiveawayCreated

This object represents a service message about the creation of a scheduled giveaway. Currently holds no information.

T
TgGiveawayWinners

This object represents a message about the completion of a giveaway with public winners.

T
TgHideGeneralForumTopicParams

Parameters of TgApi.hideGeneralForumTopic method.

T
TgInaccessibleMessage

This object describes a message that was deleted or is otherwise inaccessible to the bot.

T
TgInlineKeyboardButton

This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.

T
TgInlineKeyboardMarkup

This object represents an inline keyboard that appears right next to the message it belongs to.

T
TgInlineQuery

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

T
TgInlineQueryResult

This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

T
TgInlineQueryResultArticle

Represents a link to an article or web page.

T
TgInlineQueryResultAudio

Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

T
TgInlineQueryResultCachedAudio

Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

T
TgInlineQueryResultCachedDocument

Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

T
TgInlineQueryResultCachedGif

Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

T
TgInlineQueryResultCachedMpeg4Gif

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

T
TgInlineQueryResultCachedPhoto

Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

T
TgInlineQueryResultCachedSticker

Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

T
TgInlineQueryResultCachedVideo

Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

T
TgInlineQueryResultCachedVoice

Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

T
TgInlineQueryResultContact

Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

T
TgInlineQueryResultDocument

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

T
TgInlineQueryResultGame

Represents a Game.

T
TgInlineQueryResultGif

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

T
TgInlineQueryResultLocation

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

T
TgInlineQueryResultMpeg4Gif

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

T
TgInlineQueryResultPhoto

Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

T
TgInlineQueryResultsButton

This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.

T
TgInlineQueryResultVenue

Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

T
TgInlineQueryResultVideo

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

T
TgInlineQueryResultVoice

Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

T
TgInputContactMessageContent

Represents the content of a contact message to be sent as the result of an inline query.

T
TgInputFile

This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

T
TgInputInvoiceMessageContent

Represents the content of an invoice message to be sent as the result of an inline query.

T
TgInputLocationMessageContent

Represents the content of a location message to be sent as the result of an inline query.

T
TgInputMedia

This object represents the content of a media message to be sent. It should be one of

T
TgInputMediaAnimation

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

T
TgInputMediaAudio

Represents an audio file to be treated as music to be sent.

T
TgInputMediaDocument

Represents a general file to be sent.

T
TgInputMediaPhoto

Represents a photo to be sent.

T
TgInputMediaVideo

Represents a video to be sent.

T
TgInputMessageContent

This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

T
TgInputPaidMedia

This object describes the paid media to be sent. Currently, it can be one of

T
TgInputPaidMediaPhoto

The paid media to send is a photo.

T
TgInputPaidMediaVideo

The paid media to send is a video.

T
TgInputPollOption

This object contains information about one answer option in a poll to be sent.

T
TgInputSticker

This object describes a sticker to be added to a sticker set.

T
TgInputTextMessageContent

Represents the content of a text message to be sent as the result of an inline query.

T
TgInputVenueMessageContent

Represents the content of a venue message to be sent as the result of an inline query.

T
TgInvoice

This object contains basic information about an invoice.

T
TgKeyboardButton

This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

T
TgKeyboardButtonPollType

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

T
TgKeyboardButtonRequestChat

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate. More about requesting chats: https://core.telegram.org/bots/features#chat-and-user-selection.

T
TgKeyboardButtonRequestUsers

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users: https://core.telegram.org/bots/features#chat-and-user-selection

T
TgLabeledPrice

This object represents a portion of the price for goods or services.

T
TgLeaveChatParams

Parameters of TgApi.leaveChat method.

T
TgLinkPreviewOptions

Describes the options used for link preview generation.

T
TgLocation

This object represents a point on the map.

T
TgLoginUrl

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:

T
TgMaskPosition

This object describes the position on faces where a mask should be placed by default.

T
TgMaybeInaccessibleMessage

This object describes a message that can be inaccessible to the bot. It can be one of

T
TgMenuButton

This object describes the bot's menu button in a private chat. It should be one of

T
TgMenuButtonCommands

Represents a menu button, which opens the bot's list of commands.

T
TgMenuButtonDefault

Describes that no specific value for the menu button was set.

T
TgMenuButtonWebApp

Represents a menu button, which launches a Web App.

T
TgMessage

This object represents a message.

T
TgMessageAutoDeleteTimerChanged

This object represents a service message about a change in auto-delete timer settings.

T
TgMessageEntity

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

T
TgMessageId

This object represents a unique message identifier.

T
TgMessageOrigin

This object describes the origin of a message. It can be one of

T
TgMessageOriginChannel

The message was originally sent to a channel chat.

T
TgMessageOriginChat

The message was originally sent on behalf of a chat to a group chat.

T
TgMessageOriginHiddenUser

The message was originally sent by an unknown user.

T
TgMessageOriginUser

The message was originally sent by a known user.

T
TgMessageReactionCountUpdated

This object represents reaction changes on a message with anonymous reactions.

T
TgMessageReactionUpdated

This object represents a change of a reaction on a message performed by a user.

T
TgOrderInfo

This object represents information about an order.

T
TgPaidMedia

This object describes paid media. Currently, it can be one of

T
TgPaidMediaInfo

Describes the paid media added to a message.

T
TgPaidMediaPhoto

The paid media is a photo.

T
TgPaidMediaPreview

The paid media isn't available before the payment.

T
TgPaidMediaVideo

The paid media is a video.

T
TgPassportData

Describes Telegram Passport data shared with the bot by the user.

T
TgPassportElementError

This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

T
TgPassportElementErrorDataField

Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.

T
TgPassportElementErrorFile

Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

T
TgPassportElementErrorFiles

Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

T
TgPassportElementErrorFrontSide

Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.

T
TgPassportElementErrorReverseSide

Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.

T
TgPassportElementErrorSelfie

Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

T
TgPassportElementErrorTranslationFile

Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

T
TgPassportElementErrorTranslationFiles

Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.

T
TgPassportElementErrorUnspecified

Represents an issue in an unspecified place. The error is considered resolved when new data is added.

T
TgPassportFile

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

T
TgPhotoSize

This object represents one size of a photo or a file / sticker thumbnail.

T
TgPinChatMessageParams

Parameters of TgApi.pinChatMessage method.

T
TgPoll

This object contains information about a poll.

T
TgPollAnswer

This object represents an answer of a user in a non-anonymous poll.

T
TgPollOption

This object contains information about one answer option in a poll.

T
TgPreCheckoutQuery

This object contains information about an incoming pre-checkout query.

T
TgPromoteChatMemberParams

Parameters of TgApi.promoteChatMember method.

T
TgProximityAlertTriggered

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

T
TgReactionCount

Represents a reaction added to a message along with the number of times it was added.

T
TgReactionType

This object describes the type of a reaction. Currently, it can be one of

T
TgReactionTypeCustomEmoji

The reaction is based on a custom emoji.

T
TgReactionTypeEmoji

The reaction is based on an emoji.

T
TgRefundedPayment

This object contains basic information about a refunded payment.

T
TgRefundStarPaymentParams

Parameters of TgApi.refundStarPayment method.

T
TgReopenForumTopicParams

Parameters of TgApi.reopenForumTopic method.

T
TgReopenGeneralForumTopicParams

Parameters of TgApi.reopenGeneralForumTopic method.

T
TgReplaceStickerInSetParams

Parameters of TgApi.replaceStickerInSet method.

T
TgReplyKeyboardMarkup

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.

T
TgReplyKeyboardRemove

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a Telegram Business account.

T
TgReplyParameters

Describes reply parameters for the message that is being sent.

T
TgResponseParameters

Describes why a request was unsuccessful.

T
TgRestrictChatMemberParams

Parameters of TgApi.restrictChatMember method.

T
TgRevenueWithdrawalState

This object describes the state of a revenue withdrawal operation. Currently, it can be one of

T
TgRevenueWithdrawalStateFailed

The withdrawal failed and the transaction was refunded.

T
TgRevenueWithdrawalStatePending

The withdrawal is in progress.

T
TgRevenueWithdrawalStateSucceeded

The withdrawal succeeded.

T
TgRevokeChatInviteLinkParams

Parameters of TgApi.revokeChatInviteLink method.

T
TgSendAnimationParams

Parameters of TgApi.sendAnimation method.

T
TgSendAudioParams

Parameters of TgApi.sendAudio method.

T
TgSendChatActionParams

Parameters of TgApi.sendChatAction method.

T
TgSendContactParams

Parameters of TgApi.sendContact method.

T
TgSendDiceParams

Parameters of TgApi.sendDice method.

T
TgSendDocumentParams

Parameters of TgApi.sendDocument method.

T
TgSendGameParams

Parameters of TgApi.sendGame method.

T
TgSendInvoiceParams

Parameters of TgApi.sendInvoice method.

T
TgSendLocationParams

Parameters of TgApi.sendLocation method.

T
TgSendMediaGroupParams

Parameters of TgApi.sendMediaGroup method.

T
TgSendMessageParams

Parameters of TgApi.sendMessage method.

T
TgSendPaidMediaParams

Parameters of TgApi.sendPaidMedia method.

T
TgSendPhotoParams

Parameters of TgApi.sendPhoto method.

T
TgSendPollParams

Parameters of TgApi.sendPoll method.

T
TgSendStickerParams

Parameters of TgApi.sendSticker method.

T
TgSendVenueParams

Parameters of TgApi.sendVenue method.

T
TgSendVideoNoteParams

Parameters of TgApi.sendVideoNote method.

T
TgSendVideoParams

Parameters of TgApi.sendVideo method.

T
TgSendVoiceParams

Parameters of TgApi.sendVoice method.

T
TgSentWebAppMessage

Describes an inline message sent by a Web App on behalf of a user.

T
TgSetChatAdministratorCustomTitleParams

Parameters of TgApi.setChatAdministratorCustomTitle method.

T
TgSetChatDescriptionParams

Parameters of TgApi.setChatDescription method.

T
TgSetChatMenuButtonParams

Parameters of TgApi.setChatMenuButton method.

T
TgSetChatPermissionsParams

Parameters of TgApi.setChatPermissions method.

T
TgSetChatPhotoParams

Parameters of TgApi.setChatPhoto method.

T
TgSetChatStickerSetParams

Parameters of TgApi.setChatStickerSet method.

T
TgSetChatTitleParams

Parameters of TgApi.setChatTitle method.

T
TgSetCustomEmojiStickerSetThumbnailParams

Parameters of TgApi.setCustomEmojiStickerSetThumbnail method.

T
TgSetGameScoreParams

Parameters of TgApi.setGameScore method.

T
TgSetMessageReactionParams

Parameters of TgApi.setMessageReaction method.

T
TgSetMyCommandsParams

Parameters of TgApi.setMyCommands method.

T
TgSetMyDefaultAdministratorRightsParams

Parameters of TgApi.setMyDefaultAdministratorRights method.

T
TgSetMyDescriptionParams

Parameters of TgApi.setMyDescription method.

T
TgSetMyNameParams

Parameters of TgApi.setMyName method.

T
TgSetMyShortDescriptionParams

Parameters of TgApi.setMyShortDescription method.

T
TgSetPassportDataErrorsParams

Parameters of TgApi.setPassportDataErrors method.

T
TgSetStickerEmojiListParams

Parameters of TgApi.setStickerEmojiList method.

T
TgSetStickerKeywordsParams

Parameters of TgApi.setStickerKeywords method.

T
TgSetStickerMaskPositionParams

Parameters of TgApi.setStickerMaskPosition method.

T
TgSetStickerPositionInSetParams

Parameters of TgApi.setStickerPositionInSet method.

T
TgSetStickerSetThumbnailParams

Parameters of TgApi.setStickerSetThumbnail method.

T
TgSetStickerSetTitleParams

Parameters of TgApi.setStickerSetTitle method.

T
TgSetWebhookParams

Parameters of TgApi.setWebhook method.

T
TgSharedUser

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

T
TgShippingAddress

This object represents a shipping address.

T
TgShippingOption

This object represents one shipping option.

T
TgShippingQuery

This object contains information about an incoming shipping query.

T
TgStarTransaction

Describes a Telegram Star transaction.

T
TgStarTransactions

Contains a list of Telegram Star transactions.

T
TgSticker

This object represents a sticker.

T
TgStickerSet

This object represents a sticker set.

T
TgStopMessageLiveLocationParams

Parameters of TgApi.stopMessageLiveLocation method.

T
TgStopPollParams

Parameters of TgApi.stopPoll method.

T
TgStory

This object represents a story.

T
TgSuccessfulPayment

This object contains basic information about a successful payment.

T
TgSwitchInlineQueryChosenChat

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

T
TgTextQuote

This object contains information about the quoted part of a message that is replied to by the given message.

T
TgTransactionPartner

This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of

T
TgTransactionPartnerFragment

Describes a withdrawal transaction with Fragment.

T
TgTransactionPartnerOther

Describes a transaction with an unknown source or recipient.

T
TgTransactionPartnerTelegramAds

Describes a withdrawal transaction to the Telegram Ads platform.

T
TgTransactionPartnerUser

Describes a transaction with a user.

T
TgUnbanChatMemberParams

Parameters of TgApi.unbanChatMember method.

T
TgUnbanChatSenderChatParams

Parameters of TgApi.unbanChatSenderChat method.

T
TgUnhideGeneralForumTopicParams

Parameters of TgApi.unhideGeneralForumTopic method.

T
TgUnpinAllChatMessagesParams

Parameters of TgApi.unpinAllChatMessages method.

T
TgUnpinAllForumTopicMessagesParams

Parameters of TgApi.unpinAllForumTopicMessages method.

T
TgUnpinAllGeneralForumTopicMessagesParams

Parameters of TgApi.unpinAllGeneralForumTopicMessages method.

T
TgUnpinChatMessageParams

Parameters of TgApi.unpinChatMessage method.

T
TgUpdate

This object represents an incoming update.

T
TgUploadStickerFileParams

Parameters of TgApi.uploadStickerFile method.

T
TgUser

This object represents a Telegram user or bot.

T
TgUserChatBoosts

This object represents a list of boosts added to a chat by a user.

T
TgUserProfilePhotos

This object represent a user's profile pictures.

T
TgUsersShared

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

T
TgVenue

This object represents a venue.

T
TgVideo

This object represents a video file.

T
TgVideoChatEnded

This object represents a service message about a video chat ended in the chat.

T
TgVideoChatParticipantsInvited

This object represents a service message about new members invited to a video chat.

T
TgVideoChatScheduled

This object represents a service message about a video chat scheduled in the chat.

T
TgVideoChatStarted

This object represents a service message about a video chat started in the chat. Currently holds no information.

T
TgVideoNote

This object represents a video message (available in Telegram apps as of v.4.0).

T
TgVoice

This object represents a voice note.

T
TgWebAppData

Describes data sent from a Web App to the bot.

T
TgWebAppInfo

Describes a Web App.

T
TgWebhookInfo

Describes the current status of a webhook.

T
TgWriteAccessAllowed

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.