warn & ban

This commit is contained in:
Erik 2022-04-05 22:43:59 +03:00
parent 527d105bce
commit 7315060127
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,38 @@
const { ModerationCommand } = require("../../../interfaces");
const { Ban } = require("../../infractions/");
class BanCommand extends ModerationCommand {
constructor(client) {
super(client, {
name: 'ban',
description: 'Ban users',
module: 'moderation',
options: [
{
name: 'duration',
description: 'How long the user should be banned for',
type: 'TIME'
}, {
name: 'prune',
type: 'INTEGER',
description: 'How many days worth of messages to prune',
minimum: 1,
maximum: 7
}
]
});
}
async execute(interaction, { users, ...args }) {
return this.client.moderationManager.handleInfraction(Ban, interaction, {
targets: users.value,
args
});
}
}
module.exports = BanCommand;

View File

@ -0,0 +1,24 @@
const { ModerationCommand } = require("../../../interfaces");
const { Warn } = require("../../infractions");
class WarnCommand extends ModerationCommand {
constructor(client) {
super(client, {
name: 'warn',
description: 'Warn users',
module: 'moderation'
});
}
async execute(interaction, { users, ...args }) {
return this.client.moderationManager.handleInfraction(Warn, interaction, {
targets: users.value,
args
});
}
}
module.exports = WarnCommand;