Class GuildDeleteEvent
- java.lang.Object
-
- discord4j.core.event.domain.Event
-
- discord4j.core.event.domain.guild.GuildEvent
-
- discord4j.core.event.domain.guild.GuildDeleteEvent
-
public class GuildDeleteEvent extends GuildEvent
Dispatched in two different scenarios:- The bot is kicked from or leaves a guild.
- A guild becomes unavailable during an outage. In this scenario,
unavailable
will be true.
This event is dispatched by Discord.
- See Also:
- Guild Delete
-
-
Constructor Summary
Constructors Constructor Description GuildDeleteEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long guildId, Guild guild, boolean unavailable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Guild>
getGuild()
Gets theGuild
involved in this event, if present.Snowflake
getGuildId()
boolean
isUnavailable()
Gets whether or not theGuild
is now unavailable.String
toString()
-
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
-
-
-
Constructor Detail
-
GuildDeleteEvent
public GuildDeleteEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, long guildId, @Nullable Guild guild, boolean unavailable)
-
-
Method Detail
-
getGuild
public Optional<Guild> getGuild()
Gets theGuild
involved in this event, if present.- Returns:
- The
Guild
involved in this event, if present.
-
isUnavailable
public boolean isUnavailable()
Gets whether or not theGuild
is now unavailable.- Returns:
- Whether or not the
Guild
is unavailable.
-
-