Class GenericChannelEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.channel.GenericChannelEvent
- All Implemented Interfaces:
GenericEvent
- Direct Known Subclasses:
ChannelCreateEvent
,ChannelDeleteEvent
,GenericChannelUpdateEvent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetGuild()
TheGuild
in which this channel event happened.boolean
Whether this channel event happened in aGuild
.boolean
isFromType
(ChannelType type) Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
Constructor Details
-
GenericChannelEvent
-
-
Method Details
-
isFromGuild
public boolean isFromGuild()Whether this channel event happened in aGuild
.
If this isfalse
thengetGuild()
will throw anIllegalStateException
.- Returns:
- True, if
getChannelType()
.isGuild()
is true.
-
getChannelType
-
isFromType
-
getChannel
-
getGuild
TheGuild
in which this channel event happened.
If this channel event was not received in aTextChannel
, this will throw anIllegalStateException
.- Returns:
- The Guild in which this channel event happened
- Throws:
IllegalStateException
- If this channel event did not happen in aGuildChannel
.- See Also:
-