Method PruneAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.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
days
intMinimum number of inactivity days required for users to be pruned. Defaults to 7.
computePruneCount
boolWhether to return the prune count after this method completes. This is discouraged for larger guilds.
includedRoles
IEnumerable<DiscordRole>The roles to be included in the prune.
reason
stringReason 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.