mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 21:35:02 +00:00
28 lines
890 B
TypeScript
28 lines
890 B
TypeScript
import { GuildMember } from "discord.js";
|
|
import { GuildPluginData } from "knub";
|
|
import { CaseTypes } from "../../../data/CaseTypes.js";
|
|
import { Case } from "../../../data/entities/Case.js";
|
|
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
|
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
|
import { ContextMenuPluginType } from "../types.js";
|
|
|
|
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,
|
|
});
|
|
|
|
void pluginData.getPlugin(LogsPlugin).logCaseUpdate({
|
|
mod: executingMember.user,
|
|
caseNumber: theCase.case_number,
|
|
caseType: CaseTypes[theCase.type],
|
|
note: value,
|
|
});
|
|
}
|