sendDice in extensions api

This commit is contained in:
InsanusMokrassar 2020-03-30 21:33:17 +06:00
parent c3fca5c6c4
commit 8ef7acab2d
2 changed files with 26 additions and 0 deletions

View File

@ -31,6 +31,8 @@
* Request `SendDice` was added (calling [sendDice](https://core.telegram.org/bots/api#senddice))
* Class `Dice` was added (type [dice](https://core.telegram.org/bots/api#dice))
* Class `DiceContent` was added (for including it in [message](https://core.telegram.org/bots/api#message) object)
* `TelegramBotAPI-extensions-api`:
* Extensions `sendDice` was added
### 0.25.1

View File

@ -0,0 +1,24 @@
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendDice
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
suspend fun RequestsExecutor.sendDice(
chatId: ChatIdentifier,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendDice(chatId, disableNotification, replyToMessageId, replyMarkup)
)
suspend fun RequestsExecutor.sendDice(
chat: Chat,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendDice(chat.id, disableNotification, replyToMessageId, replyMarkup)