Package-level declarations

Types

Link copied to clipboard
class DeleteMessageAction(messageId: Long) : Action<Boolean>
Link copied to clipboard
class DeleteMessagesAction(messageIds: List<Long>) : Action<Boolean>

Functions

Link copied to clipboard
inline fun copyMessage(fromChatId: User, messageId: Long): CopyMessageAction
inline fun copyMessage(fromChatId: Chat, messageId: Long): CopyMessageAction
inline fun copyMessage(fromChatId: Long, messageId: Long): CopyMessageAction
inline fun copyMessage(fromChatId: String, messageId: Long): CopyMessageAction

inline fun copyMessage(fromChatId: Identifier, messageId: Long): CopyMessageAction

Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

Link copied to clipboard
inline fun copyMessages(fromChatId: User, vararg messageId: Long): CopyMessagesAction
inline fun copyMessages(fromChatId: Chat, vararg messageId: Long): CopyMessagesAction
inline fun copyMessages(fromChatId: Long, vararg messageId: Long): CopyMessagesAction
inline fun copyMessages(fromChatId: String, vararg messageId: Long): CopyMessagesAction

inline fun copyMessages(fromChatId: Identifier, messageIds: List<Long>): CopyMessagesAction

Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an array of MessageId of the sent messages is returned.

Link copied to clipboard
inline fun deleteMessage(messageId: Long): DeleteMessageAction

Use this method to delete a message, including service messages, with the following limitations:

Link copied to clipboard
inline fun deleteMessages(vararg messageId: Long): DeleteMessagesAction

inline fun deleteMessages(messageIds: List<Long>): DeleteMessagesAction

Use this method to delete multiple messages simultaneously. If some of the specified messages can't be found, they are skipped. Returns True on success.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

Link copied to clipboard

inline fun editMessageLiveLocation(messageId: Long, latitude: Float, longitude: Float): EditMessageLiveLocationAction

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

Link copied to clipboard

inline fun editMessageMedia(messageId: Long, inputMedia: InputMedia): EditMessageMediaAction

Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

Link copied to clipboard

Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

Link copied to clipboard

inline fun editMessageText(messageId: Long, block: () -> String): EditMessageTextAction

Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within 48 hours from the time they were sent.

Link copied to clipboard
Link copied to clipboard
inline fun forwardMessage(fromChatId: User, messageId: Long): ForwardMessageAction
inline fun forwardMessage(fromChatId: Chat, messageId: Long): ForwardMessageAction
inline fun forwardMessage(fromChatId: Long, messageId: Long): ForwardMessageAction
inline fun forwardMessage(fromChatId: String, messageId: Long): ForwardMessageAction

inline fun forwardMessage(fromChatId: Identifier, messageId: Long): ForwardMessageAction

Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.

Link copied to clipboard
inline fun forwardMessages(fromChatId: User, vararg messageId: Long): ForwardMessagesAction
inline fun forwardMessages(fromChatId: Chat, vararg messageId: Long): ForwardMessagesAction
inline fun forwardMessages(fromChatId: Long, vararg messageId: Long): ForwardMessagesAction
inline fun forwardMessages(fromChatId: String, vararg messageId: Long): ForwardMessagesAction

inline fun forwardMessages(fromChatId: Identifier, messageIds: List<Long>): ForwardMessagesAction

Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an array of MessageId of the sent messages is returned.

Link copied to clipboard

inline fun message(text: String): SendMessageAction

Use this method to send text messages. On success, the sent Message is returned.