1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-27 02:57:13 +00:00

AnswerCallbackQuery simple sending extensions

This commit is contained in:
InsanusMokrassar 2020-02-06 12:12:20 +06:00
parent ab6688bbaa
commit 601958a513

View File

@ -1,5 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.requests.answers
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery.CallbackQuery
@ -32,3 +33,19 @@ fun CallbackQuery.createAnswer(
url: String? = null,
cachedTimeSeconds: Int? = null
): AnswerCallbackQuery = AnswerCallbackQuery(id, text, showAlert, url, cachedTimeSeconds)
suspend fun RequestsExecutor.sendCallbackQueryAnswer(
callbackQueryId: CallbackQueryIdentifier,
text: String? = null,
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
) = execute(AnswerCallbackQuery(callbackQueryId, text, showAlert, url, cachedTimeSeconds))
suspend fun RequestsExecutor.sendCallbackQueryAnswer(
callbackQuery: CallbackQuery,
text: String? = null,
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
) = sendCallbackQueryAnswer(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)