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

commonMain.cache.data.ThreadMembersUpdateEventData.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.common.entity.optional.Optional
import dev.kord.common.entity.optional.mapList
import dev.kord.gateway.ThreadMembersUpdate

public class ThreadMembersUpdateEventData(
    public val id: Snowflake,
    public val guildId: Snowflake,
    public val memberCount: Int,
    public val addedMembers: Optional> = Optional.Missing(),
    public val removedMemberIds: Optional> = Optional.Missing()
) {
    public companion object {
        public fun from(event: ThreadMembersUpdate): ThreadMembersUpdateEventData = with(event.members) {
            ThreadMembersUpdateEventData(
                id,
                guildId,
                memberCount,
                addedMembers.mapList { ThreadMemberData.from(it) },
                removedMemberIds
            )
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy