1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-02 07:55:25 +00:00
tgbotapi/TelegramBotAPI-extensions-api/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/extensions/api/send/media/SendVideo.kt

108 lines
3.8 KiB
Kotlin
Raw Normal View History

2020-02-15 09:33:04 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.extensions.api.send.media
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.SendVideo
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.message.abstracts.Message
2020-02-15 09:33:04 +00:00
suspend fun TelegramBot.sendVideo(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
video: InputFile,
thumb: InputFile? = null,
2020-02-15 09:33:04 +00:00
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = execute(
SendVideo(
chatId,
video,
thumb,
text,
parseMode,
duration,
width,
height,
null,
disableNotification,
replyToMessageId,
replyMarkup
)
)
suspend fun TelegramBot.sendVideo(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
video: VideoFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
2020-10-04 10:47:30 +00:00
) = sendVideo(chatId, video.fileId, video.thumb ?.fileId, text, parseMode, video.duration, video.width, video.height, disableNotification, replyToMessageId, replyMarkup)
suspend fun TelegramBot.sendVideo(
chat: Chat,
video: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, thumb, text, parseMode, duration, width, height, disableNotification, replyToMessageId, replyMarkup)
suspend fun TelegramBot.sendVideo(
chat: Chat,
video: VideoFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
replyMarkup: KeyboardMarkup? = null
) = sendVideo(chat.id, video, text, parseMode, disableNotification, replyToMessageId, replyMarkup)
suspend inline fun TelegramBot.replyWithVideo(
to: Message,
video: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
duration: Long? = null,
width: Int? = null,
height: Int? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendVideo(to.chat, video, thumb, text, parseMode, duration, width, height, disableNotification, to.messageId, replyMarkup)
suspend inline fun TelegramBot.replyWithVideo(
to: Message,
video: VideoFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = sendVideo(to.chat, video, text, parseMode, disableNotification, to.messageId, replyMarkup)
suspend inline fun TelegramBot.reply(
to: Message,
video: VideoFile,
text: String? = null,
parseMode: ParseMode? = null,
disableNotification: Boolean = false,
replyMarkup: KeyboardMarkup? = null
) = replyWithVideo(to, video, text, parseMode, disableNotification, replyMarkup)