Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class DeleteMyCommandsAction(scope: BotCommandScope? = null, languageCode: String? = null) : SimpleAction<Boolean>
Link copied to clipboard
class DeleteWebhookAction(dropPendingUpdates: Boolean = false) : SimpleAction<Boolean>
Link copied to clipboard
class EditUserStarSubscriptionAction(userId: Long, telegramPaymentChargeId: String, isCanceled: Boolean) : SimpleAction<Boolean>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class GetMyCommandsAction(scope: BotCommandScope? = null, languageCode: String? = null) : SimpleAction<List<BotCommand>>
Link copied to clipboard
class GetMyDescriptionAction(languageCode: String? = null) : SimpleAction<BotDescription>
Link copied to clipboard
class GetMyNameAction(languageCode: String? = null) : SimpleAction<BotName>
Link copied to clipboard
Link copied to clipboard
class GetStarTransactionsAction(offset: Int? = null, limit: Int? = null) : SimpleAction<StarTransactions>
Link copied to clipboard
Link copied to clipboard
class RefundStarPaymentAction(telegramPaymentChargeId: String, userId: Long) : SimpleAction<Boolean>
Link copied to clipboard
class SendGiftAction(userId: Long, giftId: String, textParseMode: ParseMode? = null, text: () -> String? = null) : SimpleAction<Boolean> , EntitiesFeature<SendGiftAction>
Link copied to clipboard
class SetMyCommandsAction(languageCode: String? = null, scope: BotCommandScope? = null, commands: List<BotCommand>) : SimpleAction<Boolean>
Link copied to clipboard
class SetMyDescriptionAction(description: String? = null, languageCode: String? = null) : SimpleAction<Boolean>
Link copied to clipboard
class SetMyNameAction(name: String? = null, languageCode: String? = null) : SimpleAction<Boolean>
Link copied to clipboard
class SetMyShortDescriptionAction(shortDescription: String? = null, languageCode: String? = null) : SimpleAction<Boolean>
Link copied to clipboard
class SetUserEmojiStatusAction(userId: Long, emojiStatusCustomEmojiId: String? = null, emojiStatusExpirationDate: Instant? = null) : SimpleAction<Boolean>

Functions

Link copied to clipboard
inline fun close(): CloseAction

Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.

Link copied to clipboard
inline fun createInvoiceLink(title: String, description: String, currency: Currency, vararg prices: LabeledPrice, payload: () -> String): CreateInvoiceLinkAction

inline fun createInvoiceLink(title: String, description: String, payload: String, currency: Currency, prices: List<LabeledPrice>): CreateInvoiceLinkAction

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

Link copied to clipboard
inline fun deleteMyCommands(languageCode: String? = null, scope: BotCommandScope? = null): DeleteMyCommandsAction

Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.

Link copied to clipboard
inline fun deleteWebhook(dropPendingUpdates: Boolean = false): DeleteWebhookAction

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

Link copied to clipboard
inline fun editUserStarSubscription(userId: Long, telegramPaymentChargeId: String, isCanceled: Boolean): EditUserStarSubscriptionAction

Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars. Returns True on success.

Link copied to clipboard

Returns the list of gifts that can be sent by the bot to users. Requires no parameters. Returns a Gifts object.

Link copied to clipboard
inline fun getBusinessConnection(businessConnectionId: String): GetBusinessConnectionAction

Use this method to get information about the connection of the bot with a business account. Returns a BusinessConnection object on success.

Link copied to clipboard
inline fun getMe(): GetMeAction

A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.

Link copied to clipboard
inline fun getMyCommands(languageCode: String? = null, scope: BotCommandScope? = null): GetMyCommandsAction

Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.

Link copied to clipboard

Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.

Link copied to clipboard
inline fun getMyDescription(languageCode: String? = null): GetMyDescriptionAction

Use this method to get the current bot description for the given user language. Returns BotDescription on success.

Link copied to clipboard
inline fun getMyName(languageCode: String? = null): GetMyNameAction

Use this method to get the current bot name for the given user language. Returns BotName on success.

Link copied to clipboard
inline fun getMyShortDescription(languageCode: String? = null): GetMyShortDescriptionAction

Use this method to get the current bot short description for the given user language. Returns BotShortDescription on success.

Link copied to clipboard
inline fun getStarTransactions(offset: Int? = null, limit: Int? = null): GetStarTransactionsAction

Returns the bot's Telegram Star transactions in chronological order. On success, returns a StarTransactions object.

Link copied to clipboard

Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.

Link copied to clipboard

Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.

Link copied to clipboard
inline fun logOut(): LogOutAction

Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.

Link copied to clipboard
inline fun refundStarPayment(telegramPaymentChargeId: String, userId: Long): RefundStarPaymentAction

Refunds a successful payment in Telegram Stars. Returns True on success.

Link copied to clipboard

Stores a message that can be sent by a user of a Mini App. Returns a PreparedInlineMessage object.

Link copied to clipboard
inline fun sendGift(userId: Long, giftId: String, textParseMode: ParseMode? = null, noinline text: () -> String? = null): SendGiftAction

Sends a gift to the given user. The gift can't be converted to Telegram Stars by the user. Returns True on success.

Link copied to clipboard
inline fun setMyCommands(languageCode: String? = null, scope: BotCommandScope? = null, vararg command: BotCommand): SetMyCommandsAction
fun setMyCommands(languageCode: String? = null, scope: BotCommandScope? = null, block: BotCommandsBuilder.() -> Unit): SetMyCommandsAction

inline fun setMyCommands(languageCode: String? = null, scope: BotCommandScope? = null, command: List<BotCommand>): SetMyCommandsAction

Use this method to change the list of the bot's commands. See this manual for more details about bot commands. Returns True on success.

Link copied to clipboard

Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are free to modify the list before adding the bot. Returns True on success.

Link copied to clipboard
inline fun setMyDescription(description: String? = null, languageCode: String? = null): SetMyDescriptionAction

Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty. Returns True on success.

Link copied to clipboard
inline fun setMyName(name: String? = null, languageCode: String? = null): SetMyNameAction

Use this method to change the bot's name. Returns True on success.

Link copied to clipboard
inline fun setMyShortDescription(description: String? = null, languageCode: String? = null): SetMyShortDescriptionAction

Use this method to change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot. Returns True on success.

Link copied to clipboard
inline fun setUserEmojiStatus(userId: Long, emojiStatusCustomEmojiId: String? = null, emojiStatusExpirationDate: Instant? = null): SetUserEmojiStatusAction

Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method requestEmojiStatusAccess. Returns True on success.

Link copied to clipboard

Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success. If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header "X-Telegram-Bot-Api-Secret-Token" with the secret token as content.