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
public class GenericChannelEvent extends Event
-
-
Constructor Summary
Constructors Constructor Description GenericChannelEvent(JDA api, long responseNumber, Channel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Channel
getChannel()
ChannelType
getChannelType()
Guild
getGuild()
TheGuild
in which this channel event happened.boolean
isFromGuild()
Whether this channel event happened in aGuild
.boolean
isFromType(ChannelType type)
-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Method Detail
-
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
@Nonnull public ChannelType getChannelType()
-
isFromType
public boolean isFromType(ChannelType type)
-
getGuild
@Nonnull public Guild 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:
isFromType(ChannelType)
,getChannelType()
-
-