From 7315060127beafe397375126bec3e51151e6f39c Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 5 Apr 2022 22:43:59 +0300 Subject: [PATCH] warn & ban --- .../components/commands/moderation/Ban.js | 38 +++++++++++++++++++ .../components/commands/moderation/Warn.js | 24 ++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/structure/components/commands/moderation/Ban.js create mode 100644 src/structure/components/commands/moderation/Warn.js diff --git a/src/structure/components/commands/moderation/Ban.js b/src/structure/components/commands/moderation/Ban.js new file mode 100644 index 0000000..840313c --- /dev/null +++ b/src/structure/components/commands/moderation/Ban.js @@ -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; \ No newline at end of file diff --git a/src/structure/components/commands/moderation/Warn.js b/src/structure/components/commands/moderation/Warn.js new file mode 100644 index 0000000..a2d4a39 --- /dev/null +++ b/src/structure/components/commands/moderation/Warn.js @@ -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; \ No newline at end of file