1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/tgbotapi.extensions.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/send/media/SendVideoNote.kt

97 lines
3.5 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.SendVideoNote
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.VideoFile
import dev.inmo.tgbotapi.types.files.VideoNoteFile
import dev.inmo.tgbotapi.types.message.abstracts.Message
2020-02-15 09:33:04 +00:00
suspend fun TelegramBot.sendVideoNote(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
videoNote: InputFile,
thumb: InputFile? = null,
2020-02-15 09:33:04 +00:00
duration: Long? = null,
size: Int? = 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(
SendVideoNote(
chatId,
videoNote,
thumb,
duration,
size,
disableNotification,
replyToMessageId,
2020-11-05 17:48:23 +00:00
allowSendingWithoutReply,
2020-02-15 09:33:04 +00:00
replyMarkup
)
)
suspend fun TelegramBot.sendVideoNote(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
2020-10-04 10:47:30 +00:00
videoNote: VideoNoteFile,
2020-02-15 09:33:04 +00:00
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
) = sendVideoNote(
2020-11-05 17:48:23 +00:00
chatId, videoNote.fileId, videoNote.thumb ?.fileId, videoNote.duration, videoNote.width, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup
2020-02-15 09:33:04 +00:00
)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendVideoNote(
chat: Chat,
videoNote: InputFile,
thumb: InputFile? = null,
duration: Long? = null,
size: Int? = 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
) = sendVideoNote(chat.id, videoNote, thumb, duration, size, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendVideoNote(
chat: Chat,
videoNote: VideoNoteFile,
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
) = sendVideoNote(chat.id, videoNote, disableNotification, replyToMessageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.replyWithVideoNote(
to: Message,
videoNote: InputFile,
thumb: InputFile? = null,
duration: Long? = null,
size: Int? = 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
) = sendVideoNote(to.chat, videoNote, thumb, duration, size, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.replyWithVideoNote(
to: Message,
videoNote: VideoNoteFile,
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
) = sendVideoNote(to.chat, videoNote, disableNotification, to.messageId, allowSendingWithoutReply, replyMarkup)
2020-10-04 10:47:30 +00:00
suspend inline fun TelegramBot.reply(
to: Message,
videoNote: VideoNoteFile,
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
) = replyWithVideoNote(to, videoNote, disableNotification, allowSendingWithoutReply, replyMarkup)