Package discord4j.core.spec.legacy
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:
- Begin Guild Prune
-
-
Constructor Summary
Constructors Constructor Description LegacyGuildPruneSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LegacyGuildPruneSpec
addRole(Snowflake roleId)
Include a role in the prune request.LegacyGuildPruneSpec
addRoles(Collection<Snowflake> roleIds)
Include multiple roles in the prune request.Multimap<String,Object>
asRequest()
String
getReason()
Returns the current audit log reason set on the spec.LegacyGuildPruneSpec
setComputePruneCount(boolean enable)
Set whether the number of pruned members is returned when this actions completes.LegacyGuildPruneSpec
setDays(int days)
Set the number of days to prune.LegacyGuildPruneSpec
setReason(String reason)
Sets the reason to show in the audit logs when the spec is built.
-
-
-
Method Detail
-
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 tofalse
.- Parameters:
enable
- whether the pruned total is returned, iffalse
, the prune action will eventually complete with an emptyMono
.- 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 interfaceLegacyAuditSpec<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 interfaceLegacyAuditSpec<Multimap<String,Object>>
- Returns:
- The current audit log reason.
-
-