Skip to content

GramIO API Reference / gramio/dist

gramio/dist

Namespaces

NamespaceDescription
HooksNamespace with GramIO hooks types
This module contains [Objects](https://core.telegram.org/bots/api#available-types) with the `Telegram` prefix-
This module contains params for [methods](https://core.telegram.org/bots/api#available-methods) with the `Params` postfix-

Classes

ClassDescription
BotBot instance
FormattableStringClass-helper for work with formattable entities
PluginPlugin is an object from which you can extends in Bot instance and adopt types
TelegramErrorRepresent TelegramAPIResponseError and thrown in API calls
Updates-

Interfaces

InterfaceDescription
AddStickerToSetParamsParams object for addStickerToSet method
AnswerCallbackQueryParamsParams object for answerCallbackQuery method
AnswerInlineQueryParamsParams object for answerInlineQuery method
AnswerPreCheckoutQueryParamsParams object for answerPreCheckoutQuery method
AnswerShippingQueryParamsParams object for answerShippingQuery method
AnswerWebAppQueryParamsParams object for answerWebAppQuery method
APIMethodsThis object is a map of API methods types (functions map with input/output)
ApproveChatJoinRequestParamsParams object for approveChatJoinRequest method
ApproveSuggestedPostParamsParams object for approveSuggestedPost method
BanChatMemberParamsParams object for banChatMember method
BanChatSenderChatParamsParams object for banChatSenderChat method
BotOptionsBot options that you can provide to Bot constructor
BotStartOptions-
CloseForumTopicParamsParams object for closeForumTopic method
CloseGeneralForumTopicParamsParams object for closeGeneralForumTopic method
ConvertGiftToStarsParamsParams object for convertGiftToStars method
CopyMessageParamsParams object for copyMessage method
CopyMessagesParamsParams object for copyMessages method
CreateChatInviteLinkParamsParams object for createChatInviteLink method
CreateChatSubscriptionInviteLinkParamsParams object for createChatSubscriptionInviteLink method
CreateForumTopicParamsParams object for createForumTopic method
CreateInvoiceLinkParamsParams object for createInvoiceLink method
CreateNewStickerSetParamsParams object for createNewStickerSet method
DeclineChatJoinRequestParamsParams object for declineChatJoinRequest method
DeclineSuggestedPostParamsParams object for declineSuggestedPost method
DeleteBusinessMessagesParamsParams object for deleteBusinessMessages method
DeleteChatPhotoParamsParams object for deleteChatPhoto method
DeleteChatStickerSetParamsParams object for deleteChatStickerSet method
DeleteForumTopicParamsParams object for deleteForumTopic method
DeleteMessageParamsParams object for deleteMessage method
DeleteMessagesParamsParams object for deleteMessages method
DeleteMyCommandsParamsParams object for deleteMyCommands method
DeleteStickerFromSetParamsParams object for deleteStickerFromSet method
DeleteStickerSetParamsParams object for deleteStickerSet method
DeleteStoryParamsParams object for deleteStory method
DeleteWebhookParamsParams object for deleteWebhook method
EditChatInviteLinkParamsParams object for editChatInviteLink method
EditChatSubscriptionInviteLinkParamsParams object for editChatSubscriptionInviteLink method
EditForumTopicParamsParams object for editForumTopic method
EditGeneralForumTopicParamsParams object for editGeneralForumTopic method
EditMessageCaptionParamsParams object for editMessageCaption method
EditMessageChecklistParamsParams object for editMessageChecklist method
EditMessageLiveLocationParamsParams object for editMessageLiveLocation method
EditMessageMediaParamsParams object for editMessageMedia method
EditMessageReplyMarkupParamsParams object for editMessageReplyMarkup method
EditMessageTextParamsParams object for editMessageText method
EditStoryParamsParams object for editStory method
EditUserStarSubscriptionParamsParams object for editUserStarSubscription method
ExportChatInviteLinkParamsParams object for exportChatInviteLink method
ForwardMessageParamsParams object for forwardMessage method
ForwardMessagesParamsParams object for forwardMessages method
GetBusinessAccountGiftsParamsParams object for getBusinessAccountGifts method
GetBusinessAccountStarBalanceParamsParams object for getBusinessAccountStarBalance method
GetBusinessConnectionParamsParams object for getBusinessConnection method
GetChatAdministratorsParamsParams object for getChatAdministrators method
GetChatGiftsParamsParams object for getChatGifts method
GetChatMemberCountParamsParams object for getChatMemberCount method
GetChatMemberParamsParams object for getChatMember method
GetChatMenuButtonParamsParams object for getChatMenuButton method
GetChatParamsParams object for getChat method
GetCustomEmojiStickersParamsParams object for getCustomEmojiStickers method
GetFileParamsParams object for getFile method
GetGameHighScoresParamsParams object for getGameHighScores method
GetMyCommandsParamsParams object for getMyCommands method
GetMyDefaultAdministratorRightsParamsParams object for getMyDefaultAdministratorRights method
GetMyDescriptionParamsParams object for getMyDescription method
GetMyNameParamsParams object for getMyName method
GetMyShortDescriptionParamsParams object for getMyShortDescription method
GetStarTransactionsParamsParams object for getStarTransactions method
GetStickerSetParamsParams object for getStickerSet method
GetUpdatesParamsParams object for getUpdates method
GetUserChatBoostsParamsParams object for getUserChatBoosts method
GetUserGiftsParamsParams object for getUserGifts method
GetUserProfileAudiosParamsParams object for getUserProfileAudios method
GetUserProfilePhotosParamsParams object for getUserProfilePhotos method
GiftPremiumSubscriptionParamsParams object for giftPremiumSubscription method
HideGeneralForumTopicParamsParams object for hideGeneralForumTopic method
LeaveChatParamsParams object for leaveChat method
PinChatMessageParamsParams object for pinChatMessage method
PollingStartOptions-
PostStoryParamsParams object for postStory method
PromoteChatMemberParamsParams object for promoteChatMember method
ReadBusinessMessageParamsParams object for readBusinessMessage method
RefundStarPaymentParamsParams object for refundStarPayment method
RemoveBusinessAccountProfilePhotoParamsParams object for removeBusinessAccountProfilePhoto method
RemoveChatVerificationParamsParams object for removeChatVerification method
RemoveUserVerificationParamsParams object for removeUserVerification method
ReopenForumTopicParamsParams object for reopenForumTopic method
ReopenGeneralForumTopicParamsParams object for reopenGeneralForumTopic method
ReplaceStickerInSetParamsParams object for replaceStickerInSet method
RepostStoryParamsParams object for repostStory method
RestrictChatMemberParamsParams object for restrictChatMember method
RevokeChatInviteLinkParamsParams object for revokeChatInviteLink method
SavePreparedInlineMessageParamsParams object for savePreparedInlineMessage method
SendAnimationParamsParams object for sendAnimation method
SendAudioParamsParams object for sendAudio method
SendChatActionParamsParams object for sendChatAction method
SendChecklistParamsParams object for sendChecklist method
SendContactParamsParams object for sendContact method
SendDiceParamsParams object for sendDice method
SendDocumentParamsParams object for sendDocument method
SendGameParamsParams object for sendGame method
SendGiftParamsParams object for sendGift method
SendInvoiceParamsParams object for sendInvoice method
SendLocationParamsParams object for sendLocation method
SendMediaGroupParamsParams object for sendMediaGroup method
SendMessageDraftParamsParams object for sendMessageDraft method
SendMessageParamsParams object for sendMessage method
SendPaidMediaParamsParams object for sendPaidMedia method
SendPhotoParamsParams object for sendPhoto method
SendPollParamsParams object for sendPoll method
SendStickerParamsParams object for sendSticker method
SendVenueParamsParams object for sendVenue method
SendVideoNoteParamsParams object for sendVideoNote method
SendVideoParamsParams object for sendVideo method
SendVoiceParamsParams object for sendVoice method
SetBusinessAccountBioParamsParams object for setBusinessAccountBio method
SetBusinessAccountGiftSettingsParamsParams object for setBusinessAccountGiftSettings method
SetBusinessAccountNameParamsParams object for setBusinessAccountName method
SetBusinessAccountProfilePhotoParamsParams object for setBusinessAccountProfilePhoto method
SetBusinessAccountUsernameParamsParams object for setBusinessAccountUsername method
SetChatAdministratorCustomTitleParamsParams object for setChatAdministratorCustomTitle method
SetChatDescriptionParamsParams object for setChatDescription method
SetChatMemberTagParamsParams object for setChatMemberTag method
SetChatMenuButtonParamsParams object for setChatMenuButton method
SetChatPermissionsParamsParams object for setChatPermissions method
SetChatPhotoParamsParams object for setChatPhoto method
SetChatStickerSetParamsParams object for setChatStickerSet method
SetChatTitleParamsParams object for setChatTitle method
SetCustomEmojiStickerSetThumbnailParamsParams object for setCustomEmojiStickerSetThumbnail method
SetGameScoreParamsParams object for setGameScore method
SetMessageReactionParamsParams object for setMessageReaction method
SetMyCommandsParamsParams object for setMyCommands method
SetMyDefaultAdministratorRightsParamsParams object for setMyDefaultAdministratorRights method
SetMyDescriptionParamsParams object for setMyDescription method
SetMyNameParamsParams object for setMyName method
SetMyProfilePhotoParamsParams object for setMyProfilePhoto method
SetMyShortDescriptionParamsParams object for setMyShortDescription method
SetPassportDataErrorsParamsParams object for setPassportDataErrors method
SetStickerEmojiListParamsParams object for setStickerEmojiList method
SetStickerKeywordsParamsParams object for setStickerKeywords method
SetStickerMaskPositionParamsParams object for setStickerMaskPosition method
SetStickerPositionInSetParamsParams object for setStickerPositionInSet method
SetStickerSetThumbnailParamsParams object for setStickerSetThumbnail method
SetStickerSetTitleParamsParams object for setStickerSetTitle method
SetUserEmojiStatusParamsParams object for setUserEmojiStatus method
SetWebhookParamsParams object for setWebhook method
StopMessageLiveLocationParamsParams object for stopMessageLiveLocation method
StopPollParamsParams object for stopPoll method
SuppressInterface for add suppress param to params
TelegramAcceptedGiftTypesThis object describes the types of gifts that can be gifted to a user or a chat.
TelegramAffiliateInfoContains information about the affiliate that received a commission via this transaction.
TelegramAnimationThis object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
TelegramAPIResponseErrorIn case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'.
TelegramAPIResponseOkIf 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field.
TelegramAudioThis object represents an audio file to be treated as music by the Telegram clients.
TelegramBackgroundFillFreeformGradientThe background is a freeform gradient that rotates after every message in the chat.
TelegramBackgroundFillGradientThe background is a gradient fill.
TelegramBackgroundFillSolidThe background is filled using the selected color.
TelegramBackgroundTypeChatThemeThe background is taken directly from a built-in chat theme.
TelegramBackgroundTypeFillThe background is automatically filled based on the selected colors.
TelegramBackgroundTypePatternThe 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.
TelegramBackgroundTypeWallpaperThe background is a wallpaper in the JPEG format.
TelegramBirthdateDescribes the birthdate of a user.
TelegramBotCommandThis object represents a bot command.
TelegramBotCommandScopeAllChatAdministratorsRepresents the scope of bot commands, covering all group and supergroup chat administrators.
TelegramBotCommandScopeAllGroupChatsRepresents the scope of bot commands, covering all group and supergroup chats.
TelegramBotCommandScopeAllPrivateChatsRepresents the scope of bot commands, covering all private chats.
TelegramBotCommandScopeChatRepresents the scope of bot commands, covering a specific chat.
TelegramBotCommandScopeChatAdministratorsRepresents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
TelegramBotCommandScopeChatMemberRepresents the scope of bot commands, covering a specific member of a group or supergroup chat.
TelegramBotCommandScopeDefaultRepresents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
TelegramBotDescriptionThis object represents the bot's description.
TelegramBotNameThis object represents the bot's name.
TelegramBotShortDescriptionThis object represents the bot's short description.
TelegramBusinessBotRightsRepresents the rights of a business bot.
TelegramBusinessConnectionDescribes the connection of the bot with a business account.
TelegramBusinessIntroContains information about the start page settings of a Telegram Business account.
TelegramBusinessLocationContains information about the location of a Telegram Business account.
TelegramBusinessMessagesDeletedThis object is received when messages are deleted from a connected business account.
TelegramBusinessOpeningHoursDescribes the opening hours of a business.
TelegramBusinessOpeningHoursIntervalDescribes an interval of time during which a business is open.
TelegramCallbackGameA placeholder, currently holds no information. Use BotFather to set up your game.
TelegramCallbackQueryThis 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.
TelegramChatThis object represents a chat.
TelegramChatAdministratorRightsRepresents the rights of an administrator in a chat.
TelegramChatBackgroundThis object represents a chat background.
TelegramChatBoostThis object contains information about a chat boost.
TelegramChatBoostAddedThis object represents a service message about a user boosting a chat.
TelegramChatBoostRemovedThis object represents a boost removed from a chat.
TelegramChatBoostSourceGiftCodeThe 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.
TelegramChatBoostSourceGiveawayThe boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
TelegramChatBoostSourcePremiumThe boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
TelegramChatBoostUpdatedThis object represents a boost added to a chat or changed.
TelegramChatFullInfoThis object contains full information about a chat.
TelegramChatInviteLinkRepresents an invite link for a chat.
TelegramChatJoinRequestRepresents a join request sent to a chat.
TelegramChatLocationRepresents a location to which a chat is connected.
TelegramChatMemberAdministratorRepresents a chat member that has some additional privileges.
TelegramChatMemberBannedRepresents a chat member that was banned in the chat and can't return to the chat or view chat messages.
TelegramChatMemberLeftRepresents a chat member that isn't currently a member of the chat, but may join it themselves.
TelegramChatMemberMemberRepresents a chat member that has no additional privileges or restrictions.
TelegramChatMemberOwnerRepresents a chat member that owns the chat and has all administrator privileges.
TelegramChatMemberRestrictedRepresents a chat member that is under certain restrictions in the chat. Supergroups only.
TelegramChatMemberUpdatedThis object represents changes in the status of a chat member.
TelegramChatOwnerChangedDescribes a service message about an ownership change in the chat.
TelegramChatOwnerLeftDescribes a service message about the chat owner leaving the chat.
TelegramChatPermissionsDescribes actions that a non-administrator user is allowed to take in a chat.
TelegramChatPhotoThis object represents a chat photo.
TelegramChatSharedThis object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.
TelegramChecklistDescribes a checklist.
TelegramChecklistTaskDescribes a task in a checklist.
TelegramChecklistTasksAddedDescribes a service message about tasks added to a checklist.
TelegramChecklistTasksDoneDescribes a service message about checklist tasks marked as done or not done.
TelegramChosenInlineResultRepresents a result of an inline query that was chosen by the user and sent to their chat partner.
TelegramContactThis object represents a phone contact.
TelegramCopyTextButtonThis object represents an inline keyboard button that copies specified text to the clipboard.
TelegramDiceThis object represents an animated emoji that displays a random value.
TelegramDirectMessagePriceChangedDescribes a service message about a change in the price of direct messages sent to a channel chat.
TelegramDirectMessagesTopicDescribes a topic of a direct messages chat.
TelegramDocumentThis object represents a general file (as opposed to photos, voice messages and audio files).
TelegramEncryptedCredentialsDescribes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
TelegramEncryptedPassportElementDescribes documents or other Telegram Passport elements shared with the bot by the user.
TelegramExternalReplyInfoThis object contains information about a message that is being replied to, which may come from another chat or forum topic.
TelegramFileThis object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
TelegramForceReplyUpon 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.
TelegramForumTopicThis object represents a forum topic.
TelegramForumTopicClosedThis object represents a service message about a forum topic closed in the chat. Currently holds no information.
TelegramForumTopicCreatedThis object represents a service message about a new forum topic created in the chat.
TelegramForumTopicEditedThis object represents a service message about an edited forum topic.
TelegramForumTopicReopenedThis object represents a service message about a forum topic reopened in the chat. Currently holds no information.
TelegramGameThis object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
TelegramGameHighScoreThis object represents one row of the high scores table for a game.
TelegramGeneralForumTopicHiddenThis object represents a service message about General forum topic hidden in the chat. Currently holds no information.
TelegramGeneralForumTopicUnhiddenThis object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
TelegramGiftThis object represents a gift that can be sent by the bot.
TelegramGiftBackgroundThis object describes the background of a gift.
TelegramGiftInfoDescribes a service message about a regular gift that was sent or received.
TelegramGiftsThis object represent a list of gifts.
TelegramGiveawayThis object represents a message about a scheduled giveaway.
TelegramGiveawayCompletedThis object represents a service message about the completion of a giveaway without public winners.
TelegramGiveawayCreatedThis object represents a service message about the creation of a scheduled giveaway.
TelegramGiveawayWinnersThis object represents a message about the completion of a giveaway with public winners.
TelegramInaccessibleMessageThis object describes a message that was deleted or is otherwise inaccessible to the bot.
TelegramInlineKeyboardButtonThis 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.
TelegramInlineKeyboardMarkupThis object represents an inline keyboard that appears right next to the message it belongs to.
TelegramInlineQueryThis object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
TelegramInlineQueryResultArticleRepresents a link to an article or web page.
TelegramInlineQueryResultAudioRepresents 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.
TelegramInlineQueryResultCachedAudioRepresents 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.
TelegramInlineQueryResultCachedDocumentRepresents 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.
TelegramInlineQueryResultCachedGifRepresents 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.
TelegramInlineQueryResultCachedMpeg4GifRepresents 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.
TelegramInlineQueryResultCachedPhotoRepresents 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.
TelegramInlineQueryResultCachedStickerRepresents 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.
TelegramInlineQueryResultCachedVideoRepresents 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.
TelegramInlineQueryResultCachedVoiceRepresents 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.
TelegramInlineQueryResultContactRepresents 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.
TelegramInlineQueryResultDocumentRepresents 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.
TelegramInlineQueryResultGameRepresents a Game.
TelegramInlineQueryResultGifRepresents 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.
TelegramInlineQueryResultLocationRepresents 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.
TelegramInlineQueryResultMpeg4GifRepresents 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.
TelegramInlineQueryResultPhotoRepresents 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.
TelegramInlineQueryResultsButtonThis object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
TelegramInlineQueryResultVenueRepresents 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.
TelegramInlineQueryResultVideoRepresents 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.
TelegramInlineQueryResultVoiceRepresents 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.
TelegramInputChecklistDescribes a checklist to create.
TelegramInputChecklistTaskDescribes a task to add to a checklist.
TelegramInputContactMessageContentRepresents the content of a contact message to be sent as the result of an inline query.
TelegramInputInvoiceMessageContentRepresents the content of an invoice message to be sent as the result of an inline query.
TelegramInputLocationMessageContentRepresents the content of a location message to be sent as the result of an inline query.
TelegramInputMediaAnimationRepresents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
TelegramInputMediaAudioRepresents an audio file to be treated as music to be sent.
TelegramInputMediaDocumentRepresents a general file to be sent.
TelegramInputMediaPhotoRepresents a photo to be sent.
TelegramInputMediaVideoRepresents a video to be sent.
TelegramInputPaidMediaPhotoThe paid media to send is a photo.
TelegramInputPaidMediaVideoThe paid media to send is a video.
TelegramInputPollOptionThis object contains information about one answer option in a poll to be sent.
TelegramInputProfilePhotoAnimatedAn animated profile photo in the MPEG4 format.
TelegramInputProfilePhotoStaticA static profile photo in the .JPG format.
TelegramInputStickerThis object describes a sticker to be added to a sticker set.
TelegramInputStoryContentPhotoDescribes a photo to post as a story.
TelegramInputStoryContentVideoDescribes a video to post as a story.
TelegramInputTextMessageContentRepresents the content of a text message to be sent as the result of an inline query.
TelegramInputVenueMessageContentRepresents the content of a venue message to be sent as the result of an inline query.
TelegramInvoiceThis object contains basic information about an invoice.
TelegramKeyboardButtonThis object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.
TelegramKeyboardButtonPollTypeThis object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
TelegramKeyboardButtonRequestChatThis 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 ».
TelegramKeyboardButtonRequestUsersThis 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 »
TelegramLabeledPriceThis object represents a portion of the price for goods or services.
TelegramLinkPreviewOptionsDescribes the options used for link preview generation.
TelegramLocationThis object represents a point on the map.
TelegramLocationAddressDescribes the physical address of a location.
TelegramLoginUrlThis 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:
TelegramMaskPositionThis object describes the position on faces where a mask should be placed by default.
TelegramMenuButtonCommandsRepresents a menu button, which opens the bot's list of commands.
TelegramMenuButtonDefaultDescribes that no specific value for the menu button was set.
TelegramMenuButtonWebAppRepresents a menu button, which launches a Web App.
TelegramMessageThis object represents a message.
TelegramMessageAutoDeleteTimerChangedThis object represents a service message about a change in auto-delete timer settings.
TelegramMessageEntityThis object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
TelegramMessageIdThis object represents a unique message identifier.
TelegramMessageOriginChannelThe message was originally sent to a channel chat.
TelegramMessageOriginChatThe message was originally sent on behalf of a chat to a group chat.
TelegramMessageOriginHiddenUserThe message was originally sent by an unknown user.
TelegramMessageOriginUserThe message was originally sent by a known user.
TelegramMessageReactionCountUpdatedThis object represents reaction changes on a message with anonymous reactions.
TelegramMessageReactionUpdatedThis object represents a change of a reaction on a message performed by a user.
TelegramOrderInfoThis object represents information about an order.
TelegramOwnedGiftRegularDescribes a regular gift owned by a user or a chat.
TelegramOwnedGiftsContains the list of gifts received and owned by a user or a chat.
TelegramOwnedGiftUniqueDescribes a unique gift received and owned by a user or a chat.
TelegramPaidMediaInfoDescribes the paid media added to a message.
TelegramPaidMediaPhotoThe paid media is a photo.
TelegramPaidMediaPreviewThe paid media isn't available before the payment.
TelegramPaidMediaPurchasedThis object contains information about a paid media purchase.
TelegramPaidMediaVideoThe paid media is a video.
TelegramPaidMessagePriceChangedDescribes a service message about a change in the price of paid messages within a chat.
TelegramPassportDataDescribes Telegram Passport data shared with the bot by the user.
TelegramPassportElementErrorDataFieldRepresents 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.
TelegramPassportElementErrorFileRepresents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
TelegramPassportElementErrorFilesRepresents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
TelegramPassportElementErrorFrontSideRepresents 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.
TelegramPassportElementErrorReverseSideRepresents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
TelegramPassportElementErrorSelfieRepresents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
TelegramPassportElementErrorTranslationFileRepresents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.
TelegramPassportElementErrorTranslationFilesRepresents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
TelegramPassportElementErrorUnspecifiedRepresents an issue in an unspecified place. The error is considered resolved when new data is added.
TelegramPassportFileThis object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.
TelegramPhotoSizeThis object represents one size of a photo or a file / sticker thumbnail.
TelegramPollThis object contains information about a poll.
TelegramPollAnswerThis object represents an answer of a user in a non-anonymous poll.
TelegramPollOptionThis object contains information about one answer option in a poll.
TelegramPreCheckoutQueryThis object contains information about an incoming pre-checkout query.
TelegramPreparedInlineMessageDescribes an inline message to be sent by a user of a Mini App.
TelegramProximityAlertTriggeredThis object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.
TelegramReactionCountRepresents a reaction added to a message along with the number of times it was added.
TelegramReactionTypeCustomEmojiThe reaction is based on a custom emoji.
TelegramReactionTypeEmojiThe reaction is based on an emoji.
TelegramReactionTypePaidThe reaction is paid.
TelegramRefundedPaymentThis object contains basic information about a refunded payment.
TelegramReplyKeyboardMarkupThis 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.
TelegramReplyKeyboardRemoveUpon 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.
TelegramReplyParametersDescribes reply parameters for the message that is being sent.
TelegramResponseParametersDescribes why a request was unsuccessful.
TelegramRevenueWithdrawalStateFailedThe withdrawal failed and the transaction was refunded.
TelegramRevenueWithdrawalStatePendingThe withdrawal is in progress.
TelegramRevenueWithdrawalStateSucceededThe withdrawal succeeded.
TelegramSentWebAppMessageDescribes an inline message sent by a Web App on behalf of a user.
TelegramSharedUserThis object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.
TelegramShippingAddressThis object represents a shipping address.
TelegramShippingOptionThis object represents one shipping option.
TelegramShippingQueryThis object contains information about an incoming shipping query.
TelegramStarAmountDescribes an amount of Telegram Stars.
TelegramStarTransactionDescribes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
TelegramStarTransactionsContains a list of Telegram Star transactions.
TelegramStickerThis object represents a sticker.
TelegramStickerSetThis object represents a sticker set.
TelegramStoryThis object represents a story.
TelegramStoryAreaDescribes a clickable area on a story media.
TelegramStoryAreaPositionDescribes the position of a clickable area within a story.
TelegramStoryAreaTypeLinkDescribes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
TelegramStoryAreaTypeLocationDescribes a story area pointing to a location. Currently, a story can have up to 10 location areas.
TelegramStoryAreaTypeSuggestedReactionDescribes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.
TelegramStoryAreaTypeUniqueGiftDescribes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
TelegramStoryAreaTypeWeatherDescribes a story area containing weather information. Currently, a story can have up to 3 weather areas.
TelegramSuccessfulPaymentThis 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.
TelegramSuggestedPostApprovalFailedDescribes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.
TelegramSuggestedPostApprovedDescribes a service message about the approval of a suggested post.
TelegramSuggestedPostDeclinedDescribes a service message about the rejection of a suggested post.
TelegramSuggestedPostInfoContains information about a suggested post.
TelegramSuggestedPostPaidDescribes a service message about a successful payment for a suggested post.
TelegramSuggestedPostParametersContains parameters of a post that is being suggested by the bot.
TelegramSuggestedPostPriceDescribes the price of a suggested post.
TelegramSuggestedPostRefundedDescribes a service message about a payment refund for a suggested post.
TelegramSwitchInlineQueryChosenChatThis object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
TelegramTextQuoteThis object contains information about the quoted part of a message that is replied to by the given message.
TelegramTransactionPartnerAffiliateProgramDescribes the affiliate program that issued the affiliate commission received via this transaction.
TelegramTransactionPartnerChatDescribes a transaction with a chat.
TelegramTransactionPartnerFragmentDescribes a withdrawal transaction with Fragment.
TelegramTransactionPartnerOtherDescribes a transaction with an unknown source or recipient.
TelegramTransactionPartnerTelegramAdsDescribes a withdrawal transaction to the Telegram Ads platform.
TelegramTransactionPartnerTelegramApiDescribes a transaction with payment for paid broadcasting.
TelegramTransactionPartnerUserDescribes a transaction with a user.
TelegramUniqueGiftThis object describes a unique gift that was upgraded from a regular gift.
TelegramUniqueGiftBackdropThis object describes the backdrop of a unique gift.
TelegramUniqueGiftBackdropColorsThis object describes the colors of the backdrop of a unique gift.
TelegramUniqueGiftColorsThis object contains information about the color scheme for a user's name, message replies and link previews based on a unique gift.
TelegramUniqueGiftInfoDescribes a service message about a unique gift that was sent or received.
TelegramUniqueGiftModelThis object describes the model of a unique gift.
TelegramUniqueGiftSymbolThis object describes the symbol shown on the pattern of a unique gift.
TelegramUpdateThis object represents an incoming update. At most one of the optional parameters can be present in any given update.
TelegramUserThis object represents a Telegram user or bot.
TelegramUserChatBoostsThis object represents a list of boosts added to a chat by a user.
TelegramUserProfileAudiosThis object represents the audios displayed on a user's profile.
TelegramUserProfilePhotosThis object represent a user's profile pictures.
TelegramUserRatingThis object describes the rating of a user based on their Telegram Star spendings.
TelegramUsersSharedThis object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.
TelegramVenueThis object represents a venue.
TelegramVideoThis object represents a video file.
TelegramVideoChatEndedThis object represents a service message about a video chat ended in the chat.
TelegramVideoChatParticipantsInvitedThis object represents a service message about new members invited to a video chat.
TelegramVideoChatScheduledThis object represents a service message about a video chat scheduled in the chat.
TelegramVideoChatStartedThis object represents a service message about a video chat started in the chat. Currently holds no information.
TelegramVideoNoteThis object represents a video message (available in Telegram apps as of v.4.0).
TelegramVideoQualityThis object represents a video file of a specific quality.
TelegramVoiceThis object represents a voice note.
TelegramWebAppDataDescribes data sent from a Web App to the bot.
TelegramWebAppInfoDescribes a Web App.
TelegramWebhookInfoDescribes the current status of a webhook.
TelegramWriteAccessAllowedThis 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.
TransferBusinessAccountStarsParamsParams object for transferBusinessAccountStars method
TransferGiftParamsParams object for transferGift method
UnbanChatMemberParamsParams object for unbanChatMember method
UnbanChatSenderChatParamsParams object for unbanChatSenderChat method
UnhideGeneralForumTopicParamsParams object for unhideGeneralForumTopic method
UnpinAllChatMessagesParamsParams object for unpinAllChatMessages method
UnpinAllForumTopicMessagesParamsParams object for unpinAllForumTopicMessages method
UnpinAllGeneralForumTopicMessagesParamsParams object for unpinAllGeneralForumTopicMessages method
UnpinChatMessageParamsParams object for unpinChatMessage method
UpgradeGiftParamsParams object for upgradeGift method
UploadStickerFileParamsParams object for uploadStickerFile method
VerifyChatParamsParams object for verifyChat method
VerifyUserParamsParams object for verifyUser method
WebhookHandlerOptions-
WebhookHandlerOptionsShouldWait-

Type Aliases

Type AliasDescription
AllowedUpdates-
AnyBotType of Bot that accepts any generics
AnyPluginType of Bot that accepts any generics
APIMethodParams-
APIMethodReturn-
BotStartOptionsLongPolling-
BotStartOptionsWebhook-
CallbackQueryShorthandContext-
CreateForumTopicIconColor-
CreateNewStickerSetStickerType-
DeriveDefinitionsMap of derives
ErrorDefinitionsError map should be map of string: error
FilterA type guard predicate that narrows In to Out. Built-in filters use any as In so they work with any bot's context type. The actual narrowing happens via intersection in the .on() handler type.
GiftPremiumSubscriptionMonthCount-
HandlerHandler is a function with context and next function arguments
MaybePromiseType for maybe Promise or may not
MaybeSuppressedParamsType that assign API params with Suppress
MaybeSuppressedReturnType that return MaybeSuppressed API method ReturnType
PostStoryActivePeriod-
RepostStoryActivePeriod-
SendChatActionAction-
SendDiceEmoji-
SendPollType-
SetStickerSetThumbnailFormat-
StringableType which contains a string or has the ability to result in a string object
SuppressedAPIMethodParamsReturn method params but with Suppress
SuppressedAPIMethodReturnType that return Suppressed API method ReturnType
SuppressedAPIMethodsMap of APIMethods but with Suppress
TelegramAPIResponseThe response contains a JSON object, which always has a Boolean field 'ok'.
TelegramBackgroundFillThis object describes the way a background is filled based on the selected colors. Currently, it can be one of
TelegramBackgroundTypeThis object describes the type of a background. Currently, it can be one of
TelegramBotCommandScopeThis object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
TelegramChatBoostSourceThis object describes the source of a chat boost. It can be one of
TelegramChatFullInfoType-
TelegramChatMemberThis object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
TelegramChatType-
TelegramCurrenciesTelegram payments supported currencies. Source: currencies.json. See also supported currencies.
TelegramEncryptedPassportElementType-
TelegramInlineKeyboardButtonStyle-
TelegramInlineQueryChatType-
TelegramInlineQueryResultThis object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
TelegramInlineQueryResultDocumentMimeType-
TelegramInlineQueryResultGifThumbnailMimeType-
TelegramInlineQueryResultMpeg4GifThumbnailMimeType-
TelegramInlineQueryResultVideoMimeType-
TelegramInputFileThis 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.
TelegramInputMediaThis object represents the content of a media message to be sent. It should be one of
TelegramInputMessageContentThis 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:
TelegramInputPaidMediaThis object describes the paid media to be sent. Currently, it can be one of
TelegramInputProfilePhotoThis object describes a profile photo to set. Currently, it can be one of
TelegramInputStickerFormat-
TelegramInputStoryContentThis object describes the content of a story to post. Currently, it can be one of
TelegramKeyboardButtonStyle-
TelegramMaskPositionPoint-
TelegramMaybeInaccessibleMessageThis object describes a message that can be inaccessible to the bot. It can be one of
TelegramMenuButtonThis object describes the bot's menu button in a private chat. It should be one of
TelegramMessageEntityType-
TelegramMessageOriginThis object describes the origin of a message. It can be one of
TelegramOwnedGiftThis object describes a gift received and owned by a user or a chat. Currently, it can be one of
TelegramPaidMediaThis object describes paid media. Currently, it can be one of
TelegramPassportElementErrorThis object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
TelegramPassportElementErrorDataFieldType-
TelegramPassportElementErrorFilesType-
TelegramPassportElementErrorFileType-
TelegramPassportElementErrorFrontSideType-
TelegramPassportElementErrorReverseSideType-
TelegramPassportElementErrorSelfieType-
TelegramPassportElementErrorTranslationFilesType-
TelegramPassportElementErrorTranslationFileType-
TelegramPollType-
TelegramReactionTypeThis object describes the type of a reaction. Currently, it can be one of
TelegramReactionTypeEmojiEmoji-
TelegramRevenueWithdrawalStateThis object describes the state of a revenue withdrawal operation. Currently, it can be one of
TelegramStickerSetStickerType-
TelegramStickerType-
TelegramStoryAreaTypeDescribes the type of a clickable area on a story. Currently, it can be one of
TelegramSuggestedPostInfoState-
TelegramSuggestedPostPaidCurrency-
TelegramSuggestedPostPriceCurrency-
TelegramSuggestedPostRefundedReason-
TelegramTransactionPartnerThis object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
TelegramTransactionPartnerUserTransactionType-
TelegramUniqueGiftInfoLastResaleCurrency-
TelegramUniqueGiftInfoOrigin-
TelegramUniqueGiftModelRarity-
TelegramVideoQualityCodec-
UploadStickerFileStickerFormat-
WebhookHandlersUnion type of webhook handlers name

Variables

Composer

const Composer: EventComposerConstructor<Context<AnyBot>, TelegramEventMap, { callbackQuery: TThis; chosenInlineResult: TThis; command: TThis; hears: TThis; inlineQuery: TThis; reaction: TThis; startParameter: TThis; }>

Defined in: gramio/index.d.ts:57


ErrorKind

const ErrorKind: symbol

Defined in: gramio/index.d.ts:18

Symbol to determine which error kind is it


filters

const filters: object

Defined in: gramio/index.d.ts:1382

Type Declaration

NameTypeDescriptionDefined in
animationFilter<any, { attachment: AnimationAttachment; }>-gramio/index.d.ts:1404
audioFilter<any, { attachment: AudioAttachment; }>-gramio/index.d.ts:1392
authorSignatureFilter<any, { authorSignature: string; }>Matches messages with an author signaturegramio/index.d.ts:1467
captionFilter<any, { caption: string; }>Matches messages that have a captiongramio/index.d.ts:1425
captionEntitiesFilter<any, { captionEntities: MessageEntity[]; }>Matches messages that have caption entitiesgramio/index.d.ts:1443
channelFilter<any, { chat: { type: "channel"; }; chatType: "channel"; }>Matches channel chats. Narrows both chatType and chat.type.gramio/index.d.ts:1580
contactFilter<any, { attachment: ContactAttachment; }>-gramio/index.d.ts:1407
diceFilter<any, { dice: Dice; }>Matches messages that contain a dicegramio/index.d.ts:1429
documentFilter<any, { attachment: DocumentAttachment; }>-gramio/index.d.ts:1389
effectIdFilter<any, { effectId: string; }>Matches messages with an effect IDgramio/index.d.ts:1498
entitiesFilter<any, { entities: MessageEntity[]; }>Matches messages that have text entitiesgramio/index.d.ts:1439
forwardOriginForwardOriginFilterMatches forwarded messages. Call without args for any origin, or pass a type to narrow precisely.gramio/index.d.ts:1433
fromOffline()(ctx) => booleanMatches messages sent while user was offline. No type narrowing.gramio/index.d.ts:1526
gameFilter<any, { game: Game; }>Matches messages with a gamegramio/index.d.ts:1490
giveawayFilter<any, { giveaway: Giveaway; }>Matches giveaway messagesgramio/index.d.ts:1482
groupFilter<any, { chat: { type: "group"; }; chatType: "group"; }>Matches group chats. Narrows both chatType and chat.type.gramio/index.d.ts:1566
hasDataFilter<any, { data: string; }>Matches callback queries that have datagramio/index.d.ts:1532
hasFromFilter<any, { from: User; senderId: number; }>Matches contexts that have a sender (from user)gramio/index.d.ts:1475
hasGameShortNameFilter<any, { gameShortName: string; }>Matches callback queries with a game short namegramio/index.d.ts:1540
hasInlineMessageIdFilter<any, { inlineMessageId: string; }>Matches callback queries with an inline message IDgramio/index.d.ts:1536
hasMessageFilter<any, { message: MessageContext<any>; }>Matches callback queries that have an associated messagegramio/index.d.ts:1528
isBot()(ctx) => booleanMatches messages from bot accountsgramio/index.d.ts:1510
isForum()(ctx) => booleanMatches messages in forum (topic) chatsgramio/index.d.ts:1514
isPremium()(ctx) => booleanMatches messages from premium usersgramio/index.d.ts:1512
linkPreviewFilter<any, { linkPreviewOptions: LinkPreviewOptions; }>Matches messages that have link preview optionsgramio/index.d.ts:1455
locationFilter<any, { attachment: LocationAttachment; }>-gramio/index.d.ts:1410
mediaFilter<any, { attachment: AnyAttachment; }>Matches any message that has an attachmentgramio/index.d.ts:1417
mediaGroupFilter<any, { mediaGroupId: string; }>Matches messages that belong to a media groupgramio/index.d.ts:1502
mediaSpoilerFilter<any, { attachment: AnyAttachment; }>Matches media with spoiler. Narrows attachment to confirm media is present.gramio/index.d.ts:1520
paidMediaFilter<any, { paidMedia: PaidMediaInfo; }>Matches messages with paid mediagramio/index.d.ts:1486
photoFilter<any, { attachment: PhotoAttachment; }>-gramio/index.d.ts:1383
pmFilter<any, { chat: { type: "private"; }; chatType: "private"; }>Matches private (DM) chats. Narrows both chatType and chat.type.gramio/index.d.ts:1559
pollFilter<any, { attachment: PollAttachment; }>-gramio/index.d.ts:1413
protectedContent()(ctx) => booleanMatches messages with protected content. No type narrowing.gramio/index.d.ts:1524
quoteFilter<any, { quote: TextQuote; }>Matches messages that have a quotegramio/index.d.ts:1447
rawStartPayloadFilter<any, { rawStartPayload: string; }>Matches messages with a raw /start payload stringgramio/index.d.ts:1463
replyFilter<any, { replyMessage: Message; }>Matches messages that are repliesgramio/index.d.ts:1435
replyInfoFilter<any, { externalReply: ExternalReplyInfo; }>Matches messages with external reply infogramio/index.d.ts:1471
senderChatSenderChatFilterMatches messages sent on behalf of a chat. Pass a type to also narrow senderChat.type.gramio/index.d.ts:1480
service()(ctx) => anyMatches service messagesgramio/index.d.ts:1516
startPayloadFilter<any, { startPayload: string; }>Matches messages with a /start payloadgramio/index.d.ts:1459
stickerFilter<any, { attachment: StickerAttachment; }>-gramio/index.d.ts:1395
storyFilter<any, { story: StoryAttachment; }>Matches messages with a storygramio/index.d.ts:1494
supergroupFilter<any, { chat: { type: "supergroup"; }; chatType: "supergroup"; }>Matches supergroup chats. Narrows both chatType and chat.type.gramio/index.d.ts:1573
textFilter<any, { text: string; }>Matches messages that have textgramio/index.d.ts:1421
topicMessage()(ctx) => anyMatches messages in topicsgramio/index.d.ts:1518
venueFilter<any, { venue: Venue; }>Matches messages with a venuegramio/index.d.ts:1506
viaBotFilter<any, { viaBot: User; }>Matches messages sent via a botgramio/index.d.ts:1451
videoFilter<any, { attachment: VideoAttachment; }>-gramio/index.d.ts:1386
videoNoteFilter<any, { attachment: VideoNoteAttachment; }>-gramio/index.d.ts:1401
voiceFilter<any, { attachment: VoiceAttachment; }>-gramio/index.d.ts:1398
and()(f1, f2) => Filter<any, N1 & N2>Intersection: both filters must matchgramio/index.d.ts:1595
captionEntity()(type) => Filter<any, { captionEntities: MessageEntity[]; }>Matches messages with a specific caption entity typegramio/index.d.ts:1548
chat()(type) => Filter<any, { chat: { type: T; }; chatType: T; }>Matches messages from a specific chat type. Narrows both chatType and chat.type.gramio/index.d.ts:1552
chatId()(chatId) => (ctx) => booleanMatches messages in specific chat(s). No type narrowing.gramio/index.d.ts:1589
entity()(type) => Filter<any, { entities: MessageEntity[]; }>Matches messages with a specific text entity typegramio/index.d.ts:1544
every()(...filters) => Filter<any, UnionToIntersection<ExtractNarrow<Filters[number]>>>Variadic intersection: all filters must matchgramio/index.d.ts:1601
from()(userId) => (ctx) => booleanMatches messages from specific user(s). No type narrowing.gramio/index.d.ts:1587
not()(f) => (ctx) => booleanNegation: inverts the filter (no type narrowing)gramio/index.d.ts:1599
or()(f1, f2) => Filter<any, N1 | N2>Union: either filter must matchgramio/index.d.ts:1597
regex()(pattern) => Filter<any, { match: RegExpMatchArray; }>Matches messages whose text/caption matches the regex, sets ctx.matchgramio/index.d.ts:1591
some()(...filters) => Filter<any, ExtractNarrow<Filters[number]>>Variadic union: any filter must matchgramio/index.d.ts:1603

Functions

getFormattable()

getFormattable(str): FormattableString

Defined in: format/formattable-string-BKevNsLk.d.ts:21

Parameters

ParameterType
strStringable

Returns

FormattableString


webhookHandler()

webhookHandler<Framework>(bot, framework, secretTokenOrOptions?): ReturnType<object[Framework]> extends object ? (...args) => ReturnType<ReturnType["response"]> : (...args) => void

Defined in: gramio/index.d.ts:1709

Setup handler with yours web-framework to receive updates via webhook

Type Parameters

Type Parameter
Framework extends "elysia" | "fastify" | "hono" | "express" | "koa" | "http" | "std/http" | "Bun.serve" | "cloudflare" | "Request"

Parameters

ParameterType
botBot
frameworkFramework
secretTokenOrOptions?string | WebhookHandlerOptions

Returns

ReturnType<object[Framework]> extends object ? (...args) => ReturnType<ReturnType["response"]> : (...args) => void

Example

ts
import { Bot } from "gramio";
import Fastify from "fastify";

const bot = new Bot(process.env.TOKEN as string).on(
	"message",
	(context) => {
		return context.send("Fastify!");
	},
);

const fastify = Fastify();

fastify.post("/telegram-webhook", webhookHandler(bot, "fastify"));

fastify.listen({ port: 3445, host: "::" });

bot.start({
    webhook: {
        url: "https://example.com:3445/telegram-webhook",
    },
});

References

AcceptedGiftTypes

Re-exports AcceptedGiftTypes


AnimationAttachment

Re-exports AnimationAttachment


applyMixins

Re-exports applyMixins


Attachment

Re-exports Attachment


AttachmentsMapping

Re-exports AttachmentsMapping


AttachmentType

Re-exports AttachmentType


AudioAttachment

Re-exports AudioAttachment


BackgroundFillFreeformGradient

Re-exports BackgroundFillFreeformGradient


BackgroundFillGradient

Re-exports BackgroundFillGradient


backgroundFillMap

Re-exports backgroundFillMap


BackgroundFillSolid

Re-exports BackgroundFillSolid


BackgroundTypeChatTheme

Re-exports BackgroundTypeChatTheme


BackgroundTypeFill

Re-exports BackgroundTypeFill


backgroundTypeMap

Re-exports backgroundTypeMap


BackgroundTypePattern

Re-exports BackgroundTypePattern


BackgroundTypeWallpaper

Re-exports BackgroundTypeWallpaper


BaseKeyboardConstructor

Re-exports BaseKeyboardConstructor


Birthdate

Re-exports Birthdate


blockquote

Re-exports blockquote


bold

Re-exports bold


BoostAddedContext

Re-exports BoostAddedContext


BotCommand

Re-exports BotCommand


BotDescription

Re-exports BotDescription


BotLike

Re-exports BotLike


BotShortDescription

Re-exports BotShortDescription


buildFromOptions

Re-exports buildFromOptions


BusinessBotRights

Re-exports BusinessBotRights


BusinessConnection

Re-exports BusinessConnection


BusinessConnectionContext

Re-exports BusinessConnectionContext


BusinessIntro

Re-exports BusinessIntro


BusinessLocation

Re-exports BusinessLocation


BusinessMessagesDeleted

Re-exports BusinessMessagesDeleted


BusinessMessagesDeletedContext

Re-exports BusinessMessagesDeletedContext


BusinessOpeningHours

Re-exports BusinessOpeningHours


BusinessOpeningHoursInterval

Re-exports BusinessOpeningHoursInterval


ButtonOptions

Re-exports ButtonOptions


ButtonsIterator

Re-exports ButtonsIterator


CallbackData

Re-exports CallbackData


CallbackGame

Re-exports CallbackGame


CallbackQuery

Re-exports CallbackQuery


CallbackQueryContext

Re-exports CallbackQueryContext


Chat

Re-exports Chat


ChatActionMixin

Re-exports ChatActionMixin


ChatAdministratorRights

Re-exports ChatAdministratorRights


ChatBackground

Re-exports ChatBackground


ChatBackgroundSetContext

Re-exports ChatBackgroundSetContext


ChatBoost

Re-exports ChatBoost


ChatBoostAdded

Re-exports ChatBoostAdded


ChatBoostContext

Re-exports ChatBoostContext


ChatBoostRemoved

Re-exports ChatBoostRemoved


ChatBoostSourceGiftCode

Re-exports ChatBoostSourceGiftCode


ChatBoostSourceGiveaway

Re-exports ChatBoostSourceGiveaway


ChatBoostSourcePremium

Re-exports ChatBoostSourcePremium


ChatBoostUpdated

Re-exports ChatBoostUpdated


ChatControlMixin

Re-exports ChatControlMixin


ChatFullInfo

Re-exports ChatFullInfo


ChatInviteControlMixin

Re-exports ChatInviteControlMixin


Re-exports ChatInviteLink


ChatJoinRequest

Re-exports ChatJoinRequest


ChatJoinRequestContext

Re-exports ChatJoinRequestContext


ChatLocation

Re-exports ChatLocation


ChatMember

Re-exports ChatMember


ChatMemberContext

Re-exports ChatMemberContext


ChatMemberControlMixin

Re-exports ChatMemberControlMixin


ChatMemberUpdated

Re-exports ChatMemberUpdated


ChatOwnerChanged

Re-exports ChatOwnerChanged


ChatOwnerChangedContext

Re-exports ChatOwnerChangedContext


ChatOwnerLeft

Re-exports ChatOwnerLeft


ChatOwnerLeftContext

Re-exports ChatOwnerLeftContext


ChatPermissions

Re-exports ChatPermissions


ChatPhoto

Re-exports ChatPhoto


ChatSenderControlMixin

Re-exports ChatSenderControlMixin


ChatShared

Re-exports ChatShared


ChatSharedContext

Re-exports ChatSharedContext


ChatType

Re-exports ChatType


Checklist

Re-exports Checklist


ChecklistTask

Re-exports ChecklistTask


ChecklistTasksAdded

Re-exports ChecklistTasksAdded


ChecklistTasksAddedContext

Re-exports ChecklistTasksAddedContext


ChecklistTasksDone

Re-exports ChecklistTasksDone


ChecklistTasksDoneContext

Re-exports ChecklistTasksDoneContext


ChosenInlineResult

Re-exports ChosenInlineResult


ChosenInlineResultContext

Re-exports ChosenInlineResultContext


chunk

Re-exports chunk


CloneMixin

Re-exports CloneMixin


code

Re-exports code


compose

Re-exports compose


Constructor

Re-exports Constructor


Contact

Re-exports Contact


ContactAttachment

Re-exports ContactAttachment


Context

Re-exports Context


ContextCallback

Re-exports ContextCallback


ContextsMapping

Re-exports ContextsMapping


contextsMappings

Re-exports contextsMappings


ContextType

Re-exports ContextType


convertJsonToFormData

Re-exports convertJsonToFormData


convertStreamToBuffer

Re-exports convertStreamToBuffer


CreateButtonIterator

Re-exports CreateButtonIterator


customEmoji

Re-exports customEmoji


CustomEventName

Re-exports CustomEventName


customWrap

Re-exports customWrap


dateTime

Re-exports dateTime


DefaultAttachment

Re-exports DefaultAttachment


DeleteChatPhotoContext

Re-exports DeleteChatPhotoContext


DeriveFromOptions

Re-exports DeriveFromOptions


Dice

Re-exports Dice


DirectMessagePriceChanged

Re-exports DirectMessagePriceChanged


DirectMessagePriceChangedContext

Re-exports DirectMessagePriceChangedContext


DirectMessagesTopic

Re-exports DirectMessagesTopic


DocumentAttachment

Re-exports DocumentAttachment


DownloadMixin

Re-exports DownloadMixin


EncryptedCredentials

Re-exports EncryptedCredentials


EncryptedPassportElement

Re-exports EncryptedPassportElement


EntityType

Re-exports EntityType


EventComposer

Re-exports EventComposer


EventQueue

Re-exports EventQueue


EVENTS

Re-exports EVENTS


expandableBlockquote

Re-exports expandableBlockquote


ExternalReplyInfo

Re-exports ExternalReplyInfo


extractFilesToFormData

Re-exports extractFilesToFormData


File

Re-exports File


FileAttachment

Re-exports FileAttachment


filter

Re-exports filter


filterPayload

Re-exports filterPayload


ForceReplyKeyboard

Re-exports ForceReplyKeyboard


format

Re-exports format


formatSaveIndents

Re-exports formatSaveIndents


FormattableMap

Re-exports FormattableMap


ForumMixin

Re-exports ForumMixin


ForumTopicClosed

Re-exports ForumTopicClosed


ForumTopicClosedContext

Re-exports ForumTopicClosedContext


ForumTopicCreated

Re-exports ForumTopicCreated


ForumTopicCreatedContext

Re-exports ForumTopicCreatedContext


ForumTopicEdited

Re-exports ForumTopicEdited


ForumTopicEditedContext

Re-exports ForumTopicEditedContext


ForumTopicReopened

Re-exports ForumTopicReopened


ForumTopicReopenedContext

Re-exports ForumTopicReopenedContext


Game

Re-exports Game


GeneralForumTopicHidden

Re-exports GeneralForumTopicHidden


GeneralForumTopicHiddenContext

Re-exports GeneralForumTopicHiddenContext


GeneralForumTopicUnhidden

Re-exports GeneralForumTopicUnhidden


GeneralForumTopicUnhiddenContext

Re-exports GeneralForumTopicUnhiddenContext


GetDerives

Re-exports GetDerives


Gift

Re-exports Gift


GiftBackground

Re-exports GiftBackground


GiftContext

Re-exports GiftContext


GiftInfo

Re-exports GiftInfo


GiftUpgradeSentContext

Re-exports GiftUpgradeSentContext


Giveaway

Re-exports Giveaway


GiveawayCompleted

Re-exports GiveawayCompleted


GiveawayCompletedContext

Re-exports GiveawayCompletedContext


GiveawayCreated

Re-exports GiveawayCreated


GiveawayCreatedContext

Re-exports GiveawayCreatedContext


GiveawayWinners

Re-exports GiveawayWinners


GiveawayWinnersContext

Re-exports GiveawayWinnersContext


GroupChatCreatedContext

Re-exports GroupChatCreatedContext


HandlerOptions

Re-exports HandlerOptions


InaccessibleMessage

Re-exports InaccessibleMessage


InferDataPack

Re-exports InferDataPack


InferDataUnpack

Re-exports InferDataUnpack


InlineKeyboard

Re-exports InlineKeyboard


InlineKeyboardButton

Re-exports InlineKeyboardButton


InlineKeyboardMarkup

Re-exports InlineKeyboardMarkup


InlineQuery

Re-exports InlineQuery


InlineQueryContext

Re-exports InlineQueryContext


InlineQueryResult

Re-exports InlineQueryResult


InlineQueryResultLocation

Re-exports InlineQueryResultLocation


InputChecklist

Re-exports InputChecklist


InputChecklistTask

Re-exports InputChecklistTask


InputLocationMessageContent

Re-exports InputLocationMessageContent


InputMessageContent

Re-exports InputMessageContent


InputPollOption

Re-exports InputPollOption


Invoice

Re-exports Invoice


InvoiceContext

Re-exports InvoiceContext


isBlob

Re-exports isBlob


isMediaUpload

Re-exports isMediaUpload


isParsable

Re-exports isParsable


isPlainObject

Re-exports isPlainObject


italic

Re-exports italic


join

Re-exports join


JoinUnion

Re-exports JoinUnion


Keyboard

Re-exports Keyboard


KeyboardFeatureFlags

Re-exports KeyboardFeatureFlags


KeyboardHelperColumns

Re-exports KeyboardHelperColumns


KeyboardHelperFilter

Re-exports KeyboardHelperFilter


KeyboardHelperPattern

Re-exports KeyboardHelperPattern


KeyboardHelpers

Re-exports KeyboardHelpers


KeyboardHelperWrap

Re-exports KeyboardHelperWrap


keyboardsFeatureFlagsMap

Re-exports keyboardsFeatureFlagsMap


LeftChatMemberContext

Re-exports LeftChatMemberContext


Re-exports link


LinkPreviewOptions

Re-exports LinkPreviewOptions


Location

Re-exports Location


LocationAttachment

Re-exports LocationAttachment


LocationContext

Re-exports LocationContext


LoginUrl

Re-exports LoginUrl


MacroDef

Re-exports MacroDef


MacroDefinitions

Re-exports MacroDefinitions


MacroDeriveType

Re-exports MacroDeriveType


MacroHooks

Re-exports MacroHooks


MacroOptionType

Re-exports MacroOptionType


MaskPosition

Re-exports MaskPosition


MaybeArray

Re-exports MaybeArray


MEDIA_METHODS

Re-exports MEDIA_METHODS


MediaInput

Re-exports MediaInput


MediaUpload

Re-exports MediaUpload


memoizeGetters

Re-exports memoizeGetters


mention

Re-exports mention


Re-exports MenuButton


Message

Re-exports Message


MessageAutoDeleteTimerChanged

Re-exports MessageAutoDeleteTimerChanged


MessageAutoDeleteTimerChangedContext

Re-exports MessageAutoDeleteTimerChangedContext


MessageContext

Re-exports MessageContext


MessageContextWithRequiredFrom

Re-exports MessageContextWithRequiredFrom


MessageDraftPiece

Re-exports MessageDraftPiece


MessageEntity

Re-exports MessageEntity


MessageEventName

Re-exports MessageEventName


MessageId

Re-exports MessageId


MessageOriginChannel

Re-exports MessageOriginChannel


MessageOriginChat

Re-exports MessageOriginChat


MessageOriginHiddenUser

Re-exports MessageOriginHiddenUser


MessageOriginUser

Re-exports MessageOriginUser


MessageReactionContext

Re-exports MessageReactionContext


MessageReactionCountContext

Re-exports MessageReactionCountContext


MessageReactionCountUpdated

Re-exports MessageReactionCountUpdated


MessageReactionUpdated

Re-exports MessageReactionUpdated


Middleware

Re-exports Middleware


MigrateFromChatIdContext

Re-exports MigrateFromChatIdContext


MigrateToChatIdContext

Re-exports MigrateToChatIdContext


NewChatMembersContext

Re-exports NewChatMembersContext


NewChatPhotoContext

Re-exports NewChatPhotoContext


NewChatTitleContext

Re-exports NewChatTitleContext


Next

Re-exports Next


NodeMixin

Re-exports NodeMixin


noopNext

Re-exports noopNext


Optional

Re-exports Optional


OrderInfo

Re-exports OrderInfo


PaidMediaInfo

Re-exports PaidMediaInfo


paidMediaMap

Re-exports paidMediaMap


PaidMediaPhoto

Re-exports PaidMediaPhoto


PaidMediaPreview

Re-exports PaidMediaPreview


PaidMediaPurchasedContext

Re-exports PaidMediaPurchasedContext


PaidMediaVideo

Re-exports PaidMediaVideo


PaidMessagePriceChangedContext

Re-exports PaidMessagePriceChangedContext


PassportData

Re-exports PassportData


PassportDataContext

Re-exports PassportDataContext


PassportFile

Re-exports PassportFile


pattern

Re-exports pattern


PhotoAttachment

Re-exports PhotoAttachment


PhotoSize

Re-exports PhotoSize


PinnedMessageContext

Re-exports PinnedMessageContext


PinsMixin

Re-exports PinsMixin


Poll

Re-exports Poll


PollAnswer

Re-exports PollAnswer


PollAnswerContext

Re-exports PollAnswerContext


PollAttachment

Re-exports PollAttachment


PollContext

Re-exports PollContext


PollOption

Re-exports PollOption


PollType

Re-exports PollType


pre

Re-exports pre


PreCheckoutQuery

Re-exports PreCheckoutQuery


PreCheckoutQueryContext

Re-exports PreCheckoutQueryContext


ProximityAlertTriggered

Re-exports ProximityAlertTriggered


ProximityAlertTriggeredContext

Re-exports ProximityAlertTriggeredContext


ReactionCount

Re-exports ReactionCount


ReactionTypeCustomEmoji

Re-exports ReactionTypeCustomEmoji


ReactionTypeEmoji

Re-exports ReactionTypeEmoji


ReactionTypePaid

Re-exports ReactionTypePaid


RefundedPayment

Re-exports RefundedPayment


RefundedPaymentContext

Re-exports RefundedPaymentContext


RemovedChatBoostContext

Re-exports RemovedChatBoostContext


RemoveKeyboard

Re-exports RemoveKeyboard


Require

Re-exports Require


RequireValue

Re-exports RequireValue


SafeUnpackResult

Re-exports SafeUnpackResult


SendMixin

Re-exports SendMixin


SentWebAppMessage

Re-exports SentWebAppMessage


SERVICE_MESSAGE_EVENTS

Re-exports SERVICE_MESSAGE_EVENTS


SharedUser

Re-exports SharedUser


ShippingAddress

Re-exports ShippingAddress


ShippingQuery

Re-exports ShippingQuery


ShippingQueryContext

Re-exports ShippingQueryContext


skip

Re-exports skip


sleep

Re-exports sleep


SoftString

Re-exports SoftString


spoiler

Re-exports spoiler


StickerAttachment

Re-exports StickerAttachment


StickerSet

Re-exports StickerSet


stop

Re-exports stop


Story

Re-exports Story


StoryAttachment

Re-exports StoryAttachment


StreamMessageOptions

Re-exports StreamMessageOptions


strikethrough

Re-exports strikethrough


SuccessfulPayment

Re-exports SuccessfulPayment


SuccessfulPaymentContext

Re-exports SuccessfulPaymentContext


SuggestedPostApprovalFailed

Re-exports SuggestedPostApprovalFailed


SuggestedPostApprovalFailedContext

Re-exports SuggestedPostApprovalFailedContext


SuggestedPostApproved

Re-exports SuggestedPostApproved


SuggestedPostApprovedContext

Re-exports SuggestedPostApprovedContext


SuggestedPostDeclined

Re-exports SuggestedPostDeclined


SuggestedPostDeclinedContext

Re-exports SuggestedPostDeclinedContext


SuggestedPostInfo

Re-exports SuggestedPostInfo


SuggestedPostPaid

Re-exports SuggestedPostPaid


SuggestedPostPaidContext

Re-exports SuggestedPostPaidContext


SuggestedPostPrice

Re-exports SuggestedPostPrice


SuggestedPostRefunded

Re-exports SuggestedPostRefunded


SuggestedPostRefundedContext

Re-exports SuggestedPostRefundedContext


TargetMixin

Re-exports TargetMixin


TextQuote

Re-exports TextQuote


tSendAnimation

Re-exports tSendAnimation


tSendAudio

Re-exports tSendAudio


tSendDocument

Re-exports tSendDocument


tSendMethods

Re-exports tSendMethods


tSendPhoto

Re-exports tSendPhoto


tSendSticker

Re-exports tSendSticker


tSendVideo

Re-exports tSendVideo


tSendVideoNote

Re-exports tSendVideoNote


tSendVoice

Re-exports tSendVoice


underline

Re-exports underline


UniqueGift

Re-exports UniqueGift


UniqueGiftBackdrop

Re-exports UniqueGiftBackdrop


UniqueGiftBackdropColors

Re-exports UniqueGiftBackdropColors


UniqueGiftColors

Re-exports UniqueGiftColors


UniqueGiftContext

Re-exports UniqueGiftContext


UniqueGiftInfo

Re-exports UniqueGiftInfo


UniqueGiftModel

Re-exports UniqueGiftModel


UniqueGiftSymbol

Re-exports UniqueGiftSymbol


Update

Re-exports Update


UpdateName

Re-exports UpdateName


User

Re-exports User


UserProfileAudios

Re-exports UserProfileAudios


UserProfilePhotos

Re-exports UserProfilePhotos


UserRating

Re-exports UserRating


UsersShared

Re-exports UsersShared


UsersSharedContext

Re-exports UsersSharedContext


Venue

Re-exports Venue


VenueAttachment

Re-exports VenueAttachment


VideoAttachment

Re-exports VideoAttachment


VideoChatEnded

Re-exports VideoChatEnded


VideoChatEndedContext

Re-exports VideoChatEndedContext


VideoChatParticipantsInvited

Re-exports VideoChatParticipantsInvited


VideoChatParticipantsInvitedContext

Re-exports VideoChatParticipantsInvitedContext


VideoChatScheduled

Re-exports VideoChatScheduled


VideoChatScheduledContext

Re-exports VideoChatScheduledContext


VideoChatStarted

Re-exports VideoChatStarted


VideoChatStartedContext

Re-exports VideoChatStartedContext


VideoNoteAttachment

Re-exports VideoNoteAttachment


VideoQuality

Re-exports VideoQuality


VoiceAttachment

Re-exports VoiceAttachment


WebAppData

Re-exports WebAppData


WebAppDataContext

Re-exports WebAppDataContext


WebAppInfo

Re-exports WebAppInfo


WithCtx

Re-exports WithCtx


WriteAccessAllowed

Re-exports WriteAccessAllowed


WriteAccessAllowedContext

Re-exports WriteAccessAllowedContext