Class UserUpdateNameEvent
- java.lang.Object
- 
- net.dv8tion.jda.api.events.Event
- 
- net.dv8tion.jda.api.events.user.GenericUserEvent
- 
- net.dv8tion.jda.api.events.user.update.GenericUserUpdateEvent<java.lang.String>
- 
- net.dv8tion.jda.api.events.user.update.UserUpdateNameEvent
 
 
 
 
- 
- All Implemented Interfaces:
- GenericEvent,- UpdateEvent<User,java.lang.String>
 
 public class UserUpdateNameEvent extends GenericUserUpdateEvent<java.lang.String> Indicates that the username of aUserchanged. (Not Nickname)Can be used to retrieve the User who changed their username and their previous username. Identifier: nameRequirementsThis event requires the GUILD_MEMBERSintent to be enabled.createDefault(String)andcreateLight(String)disable this by default!Additionally, this event requires the MemberCachePolicyto 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 SummaryFields Modifier and Type Field Description static java.lang.StringIDENTIFIER
 - 
Constructor SummaryConstructors Constructor Description UserUpdateNameEvent(JDA api, long responseNumber, User user, java.lang.String oldName)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetNewName()The new usernamejava.lang.StringgetNewValue()The new valuejava.lang.StringgetOldName()The old usernamejava.lang.StringgetOldValue()The old value- 
Methods inherited from class net.dv8tion.jda.api.events.user.update.GenericUserUpdateEventgetEntity, getPropertyIdentifier, toString
 - 
Methods inherited from class net.dv8tion.jda.api.events.user.GenericUserEventgetUser
 - 
Methods inherited from class net.dv8tion.jda.api.events.EventgetJDA, getResponseNumber
 - 
Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface net.dv8tion.jda.api.events.GenericEventgetJDA, getResponseNumber
 - 
Methods inherited from interface net.dv8tion.jda.api.events.UpdateEventgetEntityType
 
- 
 
- 
- 
- 
Field Detail- 
IDENTIFIERpublic static final java.lang.String IDENTIFIER - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getOldName@Nonnull public java.lang.String getOldName() The old username- Returns:
- The old username
 
 - 
getNewName@Nonnull public java.lang.String getNewName() The new username- Returns:
- The new username
 
 - 
getOldValue@Nonnull public java.lang.String getOldValue() Description copied from interface:UpdateEventThe old value- Specified by:
- getOldValuein interface- UpdateEvent<User,java.lang.String>
- Overrides:
- getOldValuein class- GenericUserUpdateEvent<java.lang.String>
- Returns:
- The old value
 
 - 
getNewValue@Nonnull public java.lang.String getNewValue() Description copied from interface:UpdateEventThe new value- Specified by:
- getNewValuein interface- UpdateEvent<User,java.lang.String>
- Overrides:
- getNewValuein class- GenericUserUpdateEvent<java.lang.String>
- Returns:
- The new value
 
 
- 
 
-