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:
parent
26bf9363f9
commit
6689f91a6a
4 changed files with 73 additions and 6 deletions
28
backend/src/plugins/ContextMenus/actions/update.ts
Normal file
28
backend/src/plugins/ContextMenus/actions/update.ts
Normal 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,
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue