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:
parent
2b8f75b91b
commit
529a0bfc0e
9 changed files with 39 additions and 1 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue