Method PruneAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
PruneAsync(int, bool, IEnumerable<DiscordRole>?, string?)
Prunes inactive users from this guild.
public Task<int?> PruneAsync(int days = 7, bool computePruneCount = true, IEnumerable<DiscordRole>? includedRoles = null, string? reason = null)
Parameters
daysintMinimum number of inactivity days required for users to be pruned. Defaults to 7.
computePruneCountboolWhether to return the prune count after this method completes. This is discouraged for larger guilds.
includedRolesIEnumerable<DiscordRole>The roles to be included in the prune.
reasonstringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageChannels permission.
- NotFoundException
Thrown when the guild does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
PruneAsync(int, bool, IEnumerable<ulong>?, string?)
Prunes inactive users from this guild.
public Task<int?> PruneAsync(int days = 7, bool computePruneCount = true, IEnumerable<ulong>? includedRoleIds = null, string? reason = null)
Parameters
daysintMinimum number of inactivity days required for users to be pruned. Defaults to 7.
computePruneCountboolWhether to return the prune count after this method completes. This is discouraged for larger guilds.
includedRoleIdsIEnumerable<ulong>The ids of roles to be included in the prune.
reasonstringReason for audit logs.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageChannels permission.
- NotFoundException
Thrown when the guild does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.