180 lines
7.3 KiB
Kotlin
180 lines
7.3 KiB
Kotlin
package dev.inmo.tgbotapi.extensions.api.send.media
|
|
|
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
|
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
|
import dev.inmo.tgbotapi.types.*
|
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
import dev.inmo.tgbotapi.types.message.ParseMode
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
import dev.inmo.tgbotapi.types.chat.Chat
|
|
import dev.inmo.tgbotapi.types.files.VoiceFile
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: InputFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
threadId: MessageThreadId? = chatId.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId,
|
|
voice,
|
|
text,
|
|
parseMode,
|
|
duration,
|
|
threadId,
|
|
businessConnectionId,
|
|
disableNotification,
|
|
protectContent,
|
|
replyParameters,
|
|
replyMarkup
|
|
)
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendVoice(
|
|
chat: Chat,
|
|
voice: InputFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
duration: Long? = null,
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(chat.id, voice, text, parseMode, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: VoiceFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
threadId: MessageThreadId? = chatId.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(
|
|
chatId, voice.fileId, text, parseMode, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend fun TelegramBot.sendVoice(
|
|
chat: Chat,
|
|
voice: VoiceFile,
|
|
text: String? = null,
|
|
parseMode: ParseMode? = null,
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(chat.id, voice, text, parseMode, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
|
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend inline fun TelegramBot.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: InputFile,
|
|
entities: TextSourcesList,
|
|
duration: Long? = null,
|
|
threadId: MessageThreadId? = chatId.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = execute(
|
|
SendVoice(
|
|
chatId = chatId,
|
|
voice = voice,
|
|
entities = entities,
|
|
threadId = threadId,
|
|
businessConnectionId = businessConnectionId,
|
|
duration = duration,
|
|
disableNotification = disableNotification,
|
|
protectContent = protectContent,
|
|
replyParameters = replyParameters,
|
|
replyMarkup = replyMarkup
|
|
)
|
|
)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend inline fun TelegramBot.sendVoice(
|
|
chat: Chat,
|
|
voice: InputFile,
|
|
entities: TextSourcesList,
|
|
duration: Long? = null,
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(chat.id, voice, entities, duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|
|
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend inline fun TelegramBot.sendVoice(
|
|
chatId: ChatIdentifier,
|
|
voice: VoiceFile,
|
|
entities: TextSourcesList,
|
|
threadId: MessageThreadId? = chatId.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(
|
|
chatId, voice.fileId, entities, voice.duration, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
|
|
)
|
|
/**
|
|
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
|
|
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
|
|
*/
|
|
suspend inline fun TelegramBot.sendVoice(
|
|
chat: Chat,
|
|
voice: VoiceFile,
|
|
entities: TextSourcesList,
|
|
threadId: MessageThreadId? = chat.id.threadId,
|
|
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
|
|
disableNotification: Boolean = false,
|
|
protectContent: Boolean = false,
|
|
replyParameters: ReplyParameters? = null,
|
|
replyMarkup: KeyboardMarkup? = null
|
|
) = sendVoice(chat.id, voice, entities, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
|