1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

added EntitiesBuilder.botCommand and EntitiesBuilder.botCommandln overloads supporting BotCommand

This commit is contained in:
d1snin 2022-10-12 20:57:42 +03:00
parent 4f75bc792d
commit 9405aa4467
No known key found for this signature in database
GPG Key ID: 2B2D54531207CA16

View File

@ -3,6 +3,7 @@
package dev.inmo.tgbotapi.utils package dev.inmo.tgbotapi.utils
import dev.inmo.micro_utils.common.joinTo import dev.inmo.micro_utils.common.joinTo
import dev.inmo.tgbotapi.types.BotCommand
import dev.inmo.tgbotapi.types.CustomEmojiId import dev.inmo.tgbotapi.types.CustomEmojiId
import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.message.textsources.* import dev.inmo.tgbotapi.types.message.textsources.*
@ -148,6 +149,15 @@ inline fun EntitiesBuilder.botCommand(command: String) = add(dev.inmo.tgbotapi.t
* Version of [EntitiesBuilder.botCommand] with new line at the end * Version of [EntitiesBuilder.botCommand] with new line at the end
*/ */
inline fun EntitiesBuilder.botCommandln(command: String) = botCommand(command) + newLine inline fun EntitiesBuilder.botCommandln(command: String) = botCommand(command) + newLine
/**
* Add botCommand using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.botCommand]
*/
inline fun EntitiesBuilder.botCommand(botCommand: BotCommand) = add(dev.inmo.tgbotapi.types.message.textsources.botCommand(botCommand.command))
/**
* Version of [EntitiesBuilder.botCommand] with new line at the end
*/
inline fun EntitiesBuilder.botCommandln(botCommand: BotCommand) = botCommand(botCommand.command) + newLine
/** /**