Class GuildMemberUpdateAvatarEvent
- All Implemented Interfaces:
GenericEvent, UpdateEvent<Member,String>
Member updated their Guild avatar.
Can be used to retrieve members who change their per guild avatar, the triggering guild, the old avatar id and the new avatar id.
Identifier: avatar
Requirements
This event requires the GUILD_MEMBERS intent to be enabled.
createDefault(String) and
createLight(String) disable this 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 -
Constructor Summary
ConstructorsConstructorDescriptionGuildMemberUpdateAvatarEvent(JDA api, long responseNumber, Member member, String oldAvatarId) -
Method Summary
Modifier and TypeMethodDescriptionReturns anImageProxyfor this member's new avatar.getNewAvatar(ImageFormat format) Returns anImageProxyfor this member's new avatar.The new avatar idThe url of the new avatargetNewAvatarUrl(ImageFormat format) The url of the new avatarReturns anImageProxyfor this member's old avatar.getOldAvatar(ImageFormat format) Returns anImageProxyfor this member's old avatar.The old avatar idThe previous avatar urlgetOldAvatarUrl(ImageFormat format) The previous avatar urlMethods inherited from class GenericGuildMemberUpdateEvent
getEntity, getNewValue, getOldValue, getPropertyIdentifierMethods inherited from class GenericGuildMemberEvent
getMember, getUserMethods inherited from class GenericGuildEvent
getGuildMethods inherited from class Event
getJDA, getRawData, getResponseNumber, toStringMethods inherited from interface GenericEvent
getJDA, getRawData, getResponseNumberMethods inherited from interface UpdateEvent
getEntityType
-
Field Details
-
IDENTIFIER
- See Also:
-
-
Constructor Details
-
GuildMemberUpdateAvatarEvent
-
-
Method Details
-
getOldAvatarId
-
getOldAvatarUrl
-
getOldAvatarUrl
The previous avatar url- Parameters:
format- The format in which the image should be- Returns:
- The previous avatar url
- Throws:
IllegalArgumentException- If the format isnull- See Also:
-
getOldAvatar
Returns anImageProxyfor this member's old avatar.Note: the old avatar may not always be downloadable as it might have been removed from Discord.
- Returns:
- Possibly-null
ImageProxyof this member's old avatar - See Also:
-
getOldAvatar
Returns anImageProxyfor this member's old avatar.Note: the old avatar may not always be downloadable as it might have been removed from Discord.
- Parameters:
format- The format in which the image should be- Returns:
- Possibly-null
ImageProxyof this member's old avatar - Throws:
IllegalArgumentException- If the format isnull- See Also:
-
getNewAvatarId
-
getNewAvatarUrl
The url of the new avatar- Returns:
- The url of the new avatar
-
getNewAvatarUrl
The url of the new avatar- Parameters:
format- The format in which the image should be- Returns:
- The url of the new avatar
- Throws:
IllegalArgumentException- If the format isnull- See Also:
-
getNewAvatar
Returns anImageProxyfor this member's new avatar.- Returns:
- Possibly-null
ImageProxyof this member's new avatar - See Also:
-
getNewAvatar
Returns anImageProxyfor this member's new avatar.- Parameters:
format- The format in which the image should be- Returns:
- Possibly-null
ImageProxyof this member's new avatar - Throws:
IllegalArgumentException- If the format isnull- See Also:
-