3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-14 05:45:02 +00:00

feat(ContextMenus): add new field to modals for case evidence

This commit is contained in:
Obliie 2023-07-16 19:48:53 +01:00
parent 26bf9363f9
commit 6689f91a6a
No known key found for this signature in database
GPG key ID: 9189A18F0D5B547E
4 changed files with 73 additions and 6 deletions

View file

@ -0,0 +1,28 @@
import { GuildMember } from "discord.js";
import { GuildPluginData } from "knub";
import { CaseTypes } from "../../../data/CaseTypes";
import { Case } from "../../../data/entities/Case";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin";
import { ContextMenuPluginType } from "../types";
export async function updateAction(
pluginData: GuildPluginData<ContextMenuPluginType>,
executingMember: GuildMember,
theCase: Case,
value: string,
) {
const casesPlugin = pluginData.getPlugin(CasesPlugin);
await casesPlugin.createCaseNote({
caseId: theCase.case_number,
modId: executingMember.id,
body: value,
});
pluginData.getPlugin(LogsPlugin).logCaseUpdate({
mod: executingMember.user,
caseNumber: theCase.case_number,
caseType: CaseTypes[theCase.type],
note: value,
});
}