Class UserUpdateFlagsEvent

  • All Implemented Interfaces:
    GenericEvent, UpdateEvent<User,​java.util.EnumSet<User.UserFlag>>

    public class UserUpdateFlagsEvent
    extends GenericUserUpdateEvent<java.util.EnumSet<User.UserFlag>>
    Indicates that the UserFlags of a User changed.

    Can be used to retrieve the User who got their flags changed and their previous flags.

    Identifier: public_flags

    Requirements

    This event requires the GUILD_MEMBERS intent to be enabled.
    createDefault(String) and createLight(String) disable this by default!

    Additionally, this event also 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.

    • Constructor Detail

      • UserUpdateFlagsEvent

        public UserUpdateFlagsEvent​(@Nonnull
                                    JDA api,
                                    long responseNumber,
                                    @Nonnull
                                    User user,
                                    @Nonnull
                                    java.util.EnumSet<User.UserFlag> oldFlags)
    • Method Detail

      • getOldFlags

        @Nonnull
        public java.util.EnumSet<User.UserFlag> getOldFlags()
        Gets the old UserFlags of the User as EnumSet.
        Returns:
        EnumSet of the old UserFlags
      • getOldFlagsRaw

        public int getOldFlagsRaw()
        Gets the old UserFlags of the user and returns it as bitmask representation.
        Returns:
        The old bitmask representation of the UserFlags.
      • getNewFlags

        @Nonnull
        public java.util.EnumSet<User.UserFlag> getNewFlags()
        Gets the new UserFlags of the User as EnumSet.
        Returns:
        The new EnumSet<{@link net.dv8tion.jda.api.entities.User.UserFlag UserFlag}> representation of the User's flags.
      • getNewFlagsRaw

        public int getNewFlagsRaw()
        Gets the new UserFlags of the user and returns it as bitmask representation.
        Returns:
        The new bitmask representation of the UserFlags.