TelegramBotApiClient

class TelegramBotApiClient

Types

Companion
Link copied to clipboard
common
object Companion

Functions

equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

apiHost
Link copied to clipboard
common
val apiHost: String
apiPort
Link copied to clipboard
common
val apiPort: Int
apiProtocol
Link copied to clipboard
common
val apiProtocol: URLProtocol
apiToken
Link copied to clipboard
common
val apiToken: String
httpClient
Link copied to clipboard
common
val httpClient: HttpClient

Extensions

addStickerToSet
Link copied to clipboard
common
suspend fun TelegramBotApiClient.addStickerToSet(requestBody: AddStickerToSetRequest): TelegramResponse<Boolean>
Use this method to add a new sticker to a set created by the bot.
suspend fun TelegramBotApiClient.addStickerToSet(userId: Int, name: String, pngSticker: String? = null, tgsSticker: String? = null, emojis: String, maskPosition: MaskPosition? = null): TelegramResponse<Boolean>
Use this method to add a new sticker to a set created by the bot.
answerCallbackQuery
Link copied to clipboard
common
suspend fun TelegramBotApiClient.answerCallbackQuery(requestBody: AnswerCallbackQueryRequest): TelegramResponse<Boolean>
Use this method to send answers to callback queries sent from inline keyboards.
suspend fun TelegramBotApiClient.answerCallbackQuery(callbackQueryId: String, text: String? = null, showAlert: Boolean = false, url: String? = null, cacheTime: Int? = null): TelegramResponse<Boolean>
Use this method to send answers to callback queries sent from inline keyboards.
answerInlineQuery
Link copied to clipboard
common
suspend fun TelegramBotApiClient.answerInlineQuery(requestBody: AnswerInlineQueryRequest): TelegramResponse<Boolean>
Use this method to send answers to an inline query.
suspend fun TelegramBotApiClient.answerInlineQuery(inlineQueryId: String, results: List<InlineQueryResult> = emptyList(), cacheTime: Int? = null, isPersonal: Boolean = false, nextOffset: String? = null, switchPmText: String? = null, switchPmParameter: String? = null): TelegramResponse<Boolean>
Use this method to send answers to an inline query.
answerPreCheckoutQuery
Link copied to clipboard
common
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query.
suspend fun TelegramBotApiClient.answerPreCheckoutQuery(preCheckoutQueryId: String, ok: Boolean, errorMessage: String? = null): TelegramResponse<Boolean>
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query.
answerShippingQuery
Link copied to clipboard
common
suspend fun TelegramBotApiClient.answerShippingQuery(requestBody: AnswerShippingQueryRequest): TelegramResponse<Boolean>
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot.
suspend fun TelegramBotApiClient.answerShippingQuery(shippingQueryId: String, ok: Boolean, shippingOptions: List<ShippingOption> = emptyList(), errorMessage: String? = null): TelegramResponse<Boolean>
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot.
close
Link copied to clipboard
common
suspend fun TelegramBotApiClient.close(): TelegramResponse<Boolean>
Use this method to close the bot instance before moving it from one local server to another.
copyMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.copyMessage(requestBody: CopyMessageRequest): TelegramResponse<MessageId>
Use this method to copy messages of any kind.
suspend fun TelegramBotApiClient.copyMessage(chatId: Int, fromChatId: Int, messageId: Int, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<MessageId>
Use this method to copy messages of any kind.
createNewStickerSet
Link copied to clipboard
common
suspend fun TelegramBotApiClient.createNewStickerSet(requestBody: CreateNewStickerSetRequest): TelegramResponse<Boolean>
Use this method to create a new sticker set owned by a user.
suspend fun TelegramBotApiClient.createNewStickerSet(userId: Int, name: String, title: String, pngSticker: String? = null, tgsSticker: String? = null, emojis: String, containsMasks: Boolean = false, maskPosition: MaskPosition? = null): TelegramResponse<Boolean>
Use this method to create a new sticker set owned by a user.
deleteChatPhoto
Link copied to clipboard
common
suspend fun TelegramBotApiClient.deleteChatPhoto(requestBody: DeleteChatPhotoRequest): TelegramResponse<Boolean>
Use this method to delete a chat photo.
suspend fun TelegramBotApiClient.deleteChatPhoto(chatId: Int): TelegramResponse<Boolean>
Use this method to delete a chat photo.
deleteChatStickerSet
Link copied to clipboard
common
Use this method to delete a group sticker set from a supergroup.
suspend fun TelegramBotApiClient.deleteChatStickerSet(chatId: Int): TelegramResponse<Boolean>
Use this method to delete a group sticker set from a supergroup.
deleteMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.deleteMessage(requestBody: DeleteMessageRequest): TelegramResponse<Boolean>
Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago.
suspend fun TelegramBotApiClient.deleteMessage(chatId: Int, messageId: Int): TelegramResponse<Boolean>
Use this method to delete a message, including service messages, with the following limitations: - A message can only be deleted if it was sent less than 48 hours ago.
deleteStickerFromSet
Link copied to clipboard
common
Use this method to delete a sticker from a set created by the bot.
suspend fun TelegramBotApiClient.deleteStickerFromSet(sticker: String): TelegramResponse<Boolean>
Use this method to delete a sticker from a set created by the bot.
deleteWebhook
Link copied to clipboard
common
suspend fun TelegramBotApiClient.deleteWebhook(requestBody: DeleteWebhookRequest): TelegramResponse<Boolean>
Use this method to remove webhook integration if you decide to switch back to getUpdates.
suspend fun TelegramBotApiClient.deleteWebhook(dropPendingUpdates: Boolean = false): TelegramResponse<Boolean>
Use this method to remove webhook integration if you decide to switch back to getUpdates.
editMessageCaption
Link copied to clipboard
common
suspend fun TelegramBotApiClient.editMessageCaption(requestBody: EditMessageCaptionRequest): TelegramResponse<Message>
Use this method to edit captions of messages.
suspend fun TelegramBotApiClient.editMessageCaption(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to edit captions of messages.
editMessageLiveLocation
Link copied to clipboard
common
Use this method to edit live location messages.
suspend fun TelegramBotApiClient.editMessageLiveLocation(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, latitude: Float, longitude: Float, horizontalAccuracy: Float? = null, heading: Int? = null, proximityAlertRadius: Int? = null, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to edit live location messages.
editMessageMedia
Link copied to clipboard
common
suspend fun TelegramBotApiClient.editMessageMedia(requestBody: EditMessageMediaRequest): TelegramResponse<Message>
Use this method to edit animation, audio, document, photo, or video messages.
suspend fun TelegramBotApiClient.editMessageMedia(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, media: InputMedia, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to edit animation, audio, document, photo, or video messages.
editMessageReplyMarkup
Link copied to clipboard
common
Use this method to edit only the reply markup of messages.
suspend fun TelegramBotApiClient.editMessageReplyMarkup(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to edit only the reply markup of messages.
editMessageText
Link copied to clipboard
common
suspend fun TelegramBotApiClient.editMessageText(requestBody: EditMessageTextRequest): TelegramResponse<Message>
Use this method to edit text and game messages.
suspend fun TelegramBotApiClient.editMessageText(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, text: String, parseMode: String? = null, entities: List<MessageEntity> = emptyList(), disableWebPagePreview: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to edit text and game messages.
exportChatInviteLink
Link copied to clipboard
common
Use this method to generate a new invite link for a chat; any previously generated link is revoked.
suspend fun TelegramBotApiClient.exportChatInviteLink(chatId: Int): TelegramResponse<String>
Use this method to generate a new invite link for a chat; any previously generated link is revoked.
forwardMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.forwardMessage(requestBody: ForwardMessageRequest): TelegramResponse<Message>
Use this method to forward messages of any kind.
suspend fun TelegramBotApiClient.forwardMessage(chatId: Int, fromChatId: Int, disableNotification: Boolean = false, messageId: Int): TelegramResponse<Message>
Use this method to forward messages of any kind.
getChat
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getChat(requestBody: GetChatRequest): TelegramResponse<Chat>
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
suspend fun TelegramBotApiClient.getChat(chatId: Int): TelegramResponse<Chat>
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.).
getChatAdministrators
Link copied to clipboard
common
Use this method to get a list of administrators in a chat.
suspend fun TelegramBotApiClient.getChatAdministrators(chatId: Int): TelegramResponse<List<ChatMember>>
Use this method to get a list of administrators in a chat.
getChatMember
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getChatMember(requestBody: GetChatMemberRequest): TelegramResponse<ChatMember>
Use this method to get information about a member of a chat.
suspend fun TelegramBotApiClient.getChatMember(chatId: Int, userId: Int): TelegramResponse<ChatMember>
Use this method to get information about a member of a chat.
getChatMembersCount
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getChatMembersCount(requestBody: GetChatMembersCountRequest): TelegramResponse<Int>
Use this method to get the number of members in a chat.
suspend fun TelegramBotApiClient.getChatMembersCount(chatId: Int): TelegramResponse<Int>
Use this method to get the number of members in a chat.
getFile
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getFile(requestBody: GetFileRequest): TelegramResponse<File>
Use this method to get basic info about a file and prepare it for downloading.
suspend fun TelegramBotApiClient.getFile(fileId: String): TelegramResponse<File>
Use this method to get basic info about a file and prepare it for downloading.
getGameHighScores
Link copied to clipboard
common
Use this method to get data for high score tables.
suspend fun TelegramBotApiClient.getGameHighScores(userId: Int, chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null): TelegramResponse<List<GameHighScore>>
Use this method to get data for high score tables.
getMe
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getMe(): TelegramResponse<User>
A simple method for testing your bot's auth token.
getMyCommands
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getMyCommands(): TelegramResponse<List<BotCommand>>
Use this method to get the current list of the bot's commands.
getStickerSet
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getStickerSet(requestBody: GetStickerSetRequest): TelegramResponse<StickerSet>
Use this method to get a sticker set.
suspend fun TelegramBotApiClient.getStickerSet(name: String): TelegramResponse<StickerSet>
Use this method to get a sticker set.
getUpdates
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getUpdates(requestBody: GetUpdatesRequest): TelegramResponse<List<Update>>
Use this method to receive incoming updates using long polling (wiki).
suspend fun TelegramBotApiClient.getUpdates(offset: Int? = null, limit: Int? = null, timeout: Int? = null, allowedUpdates: List<String> = emptyList()): TelegramResponse<List<Update>>
Use this method to receive incoming updates using long polling (wiki).
getUserProfilePhotos
Link copied to clipboard
common
Use this method to get a list of profile pictures for a user.
suspend fun TelegramBotApiClient.getUserProfilePhotos(userId: Int, offset: Int? = null, limit: Int? = null): TelegramResponse<UserProfilePhotos>
Use this method to get a list of profile pictures for a user.
getWebhookInfo
Link copied to clipboard
common
suspend fun TelegramBotApiClient.getWebhookInfo(): TelegramResponse<WebhookInfo>
Use this method to get current webhook status.
kickChatMember
Link copied to clipboard
common
suspend fun TelegramBotApiClient.kickChatMember(requestBody: KickChatMemberRequest): TelegramResponse<Boolean>
Use this method to kick a user from a group, a supergroup or a channel.
suspend fun TelegramBotApiClient.kickChatMember(chatId: Int, userId: Int, untilDate: Int? = null): TelegramResponse<Boolean>
Use this method to kick a user from a group, a supergroup or a channel.
leaveChat
Link copied to clipboard
common
suspend fun TelegramBotApiClient.leaveChat(requestBody: LeaveChatRequest): TelegramResponse<Boolean>
Use this method for your bot to leave a group, supergroup or channel.
suspend fun TelegramBotApiClient.leaveChat(chatId: Int): TelegramResponse<Boolean>
Use this method for your bot to leave a group, supergroup or channel.
logOut
Link copied to clipboard
common
suspend fun TelegramBotApiClient.logOut(): TelegramResponse<Boolean>
Use this method to log out from the cloud Bot API server before launching the bot locally.
pinChatMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.pinChatMessage(requestBody: PinChatMessageRequest): TelegramResponse<Boolean>
Use this method to add a message to the list of pinned messages in a chat.
suspend fun TelegramBotApiClient.pinChatMessage(chatId: Int, messageId: Int, disableNotification: Boolean = false): TelegramResponse<Boolean>
Use this method to add a message to the list of pinned messages in a chat.
promoteChatMember
Link copied to clipboard
common
suspend fun TelegramBotApiClient.promoteChatMember(requestBody: PromoteChatMemberRequest): TelegramResponse<Boolean>
Use this method to promote or demote a user in a supergroup or a channel.
suspend fun TelegramBotApiClient.promoteChatMember(chatId: Int, userId: Int, isAnonymous: Boolean = false, canChangeInfo: Boolean = false, canPostMessages: Boolean = false, canEditMessages: Boolean = false, canDeleteMessages: Boolean = false, canInviteUsers: Boolean = false, canRestrictMembers: Boolean = false, canPinMessages: Boolean = false, canPromoteMembers: Boolean = false): TelegramResponse<Boolean>
Use this method to promote or demote a user in a supergroup or a channel.
restrictChatMember
Link copied to clipboard
common
suspend fun TelegramBotApiClient.restrictChatMember(requestBody: RestrictChatMemberRequest): TelegramResponse<Boolean>
Use this method to restrict a user in a supergroup.
suspend fun TelegramBotApiClient.restrictChatMember(chatId: Int, userId: Int, permissions: ChatPermissions, untilDate: Int? = null): TelegramResponse<Boolean>
Use this method to restrict a user in a supergroup.
sendAnimation
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendAnimation(requestBody: SendAnimationRequest): TelegramResponse<Message>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
suspend fun TelegramBotApiClient.sendAnimation(chatId: Int, animation: String, duration: Int? = null, width: Int? = null, height: Int? = null, thumb: String? = null, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound).
sendAudio
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendAudio(requestBody: SendAudioRequest): TelegramResponse<Message>
Use this method to send audio files, if you want Telegram clients to display them in the music player.
suspend fun TelegramBotApiClient.sendAudio(chatId: Int, audio: String, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), duration: Int? = null, performer: String? = null, title: String? = null, thumb: String? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send audio files, if you want Telegram clients to display them in the music player.
sendChatAction
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendChatAction(requestBody: SendChatActionRequest): TelegramResponse<Boolean>
Use this method when you need to tell the user that something is happening on the bot's side.
suspend fun TelegramBotApiClient.sendChatAction(chatId: Int, action: String): TelegramResponse<Boolean>
Use this method when you need to tell the user that something is happening on the bot's side.
sendContact
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendContact(requestBody: SendContactRequest): TelegramResponse<Message>
Use this method to send phone contacts.
suspend fun TelegramBotApiClient.sendContact(chatId: Int, phoneNumber: String, firstName: String, lastName: String? = null, vcard: String? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send phone contacts.
sendDice
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendDice(requestBody: SendDiceRequest): TelegramResponse<Message>
Use this method to send an animated emoji that will display a random value.
suspend fun TelegramBotApiClient.sendDice(chatId: Int, emoji: String? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send an animated emoji that will display a random value.
sendDocument
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendDocument(requestBody: SendDocumentRequest): TelegramResponse<Message>
Use this method to send general files.
suspend fun TelegramBotApiClient.sendDocument(chatId: Int, document: String, thumb: String? = null, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), disableContentTypeDetection: Boolean = false, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send general files.
sendGame
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendGame(requestBody: SendGameRequest): TelegramResponse<Message>
Use this method to send a game.
suspend fun TelegramBotApiClient.sendGame(chatId: Int, gameShortName: String, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to send a game.
sendInvoice
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendInvoice(requestBody: SendInvoiceRequest): TelegramResponse<Message>
Use this method to send invoices.
suspend fun TelegramBotApiClient.sendInvoice(chatId: Int, title: String, description: String, payload: String, providerToken: String, startParameter: String, currency: String, prices: List<LabeledPrice> = emptyList(), providerData: String? = null, photoUrl: String? = null, photoSize: Int? = null, photoWidth: Int? = null, photoHeight: Int? = null, needName: Boolean = false, needPhoneNumber: Boolean = false, needEmail: Boolean = false, needShippingAddress: Boolean = false, sendPhoneNumberToProvider: Boolean = false, sendEmailToProvider: Boolean = false, isFlexible: Boolean = false, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to send invoices.
sendLocation
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendLocation(requestBody: SendLocationRequest): TelegramResponse<Message>
Use this method to send point on the map.
suspend fun TelegramBotApiClient.sendLocation(chatId: Int, latitude: Float, longitude: Float, horizontalAccuracy: Float? = null, livePeriod: Int? = null, heading: Int? = null, proximityAlertRadius: Int? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send point on the map.
sendMediaGroup
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendMediaGroup(requestBody: SendMediaGroupRequest): TelegramResponse<List<Message>>
Use this method to send a group of photos, videos, documents or audios as an album.
suspend fun TelegramBotApiClient.sendMediaGroup(chatId: Int, media: List<InputMedia> = emptyList(), disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false): TelegramResponse<List<Message>>
Use this method to send a group of photos, videos, documents or audios as an album.
sendMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendMessage(requestBody: SendMessageRequest): TelegramResponse<Message>
Use this method to send text messages.
suspend fun TelegramBotApiClient.sendMessage(chatId: Int, text: String, parseMode: String? = null, entities: List<MessageEntity> = emptyList(), disableWebPagePreview: Boolean = false, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send text messages.
sendPhoto
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendPhoto(requestBody: SendPhotoRequest): TelegramResponse<Message>
Use this method to send photos.
suspend fun TelegramBotApiClient.sendPhoto(chatId: Int, photo: String, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send photos.
sendPoll
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendPoll(requestBody: SendPollRequest): TelegramResponse<Message>
Use this method to send a native poll.
suspend fun TelegramBotApiClient.sendPoll(chatId: Int, question: String, options: List<String> = emptyList(), isAnonymous: Boolean = false, type: String? = null, allowsMultipleAnswers: Boolean = false, correctOptionId: Int? = null, explanation: String? = null, explanationParseMode: String? = null, explanationEntities: List<MessageEntity> = emptyList(), openPeriod: Int? = null, closeDate: Int? = null, isClosed: Boolean = false, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send a native poll.
sendSticker
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendSticker(requestBody: SendStickerRequest): TelegramResponse<Message>
Use this method to send static .WEBP or animated .TGS stickers.
suspend fun TelegramBotApiClient.sendSticker(chatId: Int, sticker: String, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send static .WEBP or animated .TGS stickers.
sendVenue
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendVenue(requestBody: SendVenueRequest): TelegramResponse<Message>
Use this method to send information about a venue.
suspend fun TelegramBotApiClient.sendVenue(chatId: Int, latitude: Float, longitude: Float, title: String, address: String, foursquareId: String? = null, foursquareType: String? = null, googlePlaceId: String? = null, googlePlaceType: String? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send information about a venue.
sendVideo
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendVideo(requestBody: SendVideoRequest): TelegramResponse<Message>
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
suspend fun TelegramBotApiClient.sendVideo(chatId: Int, video: String, duration: Int? = null, width: Int? = null, height: Int? = null, thumb: String? = null, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), supportsStreaming: Boolean = false, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document).
sendVideoNote
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendVideoNote(requestBody: SendVideoNoteRequest): TelegramResponse<Message>
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
suspend fun TelegramBotApiClient.sendVideoNote(chatId: Int, videoNote: String, duration: Int? = null, length: Int? = null, thumb: String? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
sendVoice
Link copied to clipboard
common
suspend fun TelegramBotApiClient.sendVoice(requestBody: SendVoiceRequest): TelegramResponse<Message>
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
suspend fun TelegramBotApiClient.sendVoice(chatId: Int, voice: String, caption: String? = null, parseMode: String? = null, captionEntities: List<MessageEntity> = emptyList(), duration: Int? = null, disableNotification: Boolean = false, replyToMessageId: Int? = null, allowSendingWithoutReply: Boolean = false, replyMarkup: ReplyMarkup? = null): TelegramResponse<Message>
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message.
setChatAdministratorCustomTitle
Link copied to clipboard
common
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
suspend fun TelegramBotApiClient.setChatAdministratorCustomTitle(chatId: Int, userId: Int, customTitle: String): TelegramResponse<Boolean>
Use this method to set a custom title for an administrator in a supergroup promoted by the bot.
setChatDescription
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setChatDescription(requestBody: SetChatDescriptionRequest): TelegramResponse<Boolean>
Use this method to change the description of a group, a supergroup or a channel.
suspend fun TelegramBotApiClient.setChatDescription(chatId: Int, description: String? = null): TelegramResponse<Boolean>
Use this method to change the description of a group, a supergroup or a channel.
setChatPermissions
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setChatPermissions(requestBody: SetChatPermissionsRequest): TelegramResponse<Boolean>
Use this method to set default chat permissions for all members.
suspend fun TelegramBotApiClient.setChatPermissions(chatId: Int, permissions: ChatPermissions): TelegramResponse<Boolean>
Use this method to set default chat permissions for all members.
setChatPhoto
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setChatPhoto(requestBody: SetChatPhotoRequest): TelegramResponse<Boolean>
Use this method to set a new profile photo for the chat.
suspend fun TelegramBotApiClient.setChatPhoto(chatId: Int, photo: String): TelegramResponse<Boolean>
Use this method to set a new profile photo for the chat.
setChatStickerSet
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setChatStickerSet(requestBody: SetChatStickerSetRequest): TelegramResponse<Boolean>
Use this method to set a new group sticker set for a supergroup.
suspend fun TelegramBotApiClient.setChatStickerSet(chatId: Int, stickerSetName: String): TelegramResponse<Boolean>
Use this method to set a new group sticker set for a supergroup.
setChatTitle
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setChatTitle(requestBody: SetChatTitleRequest): TelegramResponse<Boolean>
Use this method to change the title of a chat.
suspend fun TelegramBotApiClient.setChatTitle(chatId: Int, title: String): TelegramResponse<Boolean>
Use this method to change the title of a chat.
setGameScore
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setGameScore(requestBody: SetGameScoreRequest): TelegramResponse<Message>
Use this method to set the score of the specified user in a game.
suspend fun TelegramBotApiClient.setGameScore(userId: Int, score: Int, force: Boolean = false, disableEditMessage: Boolean = false, chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null): TelegramResponse<Message>
Use this method to set the score of the specified user in a game.
setMyCommands
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setMyCommands(requestBody: SetMyCommandsRequest): TelegramResponse<Boolean>
Use this method to change the list of the bot's commands.
suspend fun TelegramBotApiClient.setMyCommands(commands: List<BotCommand> = emptyList()): TelegramResponse<Boolean>
Use this method to change the list of the bot's commands.
setPassportDataErrors
Link copied to clipboard
common
Informs a user that some of the Telegram Passport elements they provided contains errors.
suspend fun TelegramBotApiClient.setPassportDataErrors(userId: Int, errors: List<PassportElementError> = emptyList()): TelegramResponse<Boolean>
Informs a user that some of the Telegram Passport elements they provided contains errors.
setStickerPositionInSet
Link copied to clipboard
common
Use this method to move a sticker in a set created by the bot to a specific position.
suspend fun TelegramBotApiClient.setStickerPositionInSet(sticker: String, position: Int): TelegramResponse<Boolean>
Use this method to move a sticker in a set created by the bot to a specific position.
setStickerSetThumb
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setStickerSetThumb(requestBody: SetStickerSetThumbRequest): TelegramResponse<Boolean>
Use this method to set the thumbnail of a sticker set.
suspend fun TelegramBotApiClient.setStickerSetThumb(name: String, userId: Int, thumb: String? = null): TelegramResponse<Boolean>
Use this method to set the thumbnail of a sticker set.
setWebhook
Link copied to clipboard
common
suspend fun TelegramBotApiClient.setWebhook(requestBody: SetWebhookRequest): TelegramResponse<Boolean>
Use this method to specify a url and receive incoming updates via an outgoing webhook.
suspend fun TelegramBotApiClient.setWebhook(url: String, certificate: String? = null, ipAddress: String? = null, maxConnections: Int? = null, allowedUpdates: List<String> = emptyList(), dropPendingUpdates: Boolean = false): TelegramResponse<Boolean>
Use this method to specify a url and receive incoming updates via an outgoing webhook.
stopMessageLiveLocation
Link copied to clipboard
common
Use this method to stop updating a live location message before live_period expires.
suspend fun TelegramBotApiClient.stopMessageLiveLocation(chatId: Int? = null, messageId: Int? = null, inlineMessageId: String? = null, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Message>
Use this method to stop updating a live location message before live_period expires.
stopPoll
Link copied to clipboard
common
suspend fun TelegramBotApiClient.stopPoll(requestBody: StopPollRequest): TelegramResponse<Poll>
Use this method to stop a poll which was sent by the bot.
suspend fun TelegramBotApiClient.stopPoll(chatId: Int, messageId: Int, replyMarkup: InlineKeyboardMarkup? = null): TelegramResponse<Poll>
Use this method to stop a poll which was sent by the bot.
unbanChatMember
Link copied to clipboard
common
suspend fun TelegramBotApiClient.unbanChatMember(requestBody: UnbanChatMemberRequest): TelegramResponse<Boolean>
Use this method to unban a previously kicked user in a supergroup or channel.
suspend fun TelegramBotApiClient.unbanChatMember(chatId: Int, userId: Int, onlyIfBanned: Boolean = false): TelegramResponse<Boolean>
Use this method to unban a previously kicked user in a supergroup or channel.
unpinAllChatMessages
Link copied to clipboard
common
Use this method to clear the list of pinned messages in a chat.
suspend fun TelegramBotApiClient.unpinAllChatMessages(chatId: Int): TelegramResponse<Boolean>
Use this method to clear the list of pinned messages in a chat.
unpinChatMessage
Link copied to clipboard
common
suspend fun TelegramBotApiClient.unpinChatMessage(requestBody: UnpinChatMessageRequest): TelegramResponse<Boolean>
Use this method to remove a message from the list of pinned messages in a chat.
suspend fun TelegramBotApiClient.unpinChatMessage(chatId: Int, messageId: Int? = null): TelegramResponse<Boolean>
Use this method to remove a message from the list of pinned messages in a chat.
uploadStickerFile
Link copied to clipboard
common
suspend fun TelegramBotApiClient.uploadStickerFile(requestBody: UploadStickerFileRequest): TelegramResponse<File>
Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).
suspend fun TelegramBotApiClient.uploadStickerFile(userId: Int, pngSticker: String): TelegramResponse<File>
Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times).