eslint problems fixed, now theres only 850 ts ones to go
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 57db408..a55dcfa 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -14,7 +13,7 @@
.addUserOption(option => option.setName("user").setDescription("The user to ban").setRequired(true))
.addNumberOption(option => option.setName("delete").setDescription("The days of messages to delete | Default: 0").setMinValue(0).setMaxValue(7).setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
const { renderUser } = client.logger;
// TODO:[Modals] Replace this with a modal
let reason = null;
@@ -121,7 +120,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index 482af5b..68b3ce7 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -1,7 +1,6 @@
import { HistorySchema } from "../../utils/database";
import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton, TextInputComponent } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import client from "../../utils/client.js";
@@ -199,7 +198,7 @@
}
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
let m;
const member = (interaction.options.getMember("user")) as Discord.GuildMember;
await interaction.reply({embeds: [new EmojiEmbed()
@@ -273,7 +272,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
if (! member.permissions.has("MODERATE_MEMBERS")) throw "You do not have the *Moderate Members* permission";
return true;
diff --git a/src/commands/mod/kick.ts b/src/commands/mod/kick.ts
index b9b1b2a..23785c3 100644
--- a/src/commands/mod/kick.ts
+++ b/src/commands/mod/kick.ts
@@ -1,7 +1,6 @@
import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
import humanizeDuration from "humanize-duration";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -13,7 +12,7 @@
.setDescription("Kicks a user from the server")
.addUserOption(option => option.setName("user").setDescription("The user to kick").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { renderUser } = client.logger;
// TODO:[Modals] Replace this with a modal
let reason = null;
@@ -120,7 +119,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 183c487..1e9a812 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -1,7 +1,6 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
+import Discord, { CommandInteraction, GuildMember, Message, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -20,7 +19,7 @@
.addIntegerOption(option => option.setName("minutes").setDescription("The number of minutes to mute the user for | Default: 0").setMinValue(0).setMaxValue(59).setRequired(false))
.addIntegerOption(option => option.setName("seconds").setDescription("The number of seconds to mute the user for | Default: 0").setMinValue(0).setMaxValue(59).setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { log, NucleusColors, renderUser, entry, renderDelta } = client.logger;
const user = interaction.options.getMember("user") as GuildMember;
const time = {
@@ -85,10 +84,10 @@
.setStyle("DANGER")
.setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
])
- ], ephemeral: true, fetchReply: true});
+ ], ephemeral: true, fetchReply: true}) as Message;
let component;
try {
- component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+ component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
} catch { return; }
component.deferUpdate();
if (component.customId === "cancel") return interaction.editReply({embeds: [new EmojiEmbed()
@@ -244,7 +243,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index 9cc8a7c..06fab47 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -1,10 +1,8 @@
-import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction, GuildMember } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
-import { create, areTicketsEnabled } from "../../actions/createModActionTicket.js";
import client from "../../utils/client.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -14,7 +12,7 @@
.addUserOption(option => option.setName("user").setDescription("The user to change").setRequired(true))
.addStringOption(option => option.setName("name").setDescription("The name to set | Leave blank to clear").setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { renderUser } = client.logger;
// TODO:[Modals] Replace this with a modal
let notify = true;
@@ -113,7 +111,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 13e688b..c554ee7 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -1,6 +1,5 @@
import Discord, { CommandInteraction, GuildChannel, GuildMember, TextChannel } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -20,7 +19,7 @@
.addUserOption(option => option.setName("user").setDescription("The user to purge messages from").setRequired(false))
.addStringOption(option => option.setName("reason").setDescription("The reason for the purge").setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const user = interaction.options.getMember("user") as GuildMember ?? null;
const channel = (interaction.channel as GuildChannel);
if (!(["GUILD_TEXT", "GUILD_NEWS", "GUILD_NEWS_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_PRIVATE_THREAD"].includes(channel.type.toString()))) {
@@ -97,10 +96,10 @@
.setEmoji(getEmojiByName("CONTROL.TICK", "id"))
])
]
- });
+ }) as Discord.Message;
let component;
try {
- component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+ component = m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
} catch (e) { break; }
component.deferUpdate();
if (component.customId === "done") break;
@@ -174,10 +173,10 @@
.setLabel("Download transcript")
.setStyle("SUCCESS")
.setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id"))
- ])]});
+ ])]}) as Discord.Message;
let component;
try {
- component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+ component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
} catch { return; }
if (component && component.customId === "download") {
interaction.editReply({embeds: [new EmojiEmbed()
@@ -273,10 +272,10 @@
.setLabel("Download transcript")
.setStyle("SUCCESS")
.setEmoji(getEmojiByName("CONTROL.DOWNLOAD", "id"))
- ])]});
+ ])]}) as Discord.Message;
let component;
try {
- component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+ component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
} catch { return; }
if (component && component.customId === "download") {
interaction.editReply({embeds: [new EmojiEmbed()
@@ -304,7 +303,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
// Check if nucleus has the manage_messages permission
diff --git a/src/commands/mod/slowmode.ts b/src/commands/mod/slowmode.ts
index 951dc53..7e8b8a2 100644
--- a/src/commands/mod/slowmode.ts
+++ b/src/commands/mod/slowmode.ts
@@ -1,7 +1,6 @@
import humanizeDuration from "humanize-duration";
import { CommandInteraction, GuildMember, TextChannel } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import keyValueList from "../../utils/generateKeyValueList.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -19,7 +18,7 @@
["1 hour", "3600"], ["2 hours", "7200"], ["6 hours", "21600"]
]));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
let time = parseInt(interaction.options.getString("time") ?? "0");
if (time === 0 && (interaction.channel as TextChannel).rateLimitPerUser === 0) { time = 10; }
const confirmation = await new confirmationMessage(interaction)
@@ -59,7 +58,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
// Check if Nucleus can set the slowmode
if (! interaction.guild.me.permissions.has("MANAGE_CHANNELS")) throw "I do not have the *Manage Channels* permission";
diff --git a/src/commands/mod/softban.ts b/src/commands/mod/softban.ts
index 88ba531..d0dc9bb 100644
--- a/src/commands/mod/softban.ts
+++ b/src/commands/mod/softban.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -14,7 +13,7 @@
.addUserOption(option => option.setName("user").setDescription("The user to softban").setRequired(true))
.addIntegerOption(option => option.setName("delete").setDescription("The days of messages to delete | Default: 0").setMinValue(0).setMaxValue(7).setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { renderUser } = client.logger;
// TODO:[Modals] Replace this with a modal
let reason = null;
@@ -98,7 +97,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/unban.ts b/src/commands/mod/unban.ts
index faf1f08..88301eb 100644
--- a/src/commands/mod/unban.ts
+++ b/src/commands/mod/unban.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, GuildMember, User } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -12,7 +11,7 @@
.setDescription("Unbans a user")
.addStringOption(option => option.setName("user").setDescription("The user to unban (Username or ID)").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const bans = await interaction.guild.bans.fetch();
const user = interaction.options.getString("user");
let resolved = bans.find(ban => ban.user.id === user);
@@ -88,7 +87,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
// Check if Nucleus can unban members
diff --git a/src/commands/mod/unmute.ts b/src/commands/mod/unmute.ts
index e00c16d..d4e0d75 100644
--- a/src/commands/mod/unmute.ts
+++ b/src/commands/mod/unmute.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, GuildMember } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -12,7 +11,7 @@
.setDescription("Unmutes a user")
.addUserOption(option => option.setName("user").setDescription("The user to unmute").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { log, NucleusColors, renderUser, entry, renderDelta } = client.logger;
// TODO:[Modals] Replace this with a modal
let reason = null;
@@ -106,7 +105,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
diff --git a/src/commands/mod/viewas.ts b/src/commands/mod/viewas.ts
index a5bf5ea..ca52787 100644
--- a/src/commands/mod/viewas.ts
+++ b/src/commands/mod/viewas.ts
@@ -1,7 +1,6 @@
import Discord, { CategoryChannel, CommandInteraction, GuildMember, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import { WrappedCheck } from "jshaiku";
import getEmojiByName from "../../utils/getEmojiByName.js";
import pageIndicator from "../../utils/createPageIndicator.js";
@@ -11,7 +10,7 @@
.setDescription("View the server as a specific member")
.addUserOption(option => option.setName("member").setDescription("The member to view as").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
let channels = [];
let m;
interaction.guild.channels.cache.forEach(channel => {
@@ -96,7 +95,7 @@
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
if (! member.permissions.has("MANAGE_ROLES")) throw "You do not have the *Manage Roles* permission";
return true;
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 0648f66..34ad3c3 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -1,6 +1,5 @@
import Discord, { CommandInteraction, GuildMember, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -13,7 +12,7 @@
.setDescription("Warns a user")
.addUserOption(option => option.setName("user").setDescription("The user to warn").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { log, NucleusColors, renderUser, entry } = client.logger;
// TODO:[Modals] Replace this with a modal
let reason = null;
@@ -131,10 +130,10 @@
.setStyle(canSeeChannel ? "SECONDARY" : "PRIMARY")
])
]
- });
+ }) as Discord.Message;
let component;
try {
- component = await (m as Discord.Message).awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
+ component = await m.awaitMessageComponent({filter: (m) => m.user.id === interaction.user.id, time: 300000});
} catch (e) {
return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("PUNISH.WARN.GREEN")
@@ -196,13 +195,12 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as GuildMember);
const me = (interaction.guild.me as GuildMember);
const apply = (interaction.options.getMember("user") as GuildMember);
if (member === null || me === null || apply === null) throw "That member is not in the server";
const memberPos = member.roles ? member.roles.highest.position : 0;
- const mePos = me.roles ? me.roles.highest.position : 0;
const applyPos = apply.roles ? apply.roles.highest.position : 0;
// Do not allow warning bots
if (member.user.bot) throw "I cannot warn bots";