mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-29 04:47:48 +00:00
150 lines
4.3 KiB
Kotlin
150 lines
4.3 KiB
Kotlin
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVoice
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.AudioFile
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: FileId,
|
|
thumb: FileId? = null,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId,
|
|
voice,
|
|
thumb,
|
|
text,
|
|
parseMode,
|
|
duration,
|
|
disableNotification,
|
|
replyToMessageId,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: AudioFile,
|
|
thumb: PhotoSize? = voice.thumb,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(
|
|
chatId, voice.fileId, thumb ?.fileId, text, parseMode, voice.duration, disableNotification, replyToMessageId, replyMarkup
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: MultipartFile,
|
|
thumb: FileId? = null,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId,
|
|
voice,
|
|
thumb,
|
|
text,
|
|
parseMode,
|
|
duration,
|
|
disableNotification,
|
|
replyToMessageId,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: MultipartFile,
|
|
thumb: MultipartFile? = null,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId,
|
|
voice,
|
|
thumb,
|
|
text,
|
|
parseMode,
|
|
duration,
|
|
disableNotification,
|
|
replyToMessageId,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: FileId,
|
|
thumb: MultipartFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId,
|
|
voice,
|
|
thumb,
|
|
text,
|
|
parseMode,
|
|
duration,
|
|
disableNotification,
|
|
replyToMessageId,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: MultipartFile,
|
|
thumb: PhotoSize? = null,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(
|
|
chatId, voice, thumb ?.fileId , text, parseMode, duration, disableNotification, replyToMessageId, replyMarkup
|
|
)
|
|
|
|
suspend fun RequestsExecutor.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: AudioFile,
|
|
thumb: MultipartFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
disableNotification: Boolean = false,
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(
|
|
chatId, voice.fileId, thumb, text, parseMode, voice.duration, disableNotification, replyToMessageId, replyMarkup
|
|
)
|
|
|