forked from Galactic/galactic-bot
warn & ban
This commit is contained in:
parent
527d105bce
commit
7315060127
38
src/structure/components/commands/moderation/Ban.js
Normal file
38
src/structure/components/commands/moderation/Ban.js
Normal 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;
|
24
src/structure/components/commands/moderation/Warn.js
Normal file
24
src/structure/components/commands/moderation/Warn.js
Normal 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;
|
Loading…
Reference in New Issue
Block a user