3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-06-08 08:05:03 +00:00

Made cases commands ephemeral by default

This commit is contained in:
Lily Bergonzat 2024-02-17 23:57:01 +01:00
parent b428e18fc7
commit ba65ecb48f
8 changed files with 52 additions and 15 deletions

View file

@ -2,6 +2,10 @@ import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { actualCaseCmd } from "../../functions/actualCommands/actualCaseCmd";
import { modActionsMsgCmd } from "../../types";
const opts = {
show: ct.switchOption({ def: false, shortcut: "sh" }),
};
export const CaseMsgCmd = modActionsMsgCmd({
trigger: "case",
permission: "can_view",
@ -10,10 +14,12 @@ export const CaseMsgCmd = modActionsMsgCmd({
signature: [
{
caseNumber: ct.number(),
...opts,
},
],
async run({ pluginData, message: msg, args }) {
actualCaseCmd(pluginData, msg, msg.author.id, args.caseNumber);
actualCaseCmd(pluginData, msg, msg.author.id, args.caseNumber, args.show);
},
});

View file

@ -1,6 +1,10 @@
import { slashOptions } from "knub";
import { actualCaseCmd } from "../../functions/actualCommands/actualCaseCmd";
const opts = [
slashOptions.boolean({ name: "show", description: "To make the result visible to everyone", required: false }),
];
export const CaseSlashCmd = {
name: "case",
configPermission: "can_view",
@ -9,9 +13,11 @@ export const CaseSlashCmd = {
signature: [
slashOptions.number({ name: "case-number", description: "The number of the case to show", required: true }),
...opts,
],
async run({ interaction, options, pluginData }) {
actualCaseCmd(pluginData, interaction, interaction.user.id, options["case-number"]);
actualCaseCmd(pluginData, interaction, interaction.user.id, options["case-number"], options.show);
},
};

View file

@ -13,6 +13,7 @@ const opts = {
unmutes: ct.switchOption({ def: false, shortcut: "um" }),
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({
@ -42,6 +43,7 @@ export const CasesModMsgCmd = modActionsMsgCmd({
args.reverseFilters,
args.hidden,
args.expand,
args.show,
);
},
});

View file

@ -17,6 +17,7 @@ const opts = [
slashOptions.boolean({ name: "unmutes", description: "To filter unmutes", required: false }),
slashOptions.boolean({ name: "bans", description: "To filter bans", required: false }),
slashOptions.boolean({ name: "unbans", description: "To filter unbans", required: false }),
slashOptions.boolean({ name: "show", description: "To make the result visible to everyone", required: false }),
];
export const CasesSlashCmd = {
@ -43,6 +44,7 @@ export const CasesSlashCmd = {
options["reverse-filters"],
options.hidden,
options.expand,
options.show,
);
},
};

View file

@ -15,6 +15,7 @@ const opts = {
unmutes: ct.switchOption({ def: false, shortcut: "um" }),
bans: ct.switchOption({ def: false, shortcut: "b" }),
unbans: ct.switchOption({ def: false, shortcut: "ub" }),
show: ct.switchOption({ def: false, shortcut: "sh" }),
};
export const CasesUserMsgCmd = modActionsMsgCmd({
@ -55,6 +56,7 @@ export const CasesUserMsgCmd = modActionsMsgCmd({
args.reverseFilters,
args.hidden,
args.expand,
args.show,
);
},
});