Class GuildMemberRemoveEvent
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.guild.GenericGuildEvent
net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent
- All Implemented Interfaces:
GenericEvent
Indicates that a user was removed from a
This can be fired for uncached members and cached members alike. If the member was not cached by JDA, due to the
Guild
. This includes kicks, bans, and leaves respectively.
This can be fired for uncached members and cached members alike. If the member was not cached by JDA, due to the
MemberCachePolicy
or disabled member chunking, then getMember()
will return null
.
Can be used to detect when a member is removed from a guild, either by leaving or being kicked/banned.
Requirements
This event requires the GUILD_MEMBERS
intent to be enabled.
createDefault(String)
and
createLight(String)
disable this by default!
-
Constructor Summary
ConstructorDescriptionGuildMemberRemoveEvent
(JDA api, long responseNumber, Guild guild, User user, Member member) -
Method Summary
Methods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuild
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
Constructor Details
-
GuildMemberRemoveEvent
-
-
Method Details
-
getUser
The corresponding user who was removed from the guild.- Returns:
- The user who was removed
-
getMember
The member instance for this user, if it was cached at the time.
Discord does not provide the member meta-data when a remove event is dispatched.- Returns:
- Possibly-null member
-