bot api reference
every Telegram Bot API method and type — 180 methods, 359 types, Bot API 10.1 — with a
yaebal-specific usage example on every page. generated from packages/types/schema.json, the same single source of truth @yaebal/types and @yaebal/contexts are
code-generated from — nothing here is hand-maintained, so it can't drift.
calling a method
three ways a method can end up typed, from most to least common — every method page below shows whichever apply:
import type { SendMessageParams, Message } from "@yaebal/types";
// every method: full params + return type, cross-linked to its own reference page
await bot.api.call<Message>("sendMessage", {
chat_id: 123456789,
text: "hello!",
} satisfies SendMessageParams);
// a growing subset also gets a direct typed shortcut on `Api`:
await bot.api.sendMessage({ chat_id: 123456789, text: "hello!" });
// ...and/or a context shortcut, wired by @yaebal/contexts:
bot.on("message", (ctx) => ctx.send("hello!"));Getting updates
methods 4
types 2
Available types
types 227
- User
- Chat
- ChatFullInfo
- Message
- MessageId
- InaccessibleMessage
- MaybeInaccessibleMessage
- MessageEntity
- TextQuote
- ExternalReplyInfo
- ReplyParameters
- MessageOrigin
- MessageOriginUser
- MessageOriginHiddenUser
- MessageOriginChat
- MessageOriginChannel
- PhotoSize
- Animation
- Audio
- Document
- LivePhoto
- Story
- VideoQuality
- Video
- VideoNote
- Voice
- PaidMediaInfo
- PaidMedia
- PaidMediaLivePhoto
- PaidMediaPhoto
- PaidMediaPreview
- PaidMediaVideo
- Contact
- Dice
- Link
- PollMedia
- InputPollMedia
- InputPollOptionMedia
- PollOption
- InputPollOption
- PollAnswer
- Poll
- ChecklistTask
- Checklist
- InputChecklistTask
- InputChecklist
- ChecklistTasksDone
- ChecklistTasksAdded
- Location
- Venue
- WebAppData
- ProximityAlertTriggered
- MessageAutoDeleteTimerChanged
- ManagedBotCreated
- ManagedBotUpdated
- PollOptionAdded
- PollOptionDeleted
- ChatBoostAdded
- BackgroundFill
- BackgroundFillSolid
- BackgroundFillGradient
- BackgroundFillFreeformGradient
- BackgroundType
- BackgroundTypeFill
- BackgroundTypeWallpaper
- BackgroundTypePattern
- BackgroundTypeChatTheme
- ChatBackground
- ForumTopicCreated
- ForumTopicClosed
- ForumTopicEdited
- ForumTopicReopened
- GeneralForumTopicHidden
- GeneralForumTopicUnhidden
- SharedUser
- UsersShared
- ChatShared
- WriteAccessAllowed
- VideoChatScheduled
- VideoChatStarted
- VideoChatEnded
- VideoChatParticipantsInvited
- PaidMessagePriceChanged
- DirectMessagePriceChanged
- SuggestedPostApproved
- SuggestedPostApprovalFailed
- SuggestedPostDeclined
- SuggestedPostPaid
- SuggestedPostRefunded
- GiveawayCreated
- Giveaway
- GiveawayWinners
- GiveawayCompleted
- LinkPreviewOptions
- SuggestedPostPrice
- SuggestedPostInfo
- SuggestedPostParameters
- DirectMessagesTopic
- UserProfilePhotos
- UserProfileAudios
- File
- WebAppInfo
- ReplyKeyboardMarkup
- KeyboardButton
- KeyboardButtonRequestUsers
- KeyboardButtonRequestChat
- KeyboardButtonRequestManagedBot
- KeyboardButtonPollType
- ReplyKeyboardRemove
- InlineKeyboardMarkup
- InlineKeyboardButton
- LoginUrl
- SwitchInlineQueryChosenChat
- CopyTextButton
- CallbackQuery
- ForceReply
- ChatPhoto
- ChatInviteLink
- ChatAdministratorRights
- ChatMemberUpdated
- ChatMember
- ChatMemberOwner
- ChatMemberAdministrator
- ChatMemberMember
- ChatMemberRestricted
- ChatMemberLeft
- ChatMemberBanned
- ChatJoinRequest
- ChatPermissions
- Birthdate
- BusinessIntro
- BusinessLocation
- BusinessOpeningHoursInterval
- BusinessOpeningHours
- UserRating
- StoryAreaPosition
- LocationAddress
- StoryAreaType
- StoryAreaTypeLocation
- StoryAreaTypeSuggestedReaction
- StoryAreaTypeLink
- StoryAreaTypeWeather
- StoryAreaTypeUniqueGift
- StoryArea
- ChatLocation
- ReactionType
- ReactionTypeEmoji
- ReactionTypeCustomEmoji
- ReactionTypePaid
- ReactionCount
- MessageReactionUpdated
- MessageReactionCountUpdated
- ForumTopic
- GiftBackground
- Gift
- Gifts
- UniqueGiftModel
- UniqueGiftSymbol
- UniqueGiftBackdropColors
- UniqueGiftBackdrop
- UniqueGiftColors
- UniqueGift
- GiftInfo
- UniqueGiftInfo
- OwnedGift
- OwnedGiftRegular
- OwnedGiftUnique
- OwnedGifts
- BotAccessSettings
- AcceptedGiftTypes
- StarAmount
- BotCommand
- BotCommandScope
- BotCommandScopeDefault
- BotCommandScopeAllPrivateChats
- BotCommandScopeAllGroupChats
- BotCommandScopeAllChatAdministrators
- BotCommandScopeChat
- BotCommandScopeChatAdministrators
- BotCommandScopeChatMember
- BotName
- BotDescription
- BotShortDescription
- MenuButton
- MenuButtonCommands
- MenuButtonWebApp
- MenuButtonDefault
- ChatBoostSource
- ChatBoostSourcePremium
- ChatBoostSourceGiftCode
- ChatBoostSourceGiveaway
- ChatBoost
- ChatBoostUpdated
- ChatBoostRemoved
- ChatOwnerLeft
- ChatOwnerChanged
- UserChatBoosts
- BusinessBotRights
- BusinessConnection
- BusinessMessagesDeleted
- SentWebAppMessage
- SentGuestMessage
- PreparedInlineMessage
- PreparedKeyboardButton
- ResponseParameters
- InputMedia
- InputMediaAnimation
- InputMediaAudio
- InputMediaDocument
- InputMediaLink
- InputMediaLivePhoto
- InputMediaLocation
- InputMediaPhoto
- InputMediaSticker
- InputMediaVenue
- InputMediaVideo
- InputFile
- InputPaidMedia
- InputPaidMediaLivePhoto
- InputPaidMediaPhoto
- InputPaidMediaVideo
- InputProfilePhoto
- InputProfilePhotoStatic
- InputProfilePhotoAnimated
- InputStoryContent
- InputStoryContentPhoto
- InputStoryContentVideo
Available methods
methods 131
- getMe
- logOut
- close
- sendMessage
- forwardMessage
- forwardMessages
- copyMessage
- copyMessages
- sendPhoto
- sendLivePhoto
- sendAudio
- sendDocument
- sendVideo
- sendAnimation
- sendVoice
- sendVideoNote
- sendPaidMedia
- sendMediaGroup
- sendLocation
- sendVenue
- sendContact
- sendPoll
- sendChecklist
- sendDice
- sendMessageDraft
- sendChatAction
- setMessageReaction
- getUserProfilePhotos
- getUserProfileAudios
- setUserEmojiStatus
- getFile
- banChatMember
- unbanChatMember
- restrictChatMember
- promoteChatMember
- setChatAdministratorCustomTitle
- setChatMemberTag
- banChatSenderChat
- unbanChatSenderChat
- setChatPermissions
- exportChatInviteLink
- createChatInviteLink
- editChatInviteLink
- createChatSubscriptionInviteLink
- editChatSubscriptionInviteLink
- revokeChatInviteLink
- approveChatJoinRequest
- declineChatJoinRequest
- answerChatJoinRequestQuery
- sendChatJoinRequestWebApp
- setChatPhoto
- deleteChatPhoto
- setChatTitle
- setChatDescription
- pinChatMessage
- unpinChatMessage
- unpinAllChatMessages
- leaveChat
- getChat
- getChatAdministrators
- getChatMemberCount
- getChatMember
- getUserPersonalChatMessages
- setChatStickerSet
- deleteChatStickerSet
- getForumTopicIconStickers
- createForumTopic
- editForumTopic
- closeForumTopic
- reopenForumTopic
- deleteForumTopic
- unpinAllForumTopicMessages
- editGeneralForumTopic
- closeGeneralForumTopic
- reopenGeneralForumTopic
- hideGeneralForumTopic
- unhideGeneralForumTopic
- unpinAllGeneralForumTopicMessages
- answerCallbackQuery
- answerGuestQuery
- getUserChatBoosts
- getBusinessConnection
- getManagedBotToken
- replaceManagedBotToken
- getManagedBotAccessSettings
- setManagedBotAccessSettings
- setMyCommands
- deleteMyCommands
- getMyCommands
- setMyName
- getMyName
- setMyDescription
- getMyDescription
- setMyShortDescription
- getMyShortDescription
- setMyProfilePhoto
- removeMyProfilePhoto
- setChatMenuButton
- getChatMenuButton
- setMyDefaultAdministratorRights
- getMyDefaultAdministratorRights
- getAvailableGifts
- sendGift
- giftPremiumSubscription
- verifyUser
- verifyChat
- removeUserVerification
- removeChatVerification
- readBusinessMessage
- deleteBusinessMessages
- setBusinessAccountName
- setBusinessAccountUsername
- setBusinessAccountBio
- setBusinessAccountProfilePhoto
- removeBusinessAccountProfilePhoto
- setBusinessAccountGiftSettings
- getBusinessAccountStarBalance
- transferBusinessAccountStars
- getBusinessAccountGifts
- getUserGifts
- getChatGifts
- convertGiftToStars
- upgradeGift
- transferGift
- postStory
- repostStory
- editStory
- deleteStory
- answerWebAppQuery
- savePreparedInlineMessage
- savePreparedKeyboardButton
Updating messages
methods 14
- editMessageText
- editMessageCaption
- editMessageMedia
- editMessageLiveLocation
- stopMessageLiveLocation
- editMessageChecklist
- editMessageReplyMarkup
- stopPoll
- approveSuggestedPost
- declineSuggestedPost
- deleteMessage
- deleteMessages
- deleteMessageReaction
- deleteAllMessageReactions
Stickers
methods 16
- sendSticker
- getStickerSet
- getCustomEmojiStickers
- uploadStickerFile
- createNewStickerSet
- addStickerToSet
- setStickerPositionInSet
- deleteStickerFromSet
- replaceStickerInSet
- setStickerEmojiList
- setStickerKeywords
- setStickerMaskPosition
- setStickerSetTitle
- setStickerSetThumbnail
- setCustomEmojiStickerSetThumbnail
- deleteStickerSet
types 4
Rich messages
methods 2
types 53
- RichMessage
- InputRichMessage
- RichText
- RichTextBold
- RichTextItalic
- RichTextUnderline
- RichTextStrikethrough
- RichTextSpoiler
- RichTextDateTime
- RichTextTextMention
- RichTextSubscript
- RichTextSuperscript
- RichTextMarked
- RichTextCode
- RichTextCustomEmoji
- RichTextMathematicalExpression
- RichTextUrl
- RichTextEmailAddress
- RichTextPhoneNumber
- RichTextBankCardNumber
- RichTextMention
- RichTextHashtag
- RichTextCashtag
- RichTextBotCommand
- RichTextAnchor
- RichTextAnchorLink
- RichTextReference
- RichTextReferenceLink
- RichBlockCaption
- RichBlockTableCell
- RichBlockListItem
- RichBlock
- RichBlockParagraph
- RichBlockSectionHeading
- RichBlockPreformatted
- RichBlockFooter
- RichBlockDivider
- RichBlockMathematicalExpression
- RichBlockAnchor
- RichBlockList
- RichBlockBlockQuotation
- RichBlockPullQuotation
- RichBlockCollage
- RichBlockSlideshow
- RichBlockTable
- RichBlockDetails
- RichBlockMap
- RichBlockAnimation
- RichBlockAudio
- RichBlockPhoto
- RichBlockVideo
- RichBlockVoiceNote
- RichBlockThinking
Inline mode
methods 1
types 31
- InlineQuery
- InlineQueryResultsButton
- InlineQueryResult
- InlineQueryResultArticle
- InlineQueryResultPhoto
- InlineQueryResultGif
- InlineQueryResultMpeg4Gif
- InlineQueryResultVideo
- InlineQueryResultAudio
- InlineQueryResultVoice
- InlineQueryResultDocument
- InlineQueryResultLocation
- InlineQueryResultVenue
- InlineQueryResultContact
- InlineQueryResultGame
- InlineQueryResultCachedPhoto
- InlineQueryResultCachedGif
- InlineQueryResultCachedMpeg4Gif
- InlineQueryResultCachedSticker
- InlineQueryResultCachedDocument
- InlineQueryResultCachedVideo
- InlineQueryResultCachedVoice
- InlineQueryResultCachedAudio
- InputMessageContent
- InputTextMessageContent
- InputRichMessageContent
- InputLocationMessageContent
- InputVenueMessageContent
- InputContactMessageContent
- InputInvoiceMessageContent
- ChosenInlineResult
Payments
methods 8
- sendInvoice
- createInvoiceLink
- answerShippingQuery
- answerPreCheckoutQuery
- getMyStarBalance
- getStarTransactions
- refundStarPayment
- editUserStarSubscription
types 25
- LabeledPrice
- Invoice
- ShippingAddress
- OrderInfo
- ShippingOption
- SuccessfulPayment
- RefundedPayment
- ShippingQuery
- PreCheckoutQuery
- PaidMediaPurchased
- RevenueWithdrawalState
- RevenueWithdrawalStatePending
- RevenueWithdrawalStateSucceeded
- RevenueWithdrawalStateFailed
- AffiliateInfo
- TransactionPartner
- TransactionPartnerUser
- TransactionPartnerChat
- TransactionPartnerAffiliateProgram
- TransactionPartnerFragment
- TransactionPartnerTelegramAds
- TransactionPartnerTelegramApi
- TransactionPartnerOther
- StarTransaction
- StarTransactions
Telegram Passport
methods 1
types 14
- PassportData
- PassportFile
- EncryptedPassportElement
- EncryptedCredentials
- PassportElementError
- PassportElementErrorDataField
- PassportElementErrorFrontSide
- PassportElementErrorReverseSide
- PassportElementErrorSelfie
- PassportElementErrorFile
- PassportElementErrorFiles
- PassportElementErrorTranslationFile
- PassportElementErrorTranslationFiles
- PassportElementErrorUnspecified