mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
real fix:)
This commit is contained in:
parent
55ed3e165b
commit
013944c5c9
@ -1,4 +1,4 @@
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.stickers
|
||||
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.thumbs
|
||||
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
||||
@ -10,65 +10,65 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.stickers.StickerSet
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
sticker: FileId
|
||||
thumbSetName: String,
|
||||
thumb: FileId
|
||||
) = execute(
|
||||
SetStickerSetThumb(userId, stickerSetName, sticker)
|
||||
SetStickerSetThumb(userId, thumbSetName, thumb)
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
sticker: MultipartFile
|
||||
thumbSetName: String,
|
||||
thumb: MultipartFile
|
||||
) = execute(
|
||||
SetStickerSetThumb(userId, stickerSetName, sticker)
|
||||
SetStickerSetThumb(userId, thumbSetName, thumb)
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
user: CommonUser,
|
||||
stickerSetName: String,
|
||||
sticker: FileId
|
||||
thumbSetName: String,
|
||||
thumb: FileId
|
||||
) = setStickerSetThumb(
|
||||
user.id, stickerSetName, sticker
|
||||
user.id, thumbSetName, thumb
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
user: CommonUser,
|
||||
stickerSetName: String,
|
||||
sticker: MultipartFile
|
||||
thumbSetName: String,
|
||||
thumb: MultipartFile
|
||||
) = setStickerSetThumb(
|
||||
user.id, stickerSetName, sticker
|
||||
user.id, thumbSetName, thumb
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: FileId
|
||||
thumbSet: StickerSet,
|
||||
thumb: FileId
|
||||
) = setStickerSetThumb(
|
||||
userId, stickerSet.name, sticker
|
||||
userId, thumbSet.name, thumb
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: MultipartFile
|
||||
thumbSet: StickerSet,
|
||||
thumb: MultipartFile
|
||||
) = setStickerSetThumb(
|
||||
userId, stickerSet.name, sticker
|
||||
userId, thumbSet.name, thumb
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: FileId
|
||||
thumbSet: StickerSet,
|
||||
thumb: FileId
|
||||
) = setStickerSetThumb(
|
||||
user.id, stickerSet.name, sticker
|
||||
user.id, thumbSet.name, thumb
|
||||
)
|
||||
|
||||
suspend fun RequestsExecutor.setStickerSetThumb(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: MultipartFile
|
||||
thumbSet: StickerSet,
|
||||
thumb: MultipartFile
|
||||
) = setStickerSetThumb(
|
||||
user.id, stickerSet.name, sticker
|
||||
user.id, thumbSet.name, thumb
|
||||
)
|
||||
|
||||
|
@ -7,22 +7,18 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import kotlinx.serialization.*
|
||||
|
||||
fun SetStickerSetThumb(
|
||||
stickerSetName: String,
|
||||
userId: UserId,
|
||||
sticker: InputFile
|
||||
stickerSetName: String,
|
||||
thumb: MultipartFile
|
||||
): Request<Boolean> {
|
||||
val data = SetStickerSetThumb(userId, stickerSetName, sticker as? FileId)
|
||||
return when (sticker) {
|
||||
is MultipartFile -> CommonMultipartFileRequest(
|
||||
data,
|
||||
mapOf(thumbField to sticker)
|
||||
)
|
||||
is FileId -> data
|
||||
}
|
||||
return CommonMultipartFileRequest(
|
||||
SetStickerSetThumb(userId, stickerSetName),
|
||||
mapOf(thumbField to thumb)
|
||||
)
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class SetStickerSetThumb internal constructor(
|
||||
data class SetStickerSetThumb (
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(nameField)
|
||||
|
Loading…
Reference in New Issue
Block a user