Class MemberLeaveEvent


public class MemberLeaveEvent extends GuildEvent
Dispatched when a user leaves a guild OR is kicked from it.

Discord does not differentiate between a user leaving on their own and being kicked. Except through audit logs, it is not possible to tell the difference between these.

This event is dispatched by Discord.

See Also:
  • Constructor Details

  • Method Details

    • getUser

      public User getUser()
      Gets the User that has left the Guild in this event.
      Returns:
      The User that has left the Guild
    • getGuildId

      public Snowflake getGuildId()
      Gets the Snowflake ID of the Guild that the User has left in this event.
      Returns:
      The ID of the Guild.
    • getGuild

      public Mono<Guild> getGuild()
      Requests to retrieve the Guild that the User has left in this event.
      Returns:
      A Mono where, upon successful completion, emits the Guild that the User has left. If an error is received, it is emitted through the Mono.
    • getMember

      public Optional<Member> getMember()
      Gets the Member object of the User that has left the Guild in this event, if present.
      Returns:
      The Member object of the User that has left the Guild, if present.
    • toString

      public String toString()
      Overrides:
      toString in class Object