mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-02-16 19:52:01 +00:00
rename thumb field
This commit is contained in:
parent
d8c659f866
commit
e30361ad1e
@ -73,7 +73,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
chatId, animation.fileId, animation.thumb ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -177,7 +177,7 @@ suspend fun TelegramBot.sendAnimation(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAnimation(
|
) = sendAnimation(
|
||||||
chatId, animation.fileId, animation.thumb ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,7 +88,7 @@ suspend fun TelegramBot.sendAudio(
|
|||||||
replyToMessageId: MessageId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, text, parseMode, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@ -180,7 +180,7 @@ suspend inline fun TelegramBot.sendAudio(
|
|||||||
replyToMessageId: MessageId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendAudio(chatId, audio.fileId, audio.thumbnail ?.fileId, entities, audio.duration, audio.performer, title, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
@ -83,7 +83,7 @@ suspend fun TelegramBot.sendDocument(
|
|||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumb ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, text, parseMode, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -170,7 +170,7 @@ suspend inline fun TelegramBot.sendDocument(
|
|||||||
replyMarkup: KeyboardMarkup? = null,
|
replyMarkup: KeyboardMarkup? = null,
|
||||||
disableContentTypeDetection: Boolean? = null
|
disableContentTypeDetection: Boolean? = null
|
||||||
) = sendDocument(
|
) = sendDocument(
|
||||||
chatId, document.fileId, document.thumb ?.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
chatId, document.fileId, document.thumbnail ?.fileId, entities, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup, disableContentTypeDetection
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +70,7 @@ suspend fun TelegramBot.sendVideo(
|
|||||||
replyToMessageId: MessageId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, text, parseMode, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
@ -167,7 +167,7 @@ suspend inline fun TelegramBot.sendVideo(
|
|||||||
replyToMessageId: MessageId? = null,
|
replyToMessageId: MessageId? = null,
|
||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
) = sendVideo(chatId, video.fileId, video.thumbnail ?.fileId, entities, spoilered, video.duration, video.width, video.height, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
||||||
|
@ -57,7 +57,7 @@ suspend fun TelegramBot.sendVideoNote(
|
|||||||
allowSendingWithoutReply: Boolean? = null,
|
allowSendingWithoutReply: Boolean? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendVideoNote(
|
) = sendVideoNote(
|
||||||
chatId, videoNote.fileId, videoNote.thumb ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
chatId, videoNote.fileId, videoNote.thumbnail ?.fileId, videoNote.duration, videoNote.width, threadId, disableNotification, protectContent, replyToMessageId, allowSendingWithoutReply, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||||
|
|
||||||
interface ThumbedSendMessageRequest<T: Any>: SendMessageRequest<T> {
|
interface ThumbedSendMessageRequest<T: Any>: SendMessageRequest<T> {
|
||||||
|
val thumbnail: String?
|
||||||
|
|
||||||
|
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnail"))
|
||||||
val thumb: String?
|
val thumb: String?
|
||||||
}
|
get() = thumbnail
|
||||||
|
}
|
||||||
|
@ -129,8 +129,8 @@ data class SendAnimationData internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(animationField)
|
@SerialName(animationField)
|
||||||
val animation: String? = null,
|
val animation: String? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: String? = null,
|
override val thumbnail: String? = null,
|
||||||
@SerialName(captionField)
|
@SerialName(captionField)
|
||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
@ -187,8 +187,8 @@ data class SendAnimationData internal constructor(
|
|||||||
|
|
||||||
data class SendAnimationFiles internal constructor(
|
data class SendAnimationFiles internal constructor(
|
||||||
val animation: MultipartFile? = null,
|
val animation: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
animationField to animation,
|
animationField to animation,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -126,8 +126,8 @@ data class SendAudioData internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(audioField)
|
@SerialName(audioField)
|
||||||
val audio: String? = null,
|
val audio: String? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: String? = null,
|
override val thumbnail: String? = null,
|
||||||
@SerialName(captionField)
|
@SerialName(captionField)
|
||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
@ -182,8 +182,8 @@ data class SendAudioData internal constructor(
|
|||||||
|
|
||||||
data class SendAudioFiles internal constructor(
|
data class SendAudioFiles internal constructor(
|
||||||
val audio: MultipartFile? = null,
|
val audio: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
audioField to audio,
|
audioField to audio,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -144,8 +144,8 @@ data class SendDocumentData internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(documentField)
|
@SerialName(documentField)
|
||||||
val document: String? = null,
|
val document: String? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: String? = null,
|
override val thumbnail: String? = null,
|
||||||
@SerialName(captionField)
|
@SerialName(captionField)
|
||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
@ -193,8 +193,8 @@ data class SendDocumentData internal constructor(
|
|||||||
|
|
||||||
data class SendDocumentFiles internal constructor(
|
data class SendDocumentFiles internal constructor(
|
||||||
val document: MultipartFile? = null,
|
val document: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
documentField to document,
|
documentField to document,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -133,8 +133,8 @@ data class SendVideoData internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(videoField)
|
@SerialName(videoField)
|
||||||
val video: String? = null,
|
val video: String? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: String? = null,
|
override val thumbnail: String? = null,
|
||||||
@SerialName(captionField)
|
@SerialName(captionField)
|
||||||
override val text: String? = null,
|
override val text: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
@ -193,8 +193,8 @@ data class SendVideoData internal constructor(
|
|||||||
|
|
||||||
data class SendVideoFiles internal constructor(
|
data class SendVideoFiles internal constructor(
|
||||||
val video: MultipartFile? = null,
|
val video: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
videoField to video,
|
videoField to video,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -62,8 +62,8 @@ data class SendVideoNoteData internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(videoNoteField)
|
@SerialName(videoNoteField)
|
||||||
val videoNote: String? = null,
|
val videoNote: String? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: String? = null,
|
override val thumbnail: String? = null,
|
||||||
@SerialName(durationField)
|
@SerialName(durationField)
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@SerialName(lengthField)
|
@SerialName(lengthField)
|
||||||
@ -99,8 +99,8 @@ data class SendVideoNoteData internal constructor(
|
|||||||
|
|
||||||
data class SendVideoNoteFiles internal constructor(
|
data class SendVideoNoteFiles internal constructor(
|
||||||
val videoNote: MultipartFile? = null,
|
val videoNote: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
videoNoteField to videoNote,
|
videoNoteField to videoNote,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -156,8 +156,8 @@ data class SendVoiceData internal constructor(
|
|||||||
|
|
||||||
data class SendVoiceFiles internal constructor(
|
data class SendVoiceFiles internal constructor(
|
||||||
val voice: MultipartFile? = null,
|
val voice: MultipartFile? = null,
|
||||||
val thumb: MultipartFile? = null
|
val thumbnail: MultipartFile? = null
|
||||||
) : Files by mapOfNotNull(
|
) : Files by mapOfNotNull(
|
||||||
voiceField to voice,
|
voiceField to voice,
|
||||||
thumbField to thumb
|
thumbnailField to thumbnail
|
||||||
)
|
)
|
||||||
|
@ -3,18 +3,17 @@ package dev.inmo.tgbotapi.requests.stickers
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.*
|
import dev.inmo.tgbotapi.requests.abstracts.*
|
||||||
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||||
import dev.inmo.tgbotapi.requests.stickers.abstracts.OwnerStickerSetAction
|
import dev.inmo.tgbotapi.requests.stickers.abstracts.OwnerStickerSetAction
|
||||||
import dev.inmo.tgbotapi.requests.stickers.abstracts.StickerSetAction
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
fun SetStickerSetThumb(
|
fun SetStickerSetThumb(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: String,
|
stickerSetName: String,
|
||||||
thumb: MultipartFile
|
thumbnail: MultipartFile
|
||||||
): Request<Boolean> {
|
): Request<Boolean> {
|
||||||
return CommonMultipartFileRequest(
|
return CommonMultipartFileRequest(
|
||||||
SetStickerSetThumb(userId, stickerSetName),
|
SetStickerSetThumb(userId, stickerSetName),
|
||||||
mapOf(thumbField to thumb)
|
mapOf(thumbnailField to thumbnail)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ data class SetStickerSetThumb (
|
|||||||
override val userId: UserId,
|
override val userId: UserId,
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
val thumb: FileId? = null
|
val thumb: FileId? = null
|
||||||
) : OwnerStickerSetAction {
|
) : OwnerStickerSetAction {
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
|
@ -387,6 +387,8 @@ const val explanationField = "explanation"
|
|||||||
const val idField = "id"
|
const val idField = "id"
|
||||||
const val pollIdField = "poll_id"
|
const val pollIdField = "poll_id"
|
||||||
const val textField = "text"
|
const val textField = "text"
|
||||||
|
const val thumbnailField = "thumbnail"
|
||||||
|
@Deprecated("Renamed (in telegram bot api)", ReplaceWith("thumbnailField", "dev.inmo.tgbotapi.types.thumbnailField"))
|
||||||
const val thumbField = "thumb"
|
const val thumbField = "thumb"
|
||||||
const val emojiField = "emoji"
|
const val emojiField = "emoji"
|
||||||
const val emojisField = "emojis"
|
const val emojisField = "emojis"
|
||||||
|
@ -16,7 +16,7 @@ data class AnimationFile(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
override val height: Int,
|
override val height: Int,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(fileNameField)
|
@SerialName(fileNameField)
|
||||||
override val fileName: String? = null,
|
override val fileName: String? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
|
@ -25,8 +25,8 @@ data class AudioFile(
|
|||||||
override val mimeType: MimeType? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null,
|
override val fileSize: Long? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumbnail: PhotoSize? = null
|
||||||
) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile,
|
) : TelegramMediaFile, CustomNamedMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile,
|
||||||
Performerable
|
Performerable
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ data class DocumentFile(
|
|||||||
override val fileUniqueId: FileUniqueId,
|
override val fileUniqueId: FileUniqueId,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null,
|
override val fileSize: Long? = null,
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: MimeType? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileNameField)
|
@SerialName(fileNameField)
|
||||||
@ -30,7 +30,7 @@ inline fun TelegramMediaFile.asDocumentFile() = if (this is DocumentFile) {
|
|||||||
fileId,
|
fileId,
|
||||||
fileUniqueId,
|
fileUniqueId,
|
||||||
fileSize,
|
fileSize,
|
||||||
(this as? ThumbedMediaFile) ?.thumb,
|
(this as? ThumbedMediaFile) ?.thumbnail,
|
||||||
(this as? MimedMediaFile) ?.mimeType,
|
(this as? MimedMediaFile) ?.mimeType,
|
||||||
(this as? CustomNamedMediaFile) ?.fileName
|
(this as? CustomNamedMediaFile) ?.fileName
|
||||||
)
|
)
|
||||||
|
@ -202,8 +202,8 @@ data class RegularSimpleSticker(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
@SerialName(heightField)
|
@SerialName(heightField)
|
||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -225,8 +225,8 @@ data class RegularAnimatedSticker(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
@SerialName(heightField)
|
@SerialName(heightField)
|
||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -246,8 +246,8 @@ data class RegularVideoSticker(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
@SerialName(heightField)
|
@SerialName(heightField)
|
||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -275,8 +275,8 @@ data class MaskSimpleSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(maskPositionField)
|
@SerialName(maskPositionField)
|
||||||
override val maskPosition: MaskPosition,
|
override val maskPosition: MaskPosition,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -296,8 +296,8 @@ data class MaskAnimatedSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(maskPositionField)
|
@SerialName(maskPositionField)
|
||||||
override val maskPosition: MaskPosition,
|
override val maskPosition: MaskPosition,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -317,8 +317,8 @@ data class MaskVideoSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(maskPositionField)
|
@SerialName(maskPositionField)
|
||||||
override val maskPosition: MaskPosition,
|
override val maskPosition: MaskPosition,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -344,8 +344,8 @@ data class CustomEmojiSimpleSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(customEmojiIdField)
|
@SerialName(customEmojiIdField)
|
||||||
override val customEmojiId: CustomEmojiId,
|
override val customEmojiId: CustomEmojiId,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -365,8 +365,8 @@ data class CustomEmojiAnimatedSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(customEmojiIdField)
|
@SerialName(customEmojiIdField)
|
||||||
override val customEmojiId: CustomEmojiId,
|
override val customEmojiId: CustomEmojiId,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -386,8 +386,8 @@ data class CustomEmojiVideoSticker(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(customEmojiIdField)
|
@SerialName(customEmojiIdField)
|
||||||
override val customEmojiId: CustomEmojiId,
|
override val customEmojiId: CustomEmojiId,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
@ -406,8 +406,8 @@ data class UnknownSticker(
|
|||||||
override val width: Int,
|
override val width: Int,
|
||||||
@SerialName(heightField)
|
@SerialName(heightField)
|
||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
override val emoji: String? = null,
|
override val emoji: String? = null,
|
||||||
@SerialName(stickerSetNameField)
|
@SerialName(stickerSetNameField)
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
package dev.inmo.tgbotapi.types.files
|
package dev.inmo.tgbotapi.types.files
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.files.PhotoSize
|
|
||||||
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
|
|
||||||
|
|
||||||
sealed interface ThumbedMediaFile : TelegramMediaFile {
|
sealed interface ThumbedMediaFile : TelegramMediaFile {
|
||||||
|
val thumbnail: PhotoSize?
|
||||||
|
|
||||||
|
@Deprecated("Renamed (in telegram bot api)", ReplaceWith("thumbnail"))
|
||||||
val thumb: PhotoSize?
|
val thumb: PhotoSize?
|
||||||
|
get() = thumbnail
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,8 @@ data class VideoFile(
|
|||||||
override val height: Int,
|
override val height: Int,
|
||||||
@SerialName(durationField)
|
@SerialName(durationField)
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(fileNameField)
|
@SerialName(fileNameField)
|
||||||
override val fileName: String? = null,
|
override val fileName: String? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
@ -44,7 +44,7 @@ inline fun VideoFile.toTelegramMediaVideo(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
duration,
|
duration,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
@ -58,5 +58,5 @@ inline fun VideoFile.toTelegramMediaVideo(
|
|||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
duration,
|
duration,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
@ -15,7 +15,7 @@ data class VideoNoteFile(
|
|||||||
@SerialName("length")
|
@SerialName("length")
|
||||||
override val width: Int,
|
override val width: Int,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null
|
override val fileSize: Long? = null
|
||||||
) : TelegramMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile {
|
) : TelegramMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile {
|
||||||
|
@ -77,7 +77,7 @@ fun AudioFile.toTelegramMediaAudio(
|
|||||||
duration,
|
duration,
|
||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
|
||||||
fun AudioFile.toTelegramMediaAudio(
|
fun AudioFile.toTelegramMediaAudio(
|
||||||
@ -89,5 +89,5 @@ fun AudioFile.toTelegramMediaAudio(
|
|||||||
duration,
|
duration,
|
||||||
performer,
|
performer,
|
||||||
title,
|
title,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
@ -78,7 +78,7 @@ fun DocumentFile.toTelegramMediaDocument(
|
|||||||
fileId,
|
fileId,
|
||||||
text,
|
text,
|
||||||
parseMode,
|
parseMode,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
|
||||||
fun DocumentFile.toTelegramMediaDocument(
|
fun DocumentFile.toTelegramMediaDocument(
|
||||||
@ -86,5 +86,5 @@ fun DocumentFile.toTelegramMediaDocument(
|
|||||||
) = TelegramMediaDocument(
|
) = TelegramMediaDocument(
|
||||||
fileId,
|
fileId,
|
||||||
textSources,
|
textSources,
|
||||||
thumb ?.fileId
|
thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
|
@ -32,7 +32,7 @@ data class AnimationContent(
|
|||||||
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
): Request<ContentMessage<AnimationContent>> = SendAnimation(
|
||||||
chatId,
|
chatId,
|
||||||
media.fileId,
|
media.fileId,
|
||||||
media.thumb ?.fileId,
|
media.thumbnail ?.fileId,
|
||||||
textSources,
|
textSources,
|
||||||
spoilered,
|
spoilered,
|
||||||
media.duration,
|
media.duration,
|
||||||
@ -53,6 +53,6 @@ data class AnimationContent(
|
|||||||
media.width,
|
media.width,
|
||||||
media.height,
|
media.height,
|
||||||
media.duration,
|
media.duration,
|
||||||
media.thumb ?.fileId
|
media.thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ data class AudioContent(
|
|||||||
): Request<ContentMessage<AudioContent>> = SendAudio(
|
): Request<ContentMessage<AudioContent>> = SendAudio(
|
||||||
chatId,
|
chatId,
|
||||||
media.fileId,
|
media.fileId,
|
||||||
media.thumb ?.fileId,
|
media.thumbnail ?.fileId,
|
||||||
textSources,
|
textSources,
|
||||||
media.duration,
|
media.duration,
|
||||||
media.performer,
|
media.performer,
|
||||||
|
@ -32,7 +32,7 @@ data class DocumentContent(
|
|||||||
): Request<ContentMessage<DocumentContent>> = SendDocument(
|
): Request<ContentMessage<DocumentContent>> = SendDocument(
|
||||||
chatId,
|
chatId,
|
||||||
media.fileId,
|
media.fileId,
|
||||||
media.thumb ?.fileId,
|
media.thumbnail ?.fileId,
|
||||||
textSources,
|
textSources,
|
||||||
messageThreadId,
|
messageThreadId,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
|
@ -37,6 +37,6 @@ data class StickerContent(
|
|||||||
override fun asTelegramMedia(): TelegramMediaDocument = TelegramMediaDocument(
|
override fun asTelegramMedia(): TelegramMediaDocument = TelegramMediaDocument(
|
||||||
media.fileId,
|
media.fileId,
|
||||||
null,
|
null,
|
||||||
thumb = media.thumb ?.fileId
|
thumb = media.thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ data class VideoContent(
|
|||||||
): Request<ContentMessage<VideoContent>> = SendVideo(
|
): Request<ContentMessage<VideoContent>> = SendVideo(
|
||||||
chatId,
|
chatId,
|
||||||
media.fileId,
|
media.fileId,
|
||||||
media.thumb ?.fileId,
|
media.thumbnail ?.fileId,
|
||||||
textSources,
|
textSources,
|
||||||
spoilered,
|
spoilered,
|
||||||
media.duration,
|
media.duration,
|
||||||
|
@ -26,7 +26,7 @@ data class VideoNoteContent(
|
|||||||
): Request<ContentMessage<VideoNoteContent>> = SendVideoNote(
|
): Request<ContentMessage<VideoNoteContent>> = SendVideoNote(
|
||||||
chatId,
|
chatId,
|
||||||
media.fileId,
|
media.fileId,
|
||||||
media.thumb ?.fileId,
|
media.thumbnail ?.fileId,
|
||||||
media.duration,
|
media.duration,
|
||||||
media.width,
|
media.width,
|
||||||
messageThreadId,
|
messageThreadId,
|
||||||
@ -42,6 +42,6 @@ data class VideoNoteContent(
|
|||||||
width = media.width,
|
width = media.width,
|
||||||
height = media.height,
|
height = media.height,
|
||||||
duration = media.duration,
|
duration = media.duration,
|
||||||
thumb = media.thumb ?.fileId
|
thumb = media.thumbnail ?.fileId
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ import kotlinx.serialization.*
|
|||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
import kotlinx.serialization.encoding.Decoder
|
import kotlinx.serialization.encoding.Decoder
|
||||||
import kotlinx.serialization.encoding.Encoder
|
import kotlinx.serialization.encoding.Encoder
|
||||||
import kotlinx.serialization.json.Json
|
|
||||||
import kotlinx.serialization.json.JsonElement
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@ -146,7 +145,7 @@ data class RegularSimpleStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<RegularSimpleSticker>,
|
override val stickers: List<RegularSimpleSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : RegularStickerSet {
|
) : RegularStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -162,7 +161,7 @@ data class RegularAnimatedStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<RegularAnimatedSticker>,
|
override val stickers: List<RegularAnimatedSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : RegularStickerSet, AnimatedStickerSet {
|
) : RegularStickerSet, AnimatedStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -178,7 +177,7 @@ data class RegularVideoStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<RegularVideoSticker>,
|
override val stickers: List<RegularVideoSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : RegularStickerSet, VideoStickerSet {
|
) : RegularStickerSet, VideoStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -194,7 +193,7 @@ data class MaskSimpleStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<MaskSimpleSticker>,
|
override val stickers: List<MaskSimpleSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : MaskStickerSet {
|
) : MaskStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -210,7 +209,7 @@ data class MaskAnimatedStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<MaskAnimatedSticker>,
|
override val stickers: List<MaskAnimatedSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : MaskStickerSet, AnimatedStickerSet {
|
) : MaskStickerSet, AnimatedStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -226,7 +225,7 @@ data class MaskVideoStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<MaskVideoSticker>,
|
override val stickers: List<MaskVideoSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : MaskStickerSet, VideoStickerSet {
|
) : MaskStickerSet, VideoStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -242,7 +241,7 @@ data class CustomEmojiSimpleStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<CustomEmojiSimpleSticker>,
|
override val stickers: List<CustomEmojiSimpleSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : CustomEmojiStickerSet {
|
) : CustomEmojiStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -258,7 +257,7 @@ data class CustomEmojiAnimatedStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<CustomEmojiAnimatedSticker>,
|
override val stickers: List<CustomEmojiAnimatedSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : CustomEmojiStickerSet, AnimatedStickerSet {
|
) : CustomEmojiStickerSet, AnimatedStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -274,7 +273,7 @@ data class CustomEmojiVideoStickerSet(
|
|||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<CustomEmojiVideoSticker>,
|
override val stickers: List<CustomEmojiVideoSticker>,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
) : CustomEmojiStickerSet, VideoStickerSet {
|
) : CustomEmojiStickerSet, VideoStickerSet {
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@ -292,7 +291,7 @@ data class UnknownStickerSet(
|
|||||||
override val stickers: List<Sticker>,
|
override val stickers: List<Sticker>,
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
override val stickerType: StickerType,
|
override val stickerType: StickerType,
|
||||||
@SerialName(thumbField)
|
@SerialName(thumbnailField)
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumb: PhotoSize? = null,
|
||||||
val raw: JsonElement
|
val raw: JsonElement
|
||||||
) : CustomEmojiStickerSet, VideoStickerSet
|
) : CustomEmojiStickerSet, VideoStickerSet
|
||||||
|
Loading…
x
Reference in New Issue
Block a user