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

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

There is a newer version: 0.15.0
Show newest version
package dev.kord.core.cache.data

import dev.kord.common.entity.Snowflake
import dev.kord.gateway.DiscordRemovedEmoji
import dev.kord.gateway.DiscordRemovedReactionEmoji
import kotlinx.serialization.Serializable

@Serializable
public data class RemovedReactionData(val id: Snowflake? = null, val name: String?) {
    public companion object {
        public fun from(entity: DiscordRemovedReactionEmoji): RemovedReactionData = with(entity) {
            RemovedReactionData(id, name)
        }
    }
}

@Serializable
public data class ReactionRemoveEmojiData(
    val channelId: Snowflake,
    val guildId: Snowflake,
    val messageId: Snowflake,
    val emoji: RemovedReactionData
) {
    public companion object {
        public fun from(entity: DiscordRemovedEmoji): ReactionRemoveEmojiData = with(entity) {
            ReactionRemoveEmojiData(channelId, guildId, messageId, RemovedReactionData.from(emoji))
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy