1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

add several extensions for addStickerToSet

This commit is contained in:
InsanusMokrassar 2023-03-11 17:58:48 +06:00
parent 810b2ab5a1
commit 6722ab5f50

View File

@ -18,6 +18,16 @@ suspend fun TelegramBot.addStickerToSet(
AddStickerToSet(userId, stickerSetName, inputSticker) AddStickerToSet(userId, stickerSetName, inputSticker)
) )
suspend fun TelegramBot.addStickerToSet(
userId: UserId,
stickerSet: StickerSet,
sticker: InputSticker
) = addStickerToSet(
userId,
stickerSet.name,
sticker
)
suspend fun TelegramBot.addStickerToSet( suspend fun TelegramBot.addStickerToSet(
userId: UserId, userId: UserId,
stickerSet: StickerSet, stickerSet: StickerSet,
@ -26,7 +36,7 @@ suspend fun TelegramBot.addStickerToSet(
keywords: List<String> = emptyList() keywords: List<String> = emptyList()
) = addStickerToSet( ) = addStickerToSet(
userId, userId,
stickerSet.name, stickerSet,
when (stickerSet.stickerType) { when (stickerSet.stickerType) {
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji( StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
sticker, 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( suspend fun TelegramBot.addStickerToSet(
user: CommonUser, user: CommonUser,
stickerSet: StickerSet, stickerSet: StickerSet,