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

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

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

import dev.kord.common.entity.DiscordVoiceRegion
import dev.kord.common.entity.optional.OptionalSnowflake
import kotlinx.serialization.Serializable

@Serializable
public data class RegionData(
    val id: String,
    val guildId: OptionalSnowflake = OptionalSnowflake.Missing,
    val name: String,
    val optimal: Boolean,
    val deprecated: Boolean,
    val custom: Boolean,
) {
    public companion object {
        public fun from(guildId: OptionalSnowflake, region: DiscordVoiceRegion): RegionData = with(region) {
            RegionData(id, guildId, name, optimal, deprecated, custom)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy