Method BeginGuildPrune
| Improve this Doc View SourceBeginGuildPrune(Snowflake, int?, IEnumerable<Snowflake>?, bool?)
Begins a member prune operation, kicking every member that has been offline for the specified number of days.
Requires KickMembers.
Declaration
public Task<int?> BeginGuildPrune(Snowflake guildId, int? days = null, IEnumerable<Snowflake>? includeRoles = null, bool? computePruneCount = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Snowflake | guildId | |
| int? | days | The number of days to prune (1-30). |
| IEnumerable<Snowflake> | includeRoles | By default, prune will not remove users with roles. You can optionally include specific
roles in your prune by providing the |
| bool? | computePruneCount | For large guilds it's recommended to set this to false. When false, this method will return null. |
Returns
| Type | Description |
|---|---|
| Task<int?> |
Exceptions
| Type | Condition |
|---|---|
| DiscordHttpApiException |
BeginGuildPrune(DiscordGuild, int?, IEnumerable<DiscordRole>?, bool?)
Begins a member prune operation, kicking every member that has been offline for the specified number of days.
Requires KickMembers.
Declaration
public Task<int?> BeginGuildPrune(DiscordGuild guild, int? days = null, IEnumerable<DiscordRole>? includeRoles = null, bool? computePruneCount = null)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscordGuild | guild | |
| int? | days | The number of days to prune (1-30). |
| IEnumerable<DiscordRole> | includeRoles | By default, prune will not remove users with roles. You can optionally include specific
roles in your prune by providing the |
| bool? | computePruneCount | For large guilds it's recommended to set this to false. When false, this method will return null. |
Returns
| Type | Description |
|---|---|
| Task<int?> |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | |
| DiscordHttpApiException |