libtd-ktx / kotlinx.telegram.extensions / MessageKtx
MessageKtx
interface MessageKtx : BaseKtx
Interface for access TdApi.Message extension functions. Can be used alongside with other extension interfaces of the package. Must contain TelegramFlow instance field to access its functionality
Properties
| api | Instance of the TelegramFlow connecting extensions to the Telegram Clientabstract val api: TelegramFlow |
Functions
| deleteChatReplyMarkup | Suspend function, which deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed.open suspend fun Message.deleteChatReplyMarkup(chatId: Long): Unit |
| editCaption | Suspend function, which edits the message content caption. Returns the edited message after the edit is completed on the server side.open suspend fun Message.editCaption(chatId: Long, replyMarkup: ReplyMarkup?, caption: FormattedText?): Message |
| editLiveLocation | Suspend function, which edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side.open suspend fun Message.editLiveLocation(chatId: Long, replyMarkup: ReplyMarkup?, location: Location? = null): Message |
| editMedia | Suspend function, which edits the content of a message with an animation, an audio, a document, a photo or a video. The media in the message can’t be replaced if the message was set to self-destruct. Media can’t be replaced by self-destructing media. Media in an album can be edited only to contain a photo or a video. Returns the edited message after the edit is completed on the server side.open suspend fun Message.editMedia(chatId: Long, replyMarkup: ReplyMarkup?, inputMessageContent: InputMessageContent?): Message |
| editReplyMarkup | Suspend function, which edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side.open suspend fun Message.editReplyMarkup(chatId: Long, replyMarkup: ReplyMarkup?): Message |
| editSchedulingState | Suspend function, which edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed.open suspend fun Message.editSchedulingState(chatId: Long, schedulingState: MessageSchedulingState?): Unit |
| editText | Suspend function, which edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side.open suspend fun Message.editText(chatId: Long, replyMarkup: ReplyMarkup?, inputMessageContent: InputMessageContent?): Message |
| get | Suspend function, which returns information about a message.open suspend fun Message.get(chatId: Long): Message |
| getCallbackQueryAnswer | Suspend function, which sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires.open suspend fun Message.getCallbackQueryAnswer(chatId: Long, payload: CallbackQueryPayload?): CallbackQueryAnswer |
| getGameHighScores | Suspend function, which returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only.open suspend fun Message.getGameHighScores(chatId: Long, userId: Int): GameHighScores |
| getLink | Suspend function, which returns a private HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels. The link will work only for members of the chat.open suspend fun Message.getLink(chatId: Long): HttpUrl |
| getLocally | Suspend function, which returns information about a message, if it is available locally without sending network request. This is an offline request.open suspend fun Message.getLocally(chatId: Long): Message |
| getLoginUrl | Suspend function, which returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button.open suspend fun Message.getLoginUrl(chatId: Long, buttonId: Int, allowWriteAccess: Boolean): HttpUrl |
| getLoginUrlInfo | Suspend function, which returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button.open suspend fun Message.getLoginUrlInfo(chatId: Long, buttonId: Int): LoginUrlInfo |
| getPaymentForm | Suspend function, which returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy.open suspend fun Message.getPaymentForm(chatId: Long): PaymentForm |
| getPaymentReceipt | Suspend function, which returns information about a successful payment.open suspend fun Message.getPaymentReceipt(chatId: Long): PaymentReceipt |
| getPollVoters | Suspend function, which returns users voted for the specified option in a non-anonymous polls. For the optimal performance the number of returned users is chosen by the library.open suspend fun Message.getPollVoters(chatId: Long, optionId: Int, offset: Int, limit: Int): Users |
| getPublicLink | Suspend function, which returns a public HTTPS link to a message. Available only for messages in supergroups and channels with a username.open suspend fun Message.getPublicLink(chatId: Long, forAlbum: Boolean): PublicMessageLink |
| getReplied | Suspend function, which returns information about a message that is replied by given message.open suspend fun Message.getReplied(chatId: Long): Message |
| openContent | Suspend function, which informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed.open suspend fun Message.openContent(chatId: Long): Unit |
| pinChat | Suspend function, which pins a message in a chat; requires canPinMessages rights.open suspend fun Message.pinChat(chatId: Long, disableNotification: Boolean): Unit |
| sendPaymentForm | Suspend function, which sends a filled-out payment form to the bot for final verification.open suspend fun Message.sendPaymentForm(chatId: Long, orderInfoId: String?, shippingOptionId: String?, credentials: InputCredentials?): PaymentResult |
| setGameScore | Suspend function, which updates the game score of the specified user in the game; for bots only.open suspend fun Message.setGameScore(chatId: Long, editMessage: Boolean, userId: Int, score: Int, force: Boolean): Message |
| setPollAnswer | Suspend function, which changes the user answer to a poll. A poll in quiz mode can be answered only once.open suspend fun Message.setPollAnswer(chatId: Long, optionIds: IntArray?): Unit |
| stopPoll | Suspend function, which stops a poll. A poll in a message can be stopped when the message has canBeEdited flag set.open suspend fun Message.stopPoll(chatId: Long, replyMarkup: ReplyMarkup?): Unit |
| validateOrderInfo | Suspend function, which validates the order information provided by a user and returns the available shipping options for a flexible invoice.open suspend fun Message.validateOrderInfo(chatId: Long, orderInfo: OrderInfo?, allowSave: Boolean): ValidatedOrderInfo |
Inheritors
| TelegramKtx | Interface for access all Telegram objects extension functions. Contains 182 extensionsinterface TelegramKtx : BasicGroupKtx, CallKtx, ChatKtx, FileKtx, MessageKtx, NotificationGroupKtx, ProxyKtx, SecretChatKtx, SupergroupKtx, UserKtx, CommonKtx |