Method GetPruneCountAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
GetPruneCountAsync(int, IEnumerable<DiscordRole>)
Estimates the number of users to be pruned.
public Task<int> GetPruneCountAsync(int days = 7, IEnumerable<DiscordRole> includedRoles = null)
Parameters
days
intMinimum number of inactivity days required for users to be pruned. Defaults to 7.
includedRoles
IEnumerable<DiscordRole>The roles to be included in the prune.
Returns
- Task<int>
Number of users that will be pruned.
Exceptions
- UnauthorizedException
Thrown when the client does not have the KickMembers 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.
GetPruneCountAsync(int, IEnumerable<ulong>?)
Estimates the number of users to be pruned.
public Task<int> GetPruneCountAsync(int days = 7, IEnumerable<ulong>? includedRoleIds = null)
Parameters
days
intMinimum number of inactivity days required for users to be pruned. Defaults to 7.
includedRoleIds
IEnumerable<ulong>The ids of roles to be included in the prune.
Returns
- Task<int>
Number of users that will be pruned.
Exceptions
- UnauthorizedException
Thrown when the client does not have the KickMembers 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.