Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/discord.js/src/managers/GuildMemberManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ class GuildMemberManager extends CachedManager {
* .then(pruned => console.log(`I just pruned ${pruned} people!`))
* .catch(console.error);
*/
async prune({ days, dry = false, count: compute_prune_count, roles = [], reason } = {}) {
async prune({ days, dry = false, count: compute_prune_count, roles = [], reason, timeout } = {}) {
if (typeof days !== 'number') throw new DiscordjsTypeError(ErrorCodes.PruneDaysType);

const query = { days };
Expand All @@ -468,8 +468,16 @@ class GuildMemberManager extends CachedManager {
const endpoint = Routes.guildPrune(this.guild.id);

const { pruned } = await (dry
? this.client.rest.get(endpoint, { query: makeURLSearchParams(query), reason })
: this.client.rest.post(endpoint, { body: { ...query, compute_prune_count }, reason }));
? this.client.rest.get(endpoint, {
query: makeURLSearchParams(query),
reason,
timeout,
})
: this.client.rest.post(endpoint, {
body: { ...query, compute_prune_count },
reason,
timeout,
}));

return pruned;
}
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6190,6 +6190,7 @@ export interface GuildPruneMembersOptions {
dry?: boolean;
reason?: string;
roles?: readonly RoleResolvable[];
timeout?: number;
}

export interface GuildWidgetSettingsData {
Expand Down