Class LegacyGuildPruneSpec

java.lang.Object
discord4j.core.spec.legacy.LegacyGuildPruneSpec
All Implemented Interfaces:
LegacyAuditSpec<Multimap<String,Object>>, LegacySpec<Multimap<String,Object>>

public class LegacyGuildPruneSpec extends Object implements LegacyAuditSpec<Multimap<String,Object>>
LegacySpec used to begin a prune operation.
See Also:
  • Constructor Details

    • LegacyGuildPruneSpec

      public LegacyGuildPruneSpec()
  • Method Details

    • setDays

      public LegacyGuildPruneSpec setDays(int days)
      Set the number of days to prune.
      Parameters:
      days - the number of days
      Returns:
      this spec
    • addRole

      public LegacyGuildPruneSpec addRole(Snowflake roleId)
      Include a role in the prune request. By default, prune will not remove users with roles, therefore this method can be used to include such users.
      Parameters:
      roleId - the role ID to include for prune
      Returns:
      this spec
    • addRoles

      public LegacyGuildPruneSpec addRoles(Collection<Snowflake> roleIds)
      Include multiple roles in the prune request. By default, prune will not remove users with roles, therefore this method can be used to include such users.
      Parameters:
      roleIds - the role IDs to include for prune
      Returns:
      this spec
    • setComputePruneCount

      public LegacyGuildPruneSpec setComputePruneCount(boolean enable)
      Set whether the number of pruned members is returned when this actions completes. By default this is enabled, but this is discouraged on large guilds so you can set it to false.
      Parameters:
      enable - whether the pruned total is returned, if false, the prune action will eventually complete with an empty Mono.
      Returns:
      this spec
    • setReason

      public LegacyGuildPruneSpec setReason(String reason)
      Description copied from interface: LegacyAuditSpec
      Sets the reason to show in the audit logs when the spec is built.
      Specified by:
      setReason in interface LegacyAuditSpec<Multimap<String,Object>>
      Parameters:
      reason - The audit log reason.
      Returns:
      This spec.
    • getReason

      public String getReason()
      Description copied from interface: LegacyAuditSpec
      Returns the current audit log reason set on the spec.
      Specified by:
      getReason in interface LegacyAuditSpec<Multimap<String,Object>>
      Returns:
      The current audit log reason.
    • asRequest

      public Multimap<String,Object> asRequest()
      Specified by:
      asRequest in interface LegacySpec<Multimap<String,Object>>