3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 17:45:03 +00:00

feat(mod-actions): require reason

This commit is contained in:
Hiroyuki 2021-09-04 22:14:16 -04:00
parent 2b8f75b91b
commit 529a0bfc0e
No known key found for this signature in database
GPG key ID: 258488F5F6FE3CAE
9 changed files with 39 additions and 1 deletions

View file

@ -15,6 +15,7 @@ import { isBanned } from "../functions/isBanned";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
import { modActionsCmd } from "../types";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { TextChannel } from "discord.js";
const opts = {
mod: ct.member({ option: true }),
@ -52,7 +53,13 @@ export const BanCmd = modActionsCmd({
}
const time = args["time"] ? args["time"] : null;
const config = pluginData.config.get();
const reason = formatReasonWithAttachments(args.reason, [...msg.attachments.values()]);
if (!reason && config.require_reason.includes("ban")) {
sendErrorMessage(pluginData, msg.channel, "You must include a reason in your ban");
return;
}
const memberToBan = await resolveMember(pluginData.client, pluginData.guild, user.id);
// The moderator who did the action is the message author or, if used, the specified -mod
let mod = msg.member;