3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-07 11:07:19 +00:00

mod actions reason aliases

Co-authored-by: metal0 <metal@i0.tf>
This commit is contained in:
almeidx 2023-12-28 10:40:05 +00:00
parent 3b98c3bdc1
commit 80c195f25e
No known key found for this signature in database
GPG key ID: 54402591B9053451
16 changed files with 92 additions and 34 deletions

View file

@ -6,8 +6,11 @@ import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { parseReason } from "./parseReason.js";
import { GuildPluginData } from "knub";
import { ModActionsPluginType } from "../types.js";
export async function updateCase(pluginData, msg: Message, args) {
export async function updateCase(pluginData: GuildPluginData<ModActionsPluginType>, msg: Message, args) {
let theCase: Case | undefined;
if (args.caseNumber != null) {
theCase = await pluginData.state.cases.findByCaseNumber(args.caseNumber);
@ -24,6 +27,8 @@ export async function updateCase(pluginData, msg: Message, args) {
sendErrorMessage(pluginData, msg.channel as TextChannel, "Text or attachment required");
return;
}
const config = pluginData.config.get();
args.note &&= parseReason(config, args.note);
const note = formatReasonWithAttachments(args.note, [...msg.attachments.values()]);