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