Class RoleUpdater



  • public class RoleUpdater
    extends Object
    This class can be used to update the settings of a role.
    • Constructor Detail

      • RoleUpdater

        public RoleUpdater​(Role role)
        Creates a new role updater.
        Parameters:
        role - The role to update.
    • Method Detail

      • setAuditLogReason

        public RoleUpdater setAuditLogReason​(String reason)
        Sets the reason for this update. This reason will be visible in the audit log entry(s).
        Parameters:
        reason - The reason for this update.
        Returns:
        The current instance in order to chain call methods.
      • setName

        public RoleUpdater setName​(String name)
        Queues the name to be updated.
        Parameters:
        name - The new name of the role.
        Returns:
        The current instance in order to chain call methods.
      • setPermissions

        public RoleUpdater setPermissions​(Permissions permissions)
        Queues the permissions to be updated.
        Parameters:
        permissions - The new permissions of the role.
        Returns:
        The current instance in order to chain call methods.
      • setColor

        public RoleUpdater setColor​(Color color)
        Queues the color to be updated.
        Parameters:
        color - The new color of the role.
        Returns:
        The current instance in order to chain call methods.
      • setDisplaySeparatelyFlag

        public RoleUpdater setDisplaySeparatelyFlag​(boolean displaySeparately)
        Queues the display separately flag (sometimes called "hoist") to be updated.
        Parameters:
        displaySeparately - The new display separately flag of the role.
        Returns:
        The current instance in order to chain call methods.
      • setMentionableFlag

        public RoleUpdater setMentionableFlag​(boolean mentionable)
        Queues the mentionable flag to be updated.
        Parameters:
        mentionable - The new mentionable flag of the role.
        Returns:
        The current instance in order to chain call methods.
      • update

        public CompletableFuture<Void> update​()
        Performs the queued updates.
        Returns:
        A future to check if the update was successful.