Class GenericGuildVoiceUpdateEvent
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
- All Implemented Interfaces:
GenericEvent,GuildVoiceUpdateEvent,UpdateEvent<Member,AudioChannel>
- Direct Known Subclasses:
GuildVoiceJoinEvent,GuildVoiceLeaveEvent,GuildVoiceMoveEvent
public class GenericGuildVoiceUpdateEvent
extends GenericGuildVoiceEvent
implements GuildVoiceUpdateEvent
Requirements
These events require the VOICE_STATE CacheFlag to be enabled, which requires
the GUILD_VOICE_STATES intent.
createLight(String) disables that CacheFlag by default!
Additionally, these events require 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 specific events like these 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
ConstructorsConstructorDescriptionGenericGuildVoiceUpdateEvent(JDA api, long responseNumber, Member member, AudioChannel left, AudioChannel joined) -
Method Summary
Modifier and TypeMethodDescriptionTheAudioChannelthat was joinedTheAudioChannelthat theMemberis moved fromThe affected entityThe new valueThe old valueThe field name for the updated propertytoString()Methods inherited from class net.dv8tion.jda.api.events.guild.voice.GenericGuildVoiceEvent
getMember, getVoiceStateMethods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuildMethods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumberMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getResponseNumberMethods inherited from interface net.dv8tion.jda.api.events.guild.voice.GuildVoiceUpdateEvent
getGuild, getMemberMethods inherited from interface net.dv8tion.jda.api.events.UpdateEvent
getEntityType
-
Constructor Details
-
GenericGuildVoiceUpdateEvent
public GenericGuildVoiceUpdateEvent(@Nonnull JDA api, long responseNumber, @Nonnull Member member, @Nullable AudioChannel left, @Nullable AudioChannel joined)
-
-
Method Details
-
getChannelLeft
Description copied from interface:GuildVoiceUpdateEventTheAudioChannelthat theMemberis moved from- Specified by:
getChannelLeftin interfaceGuildVoiceUpdateEvent- Returns:
- The
AudioChannel
-
getChannelJoined
Description copied from interface:GuildVoiceUpdateEventTheAudioChannelthat was joined- Specified by:
getChannelJoinedin interfaceGuildVoiceUpdateEvent- Returns:
- The
AudioChannel
-
getPropertyIdentifier
Description copied from interface:UpdateEventThe 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:
getPropertyIdentifierin interfaceUpdateEvent<Member,AudioChannel> - Returns:
- The name of the updated property
-
getEntity
Description copied from interface:UpdateEventThe affected entity- Specified by:
getEntityin interfaceUpdateEvent<Member,AudioChannel> - Returns:
- The affected entity
-
getOldValue
Description copied from interface:UpdateEventThe old value- Specified by:
getOldValuein interfaceUpdateEvent<Member,AudioChannel> - Returns:
- The old value
-
getNewValue
Description copied from interface:UpdateEventThe new value- Specified by:
getNewValuein interfaceUpdateEvent<Member,AudioChannel> - Returns:
- The new value
-
toString
-