From 6722ab5f5089609fefd813de0f077cd5c3c7aad7 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 11 Mar 2023 17:58:48 +0600 Subject: [PATCH] add several extensions for addStickerToSet --- .../api/stickers/AddStickerToSet.kt | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt index 275d372f8a..18cb4d47af 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSet.kt @@ -18,6 +18,16 @@ suspend fun TelegramBot.addStickerToSet( AddStickerToSet(userId, stickerSetName, inputSticker) ) +suspend fun TelegramBot.addStickerToSet( + userId: UserId, + stickerSet: StickerSet, + sticker: InputSticker +) = addStickerToSet( + userId, + stickerSet.name, + sticker +) + suspend fun TelegramBot.addStickerToSet( userId: UserId, stickerSet: StickerSet, @@ -26,7 +36,7 @@ suspend fun TelegramBot.addStickerToSet( keywords: List = emptyList() ) = addStickerToSet( userId, - stickerSet.name, + stickerSet, when (stickerSet.stickerType) { StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji( sticker, @@ -75,6 +85,16 @@ suspend fun TelegramBot.addStickerToSet( } ) +suspend fun TelegramBot.addStickerToSet( + user: CommonUser, + stickerSet: StickerSet, + sticker: InputSticker +) = addStickerToSet( + user.id, + stickerSet.name, + sticker +) + suspend fun TelegramBot.addStickerToSet( user: CommonUser, stickerSet: StickerSet,