-
Notifications
You must be signed in to change notification settings - Fork 231
Expand file tree
/
Copy pathCasesModMsgCmd.ts
More file actions
55 lines (51 loc) · 1.67 KB
/
CasesModMsgCmd.ts
File metadata and controls
55 lines (51 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { commandTypeHelpers as ct } from "../../../../commandTypes.js";
import { resolveMessageMember } from "../../../../pluginUtils.js";
import { modActionsMsgCmd } from "../../types.js";
import { actualCasesCmd } from "./actualCasesCmd.js";
const opts = {
mod: ct.userId({ option: true }),
expand: ct.bool({ option: true, isSwitch: true, shortcut: "e" }),
hidden: ct.bool({ option: true, isSwitch: true, shortcut: "h" }),
reverseFilters: ct.switchOption({ def: false, shortcut: "rf" }),
reason: ct.string({ option: true, shortcut: "r" }),
notes: ct.switchOption({ def: false, shortcut: "n" }),
warns: ct.switchOption({ def: false, shortcut: "w" }),
mutes: ct.switchOption({ def: false, shortcut: "m" }),
unmutes: ct.switchOption({ def: false, shortcut: "um" }),
kicks: ct.switchOption({ def: false, shortcut: "k" }),
bans: ct.switchOption({ def: false, shortcut: "b" }),
unbans: ct.switchOption({ def: false, shortcut: "ub" }),
show: ct.switchOption({ def: false, shortcut: "sh" }),
};
export const CasesModMsgCmd = modActionsMsgCmd({
trigger: ["cases", "modlogs", "infractions"],
permission: "can_view",
description: "Show the most recent 5 cases by the specified -mod",
signature: [
{
...opts,
},
],
async run({ pluginData, message: msg, args }) {
const member = await resolveMessageMember(msg);
return actualCasesCmd(
pluginData,
msg,
args.mod,
null,
member,
args.notes,
args.warns,
args.mutes,
args.unmutes,
args.kicks,
args.bans,
args.unbans,
args.reverseFilters,
args.reason ?? null,
args.hidden,
args.expand,
args.show,
);
},
});