Class LegacyRoleCreateSpec

  • All Implemented Interfaces:
    LegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>, LegacySpec<discord4j.discordjson.json.RoleCreateRequest>

    public class LegacyRoleCreateSpec
    extends Object
    implements LegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>
    LegacySpec used to create a new guild Role entity.
    See Also:
    Create Guild Role
    • Constructor Detail

      • LegacyRoleCreateSpec

        public LegacyRoleCreateSpec()
    • Method Detail

      • setName

        public LegacyRoleCreateSpec setName​(String name)
        Sets the name of the created Role.
        Parameters:
        name - The role name.
        Returns:
        This spec.
      • setPermissions

        public LegacyRoleCreateSpec setPermissions​(PermissionSet permissions)
        Sets the enabled/disabled permissions, in the form of a PermissionSet for the created Role.
        Parameters:
        permissions - The role permissions.
        Returns:
        This spec.
      • setColor

        public LegacyRoleCreateSpec setColor​(Color color)
        Sets the color of the created Role.
        Parameters:
        color - The role color.
        Returns:
        This spec.
      • setHoist

        public LegacyRoleCreateSpec setHoist​(boolean hoist)
        Sets whether the created Role should be displayed separately in the sidebar.
        Parameters:
        hoist - The role hoisted property.
        Returns:
        This spec.
      • setMentionable

        public LegacyRoleCreateSpec setMentionable​(boolean mentionable)
        Sets whether the created Role should be mentionable.
        Parameters:
        mentionable - The role mentionable property.
        Returns:
        This spec.
      • getReason

        @Nullable
        public String getReason()
        Description copied from interface: LegacyAuditSpec
        Returns the current audit log reason set on the spec.
        Specified by:
        getReason in interface LegacyAuditSpec<discord4j.discordjson.json.RoleCreateRequest>
        Returns:
        The current audit log reason.
      • asRequest

        public discord4j.discordjson.json.RoleCreateRequest asRequest()
        Specified by:
        asRequest in interface LegacySpec<discord4j.discordjson.json.RoleCreateRequest>