3
0
Fork 0
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:
Dragory 2020-11-09 20:03:57 +02:00
parent 690955a399
commit 629002b8d9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
172 changed files with 720 additions and 534 deletions

View file

@ -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) {

View file

@ -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,
});

View file

@ -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) {

View file

@ -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

View file

@ -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);

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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);

View file

@ -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 {

View file

@ -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,