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.GuildVoiceJoinEvent
-
- All Implemented Interfaces:
GenericEvent
,GuildVoiceUpdateEvent
,UpdateEvent<Member,VoiceChannel>
public class GuildVoiceJoinEvent extends GenericGuildVoiceEvent
Indicates that aMember
connected to aVoiceChannel
.When the
Member
is moved aGuildVoiceMoveEvent
is fired insteadCan be used to detect when a member joins a voice channel for the first time.
-
-
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 VoiceChannel
getChannelJoined()
TheVoiceChannel
that was joinedVoiceChannel
getChannelLeft()
TheVoiceChannel
that theMember
is moved fromMember
getEntity()
The affected entityVoiceChannel
getNewValue()
The new valueVoiceChannel
getOldValue()
The old valueString
getPropertyIdentifier()
The field name for the updated propertyString
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.UpdateEvent
getEntityType
-
-
-
-
Method Detail
-
getChannelJoined
@Nonnull public VoiceChannel getChannelJoined()
Description copied from interface:GuildVoiceUpdateEvent
TheVoiceChannel
that was joined- Specified by:
getChannelJoined
in interfaceGuildVoiceUpdateEvent
- Returns:
- The
VoiceChannel
-
getNewValue
@Nonnull public VoiceChannel getNewValue()
Description copied from interface:UpdateEvent
The new value- Specified by:
getNewValue
in interfaceUpdateEvent<Member,VoiceChannel>
- Returns:
- The new value
-
getChannelLeft
@Nullable public VoiceChannel getChannelLeft()
Description copied from interface:GuildVoiceUpdateEvent
TheVoiceChannel
that theMember
is moved from- Specified by:
getChannelLeft
in interfaceGuildVoiceUpdateEvent
- Returns:
- The
VoiceChannel
-
getPropertyIdentifier
@Nonnull public String getPropertyIdentifier()
Description copied from interface:UpdateEvent
The field name for the updated propertyExample
@Override public void onGenericRoleUpdate(GenericRoleUpdateEvent event) { switch (event.getPropertyIdentifier()) { case RoleUpdateColorEvent.IDENTIFIER: System.out.printf("Updated color for role: %s%n", event); break; case RoleUpdatePositionEvent.IDENTIFIER: RoleUpdatePositionEvent update = (RoleUpdatePositionEvent) event; System.out.printf("Updated position for role: %s raw(%s->%s)%n", event, update.getOldPositionRaw(), update.getNewPositionRaw()); break; default: return; } }
- Specified by:
getPropertyIdentifier
in interfaceUpdateEvent<Member,VoiceChannel>
- Returns:
- The name of the updated property
-
getEntity
@Nonnull public Member getEntity()
Description copied from interface:UpdateEvent
The affected entity- Specified by:
getEntity
in interfaceUpdateEvent<Member,VoiceChannel>
- Returns:
- The affected entity
-
getOldValue
@Nullable public VoiceChannel getOldValue()
Description copied from interface:UpdateEvent
The old value- Specified by:
getOldValue
in interfaceUpdateEvent<Member,VoiceChannel>
- Returns:
- The old value
-
-