All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.dev.inmo.tgbotapi.extensions.api.send.media.SendMediaGroup.kt Maven / Gradle / Ivy

Go to download

API extensions with "Telegram Bot API"-like extensions for TelegramBot and RequestsExecutor

There is a newer version: 20.0.1
Show newest version
package dev.inmo.tgbotapi.extensions.api.send.media

import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.send.media.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.*
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.*
import dev.inmo.tgbotapi.utils.RiskFeature
import kotlin.jvm.JvmName

/**
 * @see SendMediaGroup
 */
@RiskFeature(rawSendingMediaGroupsWarning)
public suspend fun TelegramBot.sendMediaGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = execute(
    SendMediaGroup(
        chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
    )
)

/**
 * @see SendMediaGroup
 */
@RiskFeature(rawSendingMediaGroupsWarning)
public suspend fun TelegramBot.sendMediaGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendMediaGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendMediaGroup
 */
@RiskFeature(rawSendingMediaGroupsWarning)
@JvmName("sendMedaGroupByContent")
public suspend fun TelegramBot.sendMediaGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendMediaGroup(
    chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendMediaGroup
 */
@RiskFeature(rawSendingMediaGroupsWarning)
@JvmName("sendMedaGroupByContent")
public suspend fun TelegramBot.sendMediaGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendMediaGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendPlaylist
 */
public suspend fun TelegramBot.sendPlaylist(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = execute(
    SendPlaylist(
        chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
    )
)

/**
 * @see SendPlaylist
 */
public suspend fun TelegramBot.sendPlaylist(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendPlaylist(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendPlaylist
 */
@JvmName("sendPlaylistByContent")
public suspend fun TelegramBot.sendPlaylist(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendPlaylist(
    chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendPlaylist
 */
@JvmName("sendPlaylistByContent")
public suspend fun TelegramBot.sendPlaylist(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendPlaylist(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendDocumentsGroup
 */
public suspend fun TelegramBot.sendDocumentsGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = execute(
    SendDocumentsGroup(
        chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
    )
)

/**
 * @see SendDocumentsGroup
 */
public suspend fun TelegramBot.sendDocumentsGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendDocumentsGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendDocumentsGroup
 */
@JvmName("sendDocumentsByContent")
public suspend fun TelegramBot.sendDocumentsGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendDocumentsGroup(
    chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendDocumentsGroup
 */
@JvmName("sendDocumentsByContent")
public suspend fun TelegramBot.sendDocumentsGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendDocumentsGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendVisualMediaGroup
 */
public suspend fun TelegramBot.sendVisualMediaGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = execute(
    SendVisualMediaGroup(
        chatId, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
    )
)

/**
 * @see SendVisualMediaGroup
 */
public suspend fun TelegramBot.sendVisualMediaGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendVisualMediaGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendVisualMediaGroup
 */
@JvmName("sendVisualMediaGroupByContent")
public suspend fun TelegramBot.sendVisualMediaGroup(
    chatId: ChatIdentifier,
    media: List,
    threadId: MessageThreadId? = chatId.threadId,
    businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendVisualMediaGroup(
    chatId, media.map { it.toMediaGroupMemberTelegramMedia() }, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)

/**
 * @see SendVisualMediaGroup
 */
@JvmName("sendVisualMediaGroupByContent")
public suspend fun TelegramBot.sendVisualMediaGroup(
    chat: Chat,
    media: List,
    threadId: MessageThreadId? = chat.id.threadId,
    businessConnectionId: BusinessConnectionId? = chat.id.businessConnectionId,
    disableNotification: Boolean = false,
    protectContent: Boolean = false,
    effectId: EffectId? = null,
    replyParameters: ReplyParameters? = null
): ContentMessage> = sendVisualMediaGroup(
    chat.id, media, threadId, businessConnectionId, disableNotification, protectContent, effectId, replyParameters
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy