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

commonMain.com.github.insanusmokrassar.TelegramBotAPI.utils.MediaGroupList.kt Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
package com.github.insanusmokrassar.TelegramBotAPI.utils

import com.github.insanusmokrassar.TelegramBotAPI.types.MediaGroupIdentifier
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ForwardInfo
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate

val List.forwarded: ForwardInfo?
    get() = first().let {
        (it as? PossiblyForwardedMessage) ?.forwardInfo
    }

val List.replyTo: Message?
    get() = first().let {
        (it as? PossiblyReplyMessage) ?.replyTo
    }

val List.chat: Chat?
    get() = first().data.chat

val List.mediaGroupId: MediaGroupIdentifier?
    get() = (first().data as? MediaGroupMessage) ?.mediaGroupId




© 2015 - 2024 Weber Informatics LLC | Privacy Policy