mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Migrate ModActions to new Plugin structure !!mutes dont work!!
This commit is contained in:
parent
ebcb28261b
commit
fd56664984
29 changed files with 1213 additions and 16 deletions
29
backend/src/plugins/ModActions/commands/CaseCmd.ts
Normal file
29
backend/src/plugins/ModActions/commands/CaseCmd.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { modActionsCommand } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "src/plugins/Cases/CasesPlugin";
|
||||
|
||||
export const CaseCmd = modActionsCommand({
|
||||
trigger: "case",
|
||||
permission: "can_view",
|
||||
description: "Show information about a specific case",
|
||||
|
||||
signature: [
|
||||
{
|
||||
caseNumber: ct.number(),
|
||||
},
|
||||
],
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const theCase = await pluginData.state.cases.findByCaseNumber(args.caseNumber);
|
||||
|
||||
if (!theCase) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Case not found");
|
||||
return;
|
||||
}
|
||||
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
const embed = await casesPlugin.getCaseEmbed(theCase.id);
|
||||
msg.channel.createMessage(embed);
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue