2020-10-04 10:57:39 +00:00
|
|
|
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
|
2020-11-02 06:39:12 +00:00
|
|
|
import dev.inmo.tgbotapi.requests.send.media.*
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
2020-11-02 06:39:12 +00:00
|
|
|
import dev.inmo.tgbotapi.types.InputMedia.*
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
|
2021-01-19 04:52:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.message.content.abstracts.MediaGroupContent
|
2020-11-02 06:39:12 +00:00
|
|
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
2020-02-15 09:33:04 +00:00
|
|
|
|
2020-11-02 06:39:12 +00:00
|
|
|
/**
|
|
|
|
* @see SendMediaGroup
|
|
|
|
*/
|
|
|
|
@RiskFeature(rawSendingMediaGroupsWarning)
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendMediaGroup(
|
2020-02-15 09:33:04 +00:00
|
|
|
chatId: ChatIdentifier,
|
|
|
|
media: List<MediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-02-15 09:33:04 +00:00
|
|
|
) = execute(
|
2021-01-19 04:52:30 +00:00
|
|
|
SendMediaGroup<MediaGroupContent>(
|
2020-11-05 17:48:23 +00:00
|
|
|
chatId, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2020-11-02 06:39:12 +00:00
|
|
|
/**
|
|
|
|
* @see SendMediaGroup
|
|
|
|
*/
|
|
|
|
@RiskFeature(rawSendingMediaGroupsWarning)
|
2020-10-04 07:18:24 +00:00
|
|
|
suspend fun TelegramBot.sendMediaGroup(
|
2020-02-15 09:33:04 +00:00
|
|
|
chat: Chat,
|
|
|
|
media: List<MediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-02-15 09:33:04 +00:00
|
|
|
) = sendMediaGroup(
|
2020-11-05 17:48:23 +00:00
|
|
|
chat.id, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-02-15 09:33:04 +00:00
|
|
|
)
|
2020-10-04 10:47:30 +00:00
|
|
|
|
2020-11-02 06:39:12 +00:00
|
|
|
/**
|
|
|
|
* @see SendPlaylist
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendPlaylist(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
media: List<AudioMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = execute(
|
|
|
|
SendPlaylist(
|
2020-11-05 17:48:23 +00:00
|
|
|
chatId, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see SendPlaylist
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendPlaylist(
|
|
|
|
chat: Chat,
|
|
|
|
media: List<AudioMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = sendPlaylist(
|
2020-11-05 17:48:23 +00:00
|
|
|
chat.id, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see SendDocumentsGroup
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendDocumentsGroup(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
media: List<DocumentMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = execute(
|
|
|
|
SendDocumentsGroup(
|
2020-11-05 17:48:23 +00:00
|
|
|
chatId, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see SendDocumentsGroup
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendDocumentsGroup(
|
|
|
|
chat: Chat,
|
|
|
|
media: List<DocumentMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = sendDocumentsGroup(
|
2020-11-05 17:48:23 +00:00
|
|
|
chat.id, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see SendVisualMediaGroup
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
media: List<VisualMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = execute(
|
|
|
|
SendVisualMediaGroup(
|
2020-11-05 17:48:23 +00:00
|
|
|
chatId, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @see SendVisualMediaGroup
|
|
|
|
*/
|
|
|
|
suspend fun TelegramBot.sendVisualMediaGroup(
|
|
|
|
chat: Chat,
|
|
|
|
media: List<VisualMediaGroupMemberInputMedia>,
|
|
|
|
disableNotification: Boolean = false,
|
2020-11-05 17:48:23 +00:00
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
allowSendingWithoutReply: Boolean? = null
|
2020-11-02 06:39:12 +00:00
|
|
|
) = sendVisualMediaGroup(
|
2020-11-05 17:48:23 +00:00
|
|
|
chat.id, media, disableNotification, replyToMessageId, allowSendingWithoutReply
|
2020-11-02 06:39:12 +00:00
|
|
|
)
|