Skip to content

Commit

Permalink
refactor(guildbanmanager): rename days option to deleteMessageDays
Browse files Browse the repository at this point in the history
BREAKING CHANGE: renamed option in BanOptions
  • Loading branch information
ImRodry committed Feb 13, 2022
1 parent 3ae6f3c commit ee517e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/managers/GuildBanManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class GuildBanManager extends CachedManager {
/**
* Options used to ban a user from a guild.
* @typedef {Object} BanOptions
* @property {number} [days] Number of days of messages to delete, must be between 0 and 7, inclusive
* @property {number} [deleteMessageDays] Number of days of messages to delete, must be between 0 and 7, inclusive
* @property {string} [reason] The reason for the ban
*/

Expand All @@ -142,7 +142,7 @@ class GuildBanManager extends CachedManager {
const id = this.client.users.resolveId(user);
if (!id) throw new Error('BAN_RESOLVE_ID', true);
await this.client.rest.put(Routes.guildBan(this.guild.id, id), {
body: { delete_message_days: options.days },
body: { delete_message_days: options.deleteMessageDays },
reason: options.reason,
});
if (user instanceof GuildMember) return user;
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/src/managers/GuildMemberManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class GuildMemberManager extends CachedManager {
* .then(banInfo => console.log(`Banned ${banInfo.user?.tag ?? banInfo.tag ?? banInfo}`))
* .catch(console.error);
*/
ban(user, options = { days: 0 }) {
ban(user, options) {
return this.guild.bans.create(user, options);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3401,7 +3401,7 @@ export interface AwaitReactionsOptions extends ReactionCollectorOptions {
}

export interface BanOptions {
days?: number;
deleteMessageDays?: number;
reason?: string;
}

Expand Down

0 comments on commit ee517e0

Please sign in to comment.