3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +00:00

Type fixes for djs

This commit is contained in:
Dark 2021-06-30 04:56:56 +02:00
parent 653d6c1dc2
commit 0822fc15e5
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
130 changed files with 8877 additions and 411 deletions

View file

@ -71,7 +71,7 @@ export const CasesModCmd = modActionsCmd({
],
};
return { embed };
return { embeds: [embed] };
},
{
limitToUserId: msg.author.id,

View file

@ -12,13 +12,13 @@ import { modActionsCmd } from "../types";
const opts = {
expand: ct.bool({ option: true, isSwitch: true, shortcut: "e" }),
hidden: ct.bool({ option: true, isSwitch: true, shortcut: "h" }),
reverseFilters: ct.switchOption({ shortcut: "r" }),
notes: ct.switchOption({ shortcut: "n" }),
warns: ct.switchOption({ shortcut: "w" }),
mutes: ct.switchOption({ shortcut: "m" }),
unmutes: ct.switchOption({ shortcut: "um" }),
bans: ct.switchOption({ shortcut: "b" }),
unbans: ct.switchOption({ shortcut: "ub" }),
reverseFilters: ct.switchOption({ def: false, 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" }),
bans: ct.switchOption({ def: false, shortcut: "b" }),
unbans: ct.switchOption({ def: false, shortcut: "ub" }),
};
export const CasesUserCmd = modActionsCmd({
@ -127,7 +127,7 @@ export const CasesUserCmd = modActionsCmd({
],
};
msg.channel.send({ embed });
msg.channel.send({ embeds: [embed] });
}
}
}

View file

@ -21,7 +21,7 @@ export const DeleteCaseCmd = modActionsCmd({
signature: {
caseNumber: ct.number({ rest: true }),
force: ct.switchOption({ shortcut: "f" }),
force: ct.switchOption({ def: false, shortcut: "f" }),
},
async run({ pluginData, message, args }) {
@ -49,8 +49,8 @@ export const DeleteCaseCmd = modActionsCmd({
const cases = pluginData.getPlugin(CasesPlugin);
const embedContent = await cases.getCaseEmbed(theCase);
message.channel.send({
...embedContent,
content: "Delete the following case? Answer 'Yes' to continue, 'No' to cancel.",
embed: embedContent.embed,
});
const reply = await helpers.waitForReply(

View file

@ -1,3 +1,4 @@
import { Snowflake } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
@ -66,7 +67,7 @@ export const ForcebanCmd = modActionsCmd({
try {
// FIXME: Use banUserId()?
await pluginData.guild.bans.create(user.id, {
await pluginData.guild.bans.create(user.id as Snowflake, {
days: 1,
reason: reason != null ? encodeURIComponent(reason) : undefined,
});

View file

@ -1,3 +1,4 @@
import { Snowflake } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
@ -49,7 +50,7 @@ export const UnbanCmd = modActionsCmd({
try {
ignoreEvent(pluginData, IgnoredEventType.Unban, user.id);
await pluginData.guild.bans.remove(user.id, reason != null ? encodeURIComponent(reason) : undefined);
await pluginData.guild.bans.remove(user.id as Snowflake, reason != null ? encodeURIComponent(reason) : undefined);
} catch {
sendErrorMessage(pluginData, msg.channel, "Failed to unban member; are you sure they're banned?");
return;