commonMain.cache.data.GuildPreviewData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-core-jvm Show documentation
Show all versions of kord-core-jvm Show documentation
Idiomatic Kotlin Wrapper for The Discord API
The newest version!
package dev.kord.core.cache.data
import dev.kord.common.entity.DiscordGuildPreview
import dev.kord.common.entity.GuildFeature
import dev.kord.common.entity.Snowflake
import kotlinx.serialization.Serializable
@Serializable
public class GuildPreviewData(
public val id: Snowflake,
public val name: String,
public val icon: String? = null,
public val splash: String? = null,
public val discoverySplash: String? = null,
public val emojis: List,
public val features: List,
public val approximateMemberCount: Int,
public val approximatePresenceCount: Int,
public val description: String? = null,
public val stickers: List,
) {
public companion object {
public fun from(entity: DiscordGuildPreview): GuildPreviewData = with(entity) {
GuildPreviewData(
id,
name,
icon,
splash,
discoverySplash,
emojis.map { EmojiData.from(guildId = id, id = it.id!!, entity = it) },
features,
approximateMemberCount,
approximatePresenceCount,
description,
stickers.map { StickerData.from(it) },
)
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy