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

commonMain.cache.data.MessageReferenceData.kt Maven / Gradle / Ivy

The newest version!
package dev.kord.core.cache.data

import dev.kord.common.entity.DiscordMessageReference
import dev.kord.common.entity.optional.OptionalSnowflake
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
public data class MessageReferenceData(
    @SerialName("message_id")
    val id: OptionalSnowflake = OptionalSnowflake.Missing,
    @SerialName("channel_id")
    val channelId: OptionalSnowflake = OptionalSnowflake.Missing,
    @SerialName("guild_id")
    val guildId: OptionalSnowflake = OptionalSnowflake.Missing,
) {
    public companion object {
        public fun from(entity: DiscordMessageReference): MessageReferenceData = with(entity) {
            return MessageReferenceData(id, channelId, guildId)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy