mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
add conversations between AudioFile and VoiceFile
This commit is contained in:
parent
2378237fc5
commit
800d14561e
@ -19,6 +19,8 @@
|
||||
* Now in forward info you can get `ForwardFromSupergroupInfo`
|
||||
* **BREAKING CHANGE** `SendVoice` factory function has changed its signature: now it have now `thumb`
|
||||
(according to the [documentation](https://core.telegram.org/bots/api#sendvoice))
|
||||
* `AudioFile` now can be converted to `VoiceFile`
|
||||
* `VoiceFile` now can be converted to `AudioFile`
|
||||
* `TelegramBotAPI-extensions-api`:
|
||||
* ALL REQUESTS EXECUTOR USAGES WERE REPLACED WITH `TelegramBot` TYPEALIAS. It should not bring any break changes
|
||||
* Internal changes of `sendRegularPoll` and `sendQuizPoll` extensions
|
||||
|
@ -24,3 +24,5 @@ data class AudioFile(
|
||||
override val fileSize: Long? = null,
|
||||
override val thumb: PhotoSize? = null
|
||||
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, TitledMediaFile, Performerable
|
||||
|
||||
fun AudioFile.asVoiceFile() = VoiceFile(fileId, fileUniqueId, duration, mimeType, fileSize)
|
||||
|
@ -20,3 +20,8 @@ data class VoiceFile(
|
||||
@SerialName(fileSizeField)
|
||||
override val fileSize: Long? = null
|
||||
) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile
|
||||
|
||||
fun VoiceFile.asAudioFile(
|
||||
performer: String? = null,
|
||||
title: String? = null
|
||||
) = AudioFile(fileId, fileUniqueId, duration, performer, title, mimeType, fileSize)
|
||||
|
Loading…
Reference in New Issue
Block a user