mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-15 05:09:30 +00:00
update stickers
This commit is contained in:
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
@@ -39,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
@@ -47,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
@@ -67,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
@@ -75,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
@@ -106,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, keywords
|
||||
user.id, stickerSet, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, maskPosition
|
||||
user.id, stickerSet, sticker, format, emojis, maskPosition
|
||||
)
|
||||
|
@@ -6,6 +6,7 @@ import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.requests.stickers.ReplaceStickerInSet
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
@@ -46,6 +47,7 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
@@ -55,15 +57,18 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
@@ -76,6 +81,7 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
@@ -85,16 +91,19 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
@@ -119,10 +128,11 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, emojis, keywords
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
@@ -130,8 +140,9 @@ suspend fun TelegramBot.replaceStickerInSet(
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, emojis, maskPosition
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition
|
||||
)
|
||||
|
Reference in New Issue
Block a user