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

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

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

import dev.kord.common.entity.DiscordMessageInteraction
import dev.kord.common.entity.InteractionType
import dev.kord.common.entity.Snowflake
import kotlinx.serialization.Serializable

@Serializable
public data class MessageInteractionData(
    val id: Snowflake,
    val type: InteractionType,
    val name: String,
    val user: Snowflake
) {
    public companion object {
        public fun from(entity: DiscordMessageInteraction): MessageInteractionData = with(entity) {
            MessageInteractionData(id, type, name, user.id)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy