3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 13:07:20 +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

@ -32,7 +32,12 @@ export const NoteCmd = modActionsCmd({
}
const userName = user.tag;
const reason = formatReasonWithAttachments(args.note, [...msg.attachments.values()]);
const config = pluginData.config.get();
const reason = formatReasonWithAttachments(args.reason, [...msg.attachments.values()]);
if (!reason && config.require_reason.includes("note")) {
sendErrorMessage(pluginData, msg.channel, "You must include a reason in your note");
return;
}
const casesPlugin = pluginData.getPlugin(CasesPlugin);
const createdCase = await casesPlugin.createCase({