From 841ae73f7c7eb88109f457b0714904c782617221 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 17 Feb 2021 17:10:21 +0600 Subject: [PATCH] replyWithDice --- CHANGELOG.md | 4 +++- .../dev/inmo/tgbotapi/extensions/api/send/SendDice.kt | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 677ec2f80b..47cf1ffcc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,12 @@ * `Common`: * `Version`: * `MicroUtils`: `0.4.24` -> `0.4.25` +* `Extensions API`: + * New extension `TelegramBot#replyWithDice` * `Extensions Utils`: * `SlotMachineReelImages` has been renamed to `SlotMachineReelImage` * `SlotMachineReelImage` got two built-in parameters: `text` and `number` - * New extension `String.asSlotMachineReelImage` + * New extension `String#asSlotMachineReelImage` ## 0.32.5 diff --git a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt index 250f55d88a..ff3ee673d4 100644 --- a/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt +++ b/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/SendDice.kt @@ -29,10 +29,18 @@ suspend fun TelegramBot.sendDice( replyMarkup: KeyboardMarkup? = null ) = sendDice(chat.id, animationType, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup) -suspend inline fun TelegramBot.reply( +suspend inline fun TelegramBot.replyWithDice( to: Message, animationType: DiceAnimationType? = null, disableNotification: Boolean = false, allowSendingWithoutReply: Boolean? = null, replyMarkup: KeyboardMarkup? = null ) = sendDice(to.chat, animationType, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup) + +suspend inline fun TelegramBot.reply( + to: Message, + animationType: DiceAnimationType? = null, + disableNotification: Boolean = false, + allowSendingWithoutReply: Boolean? = null, + replyMarkup: KeyboardMarkup? = null +) = replyWithDice(to, animationType, disableNotification, allowSendingWithoutReply, replyMarkup)