mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Turn on strict TS compilation. Fix up and tweak types accordingly.
This commit is contained in:
parent
690955a399
commit
629002b8d9
172 changed files with 720 additions and 534 deletions
|
@ -65,7 +65,7 @@ export const AddCaseCmd = modActionsCmd({
|
|||
modId: mod.id,
|
||||
type: CaseTypes[type],
|
||||
reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : undefined,
|
||||
});
|
||||
|
||||
if (user) {
|
||||
|
|
|
@ -78,7 +78,7 @@ export const BanCmd = modActionsCmd({
|
|||
contactMethods,
|
||||
caseArgs: {
|
||||
modId: mod.id,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : undefined,
|
||||
},
|
||||
deleteMessageDays,
|
||||
});
|
||||
|
|
|
@ -9,6 +9,7 @@ import { LogsPlugin } from "../../Logs/LogsPlugin";
|
|||
import { LogType } from "../../../data/LogType";
|
||||
import moment from "moment-timezone";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
|
||||
export const DeleteCaseCmd = modActionsCmd({
|
||||
trigger: ["delete_case", "deletecase"],
|
||||
|
@ -25,8 +26,8 @@ export const DeleteCaseCmd = modActionsCmd({
|
|||
},
|
||||
|
||||
async run({ pluginData, message, args }) {
|
||||
const failed = [];
|
||||
const validCases = [];
|
||||
const failed: number[] = [];
|
||||
const validCases: Case[] = [];
|
||||
let cancelled = 0;
|
||||
|
||||
for (const num of args.caseNumber) {
|
||||
|
|
|
@ -77,7 +77,7 @@ export const ForcebanCmd = modActionsCmd({
|
|||
modId: mod.id,
|
||||
type: CaseTypes.Ban,
|
||||
reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : undefined,
|
||||
});
|
||||
|
||||
// Confirm the action
|
||||
|
|
|
@ -14,7 +14,7 @@ export const HideCaseCmd = modActionsCmd({
|
|||
],
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const failed = [];
|
||||
const failed: number[] = [];
|
||||
|
||||
for (const num of args.caseNum) {
|
||||
const theCase = await pluginData.state.cases.findByCaseNumber(num);
|
||||
|
|
|
@ -62,7 +62,7 @@ export const MassbanCmd = modActionsCmd({
|
|||
const loadingMsg = await msg.channel.createMessage("Banning...");
|
||||
|
||||
// Ban each user and count failed bans (if any)
|
||||
const failedBans = [];
|
||||
const failedBans: string[] = [];
|
||||
const casesPlugin = pluginData.getPlugin(CasesPlugin);
|
||||
for (const userId of args.userIds) {
|
||||
try {
|
||||
|
|
|
@ -62,7 +62,7 @@ export const MassmuteCmd = modActionsCmd({
|
|||
|
||||
// Mute everyone and count fails
|
||||
const modId = msg.author.id;
|
||||
const failedMutes = [];
|
||||
const failedMutes: string[] = [];
|
||||
const mutesPlugin = pluginData.getPlugin(MutesPlugin);
|
||||
for (const userId of args.userIds) {
|
||||
try {
|
||||
|
|
|
@ -59,7 +59,7 @@ export const UnbanCmd = modActionsCmd({
|
|||
modId: mod.id,
|
||||
type: CaseTypes.Unban,
|
||||
reason,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : undefined,
|
||||
});
|
||||
|
||||
// Confirm the action
|
||||
|
|
|
@ -14,7 +14,7 @@ export const UnhideCaseCmd = modActionsCmd({
|
|||
],
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
const failed = [];
|
||||
const failed: number[] = [];
|
||||
|
||||
for (const num of args.caseNum) {
|
||||
const theCase = await pluginData.state.cases.findByCaseNumber(num);
|
||||
|
|
|
@ -24,7 +24,7 @@ export const UpdateCmd = modActionsCmd({
|
|||
],
|
||||
|
||||
async run({ pluginData, message: msg, args }) {
|
||||
let theCase: Case;
|
||||
let theCase: Case | undefined;
|
||||
if (args.caseNumber != null) {
|
||||
theCase = await pluginData.state.cases.findByCaseNumber(args.caseNumber);
|
||||
} else {
|
||||
|
|
|
@ -91,7 +91,7 @@ export const WarnCmd = modActionsCmd({
|
|||
contactMethods,
|
||||
caseArgs: {
|
||||
modId: mod.id,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : null,
|
||||
ppId: mod.id !== msg.author.id ? msg.author.id : undefined,
|
||||
reason,
|
||||
},
|
||||
retryPromptChannel: msg.channel as TextChannel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue