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

105 lines
3.8 KiB
Kotlin
Raw Normal View History

package dev.inmo.tgbotapi.extensions.api.send.media
2020-02-15 09:33:04 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.bot.TelegramBot
2020-03-22 10:04:11 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile
2020-02-15 09:33:04 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideoNote
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
2020-10-04 10:47:30 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
2020-02-15 09:33:04 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoFile
2020-10-04 10:47:30 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoNoteFile
import com.github.insanusmokrassar.TelegramBotAPI.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
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
size: Int? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendVideoNote(
chatId,
videoNote,
thumb,
text,
parseMode,
duration,
size,
disableNotification,
replyToMessageId,
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
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(
chatId, videoNote.fileId, videoNote.thumb ?.fileId, text, parseMode, videoNote.duration, videoNote.width, disableNotification, replyToMessageId, 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,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
size: Int? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, thumb, text, parseMode, duration, size, disableNotification, replyToMessageId, replyMarkup)
suspend fun TelegramBot.sendVideoNote(
chat: Chat,
videoNote: VideoNoteFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(chat.id, videoNote, text, parseMode, disableNotification, replyToMessageId, replyMarkup)
suspend inline fun TelegramBot.replyWithVideoNote(
to: Message,
videoNote: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
size: Int? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(to.chat, videoNote, thumb, text, parseMode, duration, size, disableNotification, to.messageId, replyMarkup)
suspend inline fun TelegramBot.replyWithVideoNote(
to: Message,
videoNote: VideoNoteFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendVideoNote(to.chat, videoNote, text, parseMode, disableNotification, to.messageId, replyMarkup)
suspend inline fun TelegramBot.reply(
to: Message,
videoNote: VideoNoteFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = replyWithVideoNote(to, videoNote, text, parseMode, disableNotification, replyMarkup)