mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
commit
e2fdbac5fa
@ -77,6 +77,10 @@ of `]` in links titles
|
|||||||
* All default `startGettingOfUpdates` (in fact - method `start` of `UpdatesPoller`) are suspend and
|
* All default `startGettingOfUpdates` (in fact - method `start` of `UpdatesPoller`) are suspend and
|
||||||
will try to delete webhook
|
will try to delete webhook
|
||||||
|
|
||||||
|
### 0.12.7 Hotfix version
|
||||||
|
|
||||||
|
* Now temporary all requests of input media will contains `file` field
|
||||||
|
|
||||||
## 0.11.0
|
## 0.11.0
|
||||||
|
|
||||||
* Kotlin `1.3.11` -> `1.3.21`
|
* Kotlin `1.3.11` -> `1.3.21`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
project.version = "0.12.6"
|
project.version = "0.12.7"
|
||||||
project.group = "com.github.insanusmokrassar"
|
project.group = "com.github.insanusmokrassar"
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
@ -58,7 +58,6 @@ private val serializer = ArrayListSerializer(RawMessage.serializer())
|
|||||||
data class SendMediaGroupData internal constructor(
|
data class SendMediaGroupData internal constructor(
|
||||||
@SerialName(chatIdField)
|
@SerialName(chatIdField)
|
||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@Transient
|
|
||||||
val media: List<MediaGroupMemberInputMedia> = emptyList(),
|
val media: List<MediaGroupMemberInputMedia> = emptyList(),
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
|
@ -8,15 +8,13 @@ import kotlinx.serialization.*
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaAnimation(
|
data class InputMediaAnimation(
|
||||||
@Transient
|
override val file: InputFile,
|
||||||
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
|
||||||
override val caption: String? = null,
|
override val caption: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@Transient
|
|
||||||
override val thumb: InputFile? = null
|
override val thumb: InputFile? = null
|
||||||
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia {
|
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia {
|
||||||
override val type: String = "animation"
|
override val type: String = "animation"
|
||||||
|
@ -10,7 +10,7 @@ import kotlinx.serialization.Serializable
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaAudio(
|
data class InputMediaAudio(
|
||||||
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
override val file: InputFile,
|
||||||
override val caption: String? = null,
|
override val caption: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
|
@ -8,12 +8,10 @@ import kotlinx.serialization.*
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaDocument(
|
data class InputMediaDocument(
|
||||||
@Transient
|
override val file: InputFile,
|
||||||
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
|
||||||
override val caption: String? = null,
|
override val caption: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@Transient
|
|
||||||
override val thumb: InputFile? = null
|
override val thumb: InputFile? = null
|
||||||
) : InputMedia, ThumbedInputMedia, CaptionedInputMedia {
|
) : InputMedia, ThumbedInputMedia, CaptionedInputMedia {
|
||||||
override val type: String = "document"
|
override val type: String = "document"
|
||||||
|
@ -9,8 +9,7 @@ import kotlinx.serialization.*
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaPhoto(
|
data class InputMediaPhoto(
|
||||||
@Transient
|
override val file: InputFile,
|
||||||
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
|
||||||
override val caption: String? = null,
|
override val caption: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null
|
override val parseMode: ParseMode? = null
|
||||||
@ -19,17 +18,14 @@ data class InputMediaPhoto(
|
|||||||
|
|
||||||
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
||||||
|
|
||||||
|
@SerialName(mediaField)
|
||||||
|
val media: String = when (file) {
|
||||||
|
is FileId -> file.fileId
|
||||||
|
is MultipartFile -> inputMediaFileAttachmentNameTemplate.format(file.fileId)
|
||||||
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
override val arguments: Map<String, Any?> = Mapper.mapNullable(serializer(), this)
|
override val arguments: Map<String, Any?> = Mapper.mapNullable(serializer(), this)
|
||||||
|
|
||||||
@SerialName(mediaField)
|
|
||||||
val media: String
|
|
||||||
get() = file.let {
|
|
||||||
when (it) {
|
|
||||||
is FileId -> it.fileId
|
|
||||||
is MultipartFile -> inputMediaFileAttachmentNameTemplate.format(it.fileId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun PhotoSize.toInputMediaPhoto(
|
fun PhotoSize.toInputMediaPhoto(
|
||||||
|
@ -8,30 +8,25 @@ import kotlinx.serialization.*
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaVideo(
|
data class InputMediaVideo(
|
||||||
@Transient
|
override val file: InputFile,
|
||||||
override val file: InputFile = throw IllegalStateException("Must be created with file"),
|
|
||||||
override val caption: String? = null,
|
override val caption: String? = null,
|
||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@Transient
|
|
||||||
override val thumb: InputFile? = null
|
override val thumb: InputFile? = null
|
||||||
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia, MediaGroupMemberInputMedia {
|
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, CaptionedInputMedia, MediaGroupMemberInputMedia {
|
||||||
override val type: String = "video"
|
override val type: String = "video"
|
||||||
|
|
||||||
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
||||||
|
|
||||||
|
@SerialName(mediaField)
|
||||||
|
val media: String = when (file) {
|
||||||
|
is FileId -> file.fileId
|
||||||
|
is MultipartFile -> inputMediaFileAttachmentNameTemplate.format(file.fileId)
|
||||||
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
override val arguments: Map<String, Any?> = Mapper.mapNullable(serializer(), this)
|
override val arguments: Map<String, Any?> = Mapper.mapNullable(serializer(), this)
|
||||||
|
|
||||||
@SerialName(mediaField)
|
|
||||||
val media: String
|
|
||||||
get() = file.let {
|
|
||||||
when (it) {
|
|
||||||
is FileId -> it.fileId
|
|
||||||
is MultipartFile -> inputMediaFileAttachmentNameTemplate.format(it.fileId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user