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:
parent
3b98c3bdc1
commit
80c195f25e
16 changed files with 92 additions and 34 deletions
|
@ -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()]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue