Class GuildVoiceJoinEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.guild.GenericGuildEvent
-
- net.dv8tion.jda.api.events.guild.voice.GenericGuildVoiceEvent
-
- net.dv8tion.jda.api.events.guild.voice.GenericGuildVoiceUpdateEvent
-
- net.dv8tion.jda.api.events.guild.voice.GuildVoiceJoinEvent
-
- All Implemented Interfaces:
GenericEvent
,GuildVoiceUpdateEvent
,UpdateEvent<Member,AudioChannel>
public class GuildVoiceJoinEvent extends GenericGuildVoiceUpdateEvent
Indicates that aMember
connected to aAudioChannel
.When the
Member
is moved aGuildVoiceMoveEvent
is fired insteadCan be used to detect when a member joins a voice channel for the first time.
Requirements
This event requires the
VOICE_STATE
CacheFlag to be enabled, which requires theGUILD_VOICE_STATES
intent.createLight(String)
disables that CacheFlag by default!Additionally, this event requires the
MemberCachePolicy
to cache the updated members. Discord does not specifically tell us about the updates, but merely tells us the member was updated and gives us the updated member object. In order to fire a specific event like this we need to have the old member cached to compare against.
-
-
Field Summary
-
Fields inherited from interface net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent
IDENTIFIER
-
-
Constructor Summary
Constructors Constructor Description GuildVoiceJoinEvent(JDA api, long responseNumber, Member member)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AudioChannel
getChannelJoined()
TheAudioChannel
that was joinedAudioChannel
getNewValue()
The new value-
Methods inherited from class net.dv8tion.jda.api.events.guild.voice.GenericGuildVoiceUpdateEvent
getChannelLeft, getEntity, getOldValue, getPropertyIdentifier, toString
-
Methods inherited from class net.dv8tion.jda.api.events.guild.voice.GenericGuildVoiceEvent
getMember, getVoiceState
-
Methods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuild
-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getResponseNumber
-
Methods inherited from interface net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent
getGuild, getMember
-
Methods inherited from interface net.dv8tion.jda.api.events.UpdateEvent
getEntityType
-
-
-
-
Method Detail
-
getChannelJoined
@Nonnull public AudioChannel getChannelJoined()
Description copied from interface:GuildVoiceUpdateEvent
TheAudioChannel
that was joined- Specified by:
getChannelJoined
in interfaceGuildVoiceUpdateEvent
- Overrides:
getChannelJoined
in classGenericGuildVoiceUpdateEvent
- Returns:
- The
AudioChannel
-
getNewValue
@Nonnull public AudioChannel getNewValue()
Description copied from interface:UpdateEvent
The new value- Specified by:
getNewValue
in interfaceUpdateEvent<Member,AudioChannel>
- Overrides:
getNewValue
in classGenericGuildVoiceUpdateEvent
- Returns:
- The new value
-
-