Discore
Show / Hide Table of Contents

Method BeginGuildPrune

| Improve this Doc View Source

BeginGuildPrune(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 includeRoles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

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
| Improve this Doc View Source

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 includeRoles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

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
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX