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

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

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

import dev.kord.cache.api.data.DataDescription
import dev.kord.cache.api.data.description
import dev.kord.common.entity.DiscordGuildApplicationCommandPermissions
import dev.kord.common.entity.Snowflake

public data class GuildApplicationCommandPermissionsData(
    val id: Snowflake,
    val applicationId: Snowflake,
    val guildId: Snowflake,
    val permissions: List
) {

    public companion object {
        public val description: DataDescription =
            description(GuildApplicationCommandPermissionsData::id)

        public fun from(permissions: DiscordGuildApplicationCommandPermissions): GuildApplicationCommandPermissionsData =
            with(permissions) {
                GuildApplicationCommandPermissionsData(
                    id,
                    applicationId,
                    guildId,
                    this.permissions.map(GuildApplicationCommandPermissionData::from)
                )
            }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy