1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-05 08:09:21 +00:00

support of new stickers API

This commit is contained in:
2024-04-18 15:50:21 +06:00
parent 5f4a327c2e
commit 84abd006ad
7 changed files with 64 additions and 228 deletions

View File

@@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
userId: UserId,
name: String,
title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>,
needsRepainting: Boolean = false
) = execute(
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting)
CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
)
@@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
user: CommonUser,
name: String,
title: String,
stickersFormat: StickerFormat,
stickers: List<InputSticker>,
needsRepainting: Boolean = false,
) = createNewStickerSet(
user.id, name, title, stickersFormat, stickers, needsRepainting
user.id, name, title, stickers, needsRepainting
)

View File

@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
import dev.inmo.tgbotapi.types.StickerFormat
import dev.inmo.tgbotapi.types.StickerSetName
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.UserId
@@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId,
stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: FileId
) = execute(
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
)
suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId,
stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: MultipartFile
) = execute(
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
)
suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser,
stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: FileId
) = setStickerSetThumbnail(
user.id, stickerSetName, thumbnail
user.id, stickerSetName, format, thumbnail
)
suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser,
stickerSetName: StickerSetName,
format: StickerFormat,
thumbnail: MultipartFile
) = setStickerSetThumbnail(
user.id, stickerSetName, thumbnail
user.id, stickerSetName, format, thumbnail
)
suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId,
stickerSet: StickerSet,
format: StickerFormat,
thumbnail: FileId
) = setStickerSetThumbnail(
userId, stickerSet.name, thumbnail
userId, stickerSet.name, format, thumbnail
)
suspend fun TelegramBot.setStickerSetThumbnail(
userId: UserId,
stickerSet: StickerSet,
format: StickerFormat,
thumbnail: MultipartFile
) = setStickerSetThumbnail(
userId, stickerSet.name, thumbnail
userId, stickerSet.name, format, thumbnail
)
suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser,
stickerSet: StickerSet,
format: StickerFormat,
thumbnail: FileId
) = setStickerSetThumbnail(
user.id, stickerSet, thumbnail
user.id, stickerSet, format, thumbnail
)
suspend fun TelegramBot.setStickerSetThumbnail(
user: CommonUser,
stickerSet: StickerSet,
format: StickerFormat,
thumbnail: MultipartFile
) = setStickerSetThumbnail(
user.id, stickerSet, thumbnail
user.id, stickerSet, format, thumbnail
)