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

221 lines
8.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.SendAnimation
2024-01-07 16:42:46 +00:00
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
2022-05-01 14:36:07 +00:00
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
2022-05-01 14:43:03 +00:00
import dev.inmo.tgbotapi.types.message.ParseMode
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.chat.Chat
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.files.AnimationFile
2020-02-15 09:33:04 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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.sendAnimation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
animation: InputFile,
thumb: InputFile? = null,
2020-02-15 09:33:04 +00:00
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
2020-02-15 09:33:04 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = execute(
SendAnimation(
chatId,
animation,
thumb,
text,
parseMode,
spoilered,
2020-02-15 09:33:04 +00:00
duration,
width,
height,
2022-11-07 18:11:14 +00:00
threadId,
businessConnectionId,
2020-02-15 09:33:04 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2024-01-07 16:42:46 +00:00
replyParameters,
2020-02-15 09:33:04 +00:00
replyMarkup
)
)
2021-10-01 13:38:22 +00:00
/**
* @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.sendAnimation(
2020-02-15 09:33:04 +00:00
chatId: ChatIdentifier,
animation: AnimationFile,
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
2020-02-15 09:33:04 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
2020-02-15 09:33:04 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-02-15 09:33:04 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
2020-02-15 09:33:04 +00:00
)
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendAnimation(
chat: Chat,
animation: InputFile,
thumb: InputFile? = null,
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
2020-10-04 10:47:30 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
2020-10-04 10:47:30 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
2020-10-04 10:47:30 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-10-04 10:47:30 +00:00
suspend fun TelegramBot.sendAnimation(
chat: Chat,
animation: AnimationFile,
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
2020-10-04 10:47:30 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
2020-10-04 10:47:30 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-10-04 10:47:30 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, text, parseMode, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
2020-10-04 10:47:30 +00:00
2020-11-05 17:48:23 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendAnimation(
chatId: ChatIdentifier,
animation: InputFile,
thumb: InputFile? = null,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
spoilered: Boolean = false,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
) = execute(
SendAnimation(
chatId,
animation,
thumb,
entities,
spoilered,
2020-11-05 17:48:23 +00:00
duration,
width,
height,
2022-11-07 18:11:14 +00:00
threadId,
businessConnectionId,
2020-11-05 17:48:23 +00:00
disableNotification,
2022-01-01 14:13:22 +00:00
protectContent,
2024-01-07 16:42:46 +00:00
replyParameters,
2020-11-05 17:48:23 +00:00
replyMarkup
)
)
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendAnimation(
chatId: ChatIdentifier,
animation: AnimationFile,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
spoilered: Boolean = false,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chatId.threadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(
chatId, animation.fileId, animation.thumbnail ?.fileId, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup
2020-11-05 17:48:23 +00:00
)
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendAnimation(
chat: Chat,
animation: InputFile,
thumb: InputFile? = null,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
spoilered: Boolean = false,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, thumb, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)
2020-11-05 17:48:23 +00:00
2021-10-01 13:38:22 +00:00
/**
* @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
*/
2020-11-05 17:48:23 +00:00
suspend fun TelegramBot.sendAnimation(
chat: Chat,
animation: AnimationFile,
2021-05-29 09:34:14 +00:00
entities: TextSourcesList,
spoilered: Boolean = false,
2020-11-05 17:48:23 +00:00
duration: Long? = null,
width: Int? = null,
height: Int? = null,
threadId: MessageThreadId? = chat.id.threadId,
businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
2020-11-05 17:48:23 +00:00
disableNotification: Boolean = false,
2022-01-01 14:13:22 +00:00
protectContent: Boolean = false,
2024-01-07 16:42:46 +00:00
replyParameters: ReplyParameters? = null,
2020-11-05 17:48:23 +00:00
replyMarkup: KeyboardMarkup? = null
) = sendAnimation(chat.id, animation, entities, spoilered, duration, width, height, threadId, businessConnectionId, disableNotification, protectContent, replyParameters, replyMarkup)