commonMain.event.guild.MemberLeaveEvent.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.event.guild
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.GuildBehavior
import dev.kord.core.entity.Guild
import dev.kord.core.entity.Member
import dev.kord.core.entity.User
import dev.kord.core.event.Event
public class MemberLeaveEvent(
public val user: User,
public val old: Member?,
public val guildId: Snowflake,
override val shard: Int,
override val customContext: Any?,
) : Event {
override val kord: Kord get() = user.kord
public val guild: GuildBehavior get() = GuildBehavior(guildId, kord)
public suspend fun getGuild(): Guild = guild.asGuild()
public suspend fun getGuildOrNull(): Guild? = guild.asGuildOrNull()
override fun toString(): String {
return "MemberLeaveEvent(user=$user, old=$old, guildId=$guildId, shard=$shard)"
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy