1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 00:03:48 +00:00

add Voice InlineQueryResult + a little fix of Audio result

This commit is contained in:
InsanusMokrassar 2019-02-07 13:10:15 +08:00
parent fa10535a70
commit 99c3f9b742
7 changed files with 100 additions and 1 deletions

View File

@ -89,6 +89,10 @@ const val audioUrlField = "audio_url"
const val audioFileIdField = "audio_file_id"
const val audioDurationField = "audio_duration"
const val voiceUrlField = "voice_url"
const val voiceFileIdField = "voice_file_id"
const val voiceDurationField = "voice_duration"
const val gameShortNameField = "game_short_name"
const val thumbUrlField = "thumb_url"

View File

@ -17,7 +17,8 @@ data class InlineQueryResultAudioImpl(
@SerialName(audioUrlField)
override val url: String,
@SerialName(performerField)
override val performer: String?,
@Optional
override val performer: String? = null,
@SerialName(audioDurationField)
@Optional
override val duration: Int? = null,

View File

@ -0,0 +1,34 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoiceCached
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
data class InlineQueryResultVoiceCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(voiceFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoiceCached

View File

@ -0,0 +1,35 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice.InlineQueryResultVoice
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
data class InlineQueryResultVoiceImpl(
@SerialName(idField)
override val id: String,
@SerialName(voiceUrlField)
override val url: String,
@SerialName(voiceDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(captionField)
@Optional
override val caption: String? = null,
@SerialName(parseModeField)
@Optional
override val parseMode: ParseMode? = null,
@SerialName(replyMarkupField)
@Optional
override val replyMarkup: InlineKeyboardMarkup? = null,
@SerialName(inputMessageContentField)
@Optional
override val inputMessageContent: InputMessageContent? = null
) : InlineQueryResultVoice

View File

@ -0,0 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Performerable
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVoice : InlineQueryResultVoiceCommon, UrlInlineQueryResult, DuratedInlineResultQuery

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVoiceCached : InlineQueryResultVoiceCommon, WithFileIdInlineQueryResult

View File

@ -0,0 +1,14 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.voice
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVoiceCommon : InlineQueryResult,
Captioned,
WithInputMessageContentInlineQueryResult,
TitledInlineQueryResult
{
override val type: String
get() = "audio"
}