1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 23:45:25 +00:00
tgbotapi/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendAudio.kt

216 lines
7.9 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.send.media
2020-02-15 09:33:04 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.send.media.SendAudio
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.files.AudioFile
import dev.inmo.tgbotapi.types.message.abstracts.Message
2020-02-15 09:33:04 +00:00
suspend fun TelegramBot.sendAudio(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
audio: InputFile,
thumb: InputFile? = null,
2020-02-15 09:33:04 +00:00
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = execute(
SendAudio(
chatId,
audio,
thumb,
text,
parseMode,
duration,
performer,
title,
disableNotification,
replyToMessageId,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply,
2020-02-15 09:33:04 +00:00
replyMarkup
)
)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendAudio(
chat: Chat,
audio: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = sendAudio(chat.id, audio, thumb, text, parseMode, duration, performer, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendAudio(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
audio: AudioFile,
text: String? = null,
parseMode: ParseMode? = null,
title: String? = audio.title,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, text, parseMode, audio.duration, audio.performer, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendAudio(
chat: Chat,
audio: AudioFile,
text: String? = null,
parseMode: ParseMode? = null,
title: String? = audio.title,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = sendAudio(chat.id, audio, text, parseMode, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.replyWithAudio(
to: Message,
audio: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = sendAudio(to.chat, audio, thumb, text, parseMode, duration, performer, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.replyWithAudio(
to: Message,
audio: AudioFile,
text: String? = null,
parseMode: ParseMode? = null,
title: String? = null,
disableNotification: Boolean = false,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = sendAudio(to.chat, audio, text, parseMode, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.reply(
to: Message,
audio: AudioFile,
text: String? = null,
parseMode: ParseMode? = null,
title: String? = null,
disableNotification: Boolean = false,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply: Boolean? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
2020-11-05 17:48:23 +00:00
) = replyWithAudio(to, audio, text, parseMode, title, disableNotification, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.sendAudio(
chatId: ChatIdentifier,
audio: InputFile,
thumb: InputFile? = null,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendAudio(
chatId,
audio,
thumb,
entities,
duration,
performer,
title,
disableNotification,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
)
)
suspend inline fun TelegramBot.sendAudio(
chat: Chat,
audio: InputFile,
thumb: InputFile? = null,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, thumb, entities, duration, performer, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.sendAudio(
chatId: ChatIdentifier,
audio: AudioFile,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
title: String? = audio.title,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = sendAudio(chatId, audio.fileId, audio.thumb ?.fileId, entities, audio.duration, audio.performer, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.sendAudio(
chat: Chat,
audio: AudioFile,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
title: String? = audio.title,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = sendAudio(chat.id, audio, entities, title, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.replyWithAudio(
to: Message,
audio: InputFile,
thumb: InputFile? = null,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
performer: String? = null,
title: String? = null,
disableNotification: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = sendAudio(to.chat, audio, thumb, entities, duration, performer, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.replyWithAudio(
to: Message,
audio: AudioFile,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
title: String? = null,
disableNotification: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = sendAudio(to.chat, audio, entities, title, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
suspend inline fun TelegramBot.reply(
to: Message,
audio: AudioFile,
entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>,
2020-11-05 17:48:23 +00:00
title: String? = null,
disableNotification: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = replyWithAudio(to, audio, entities, title, disableNotification, allowSendingWithoutReply, replyMarkup)