Fix some more eslint errors (not yet complete)
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index 34ac292..f22f409 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -1,7 +1,6 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
+import Discord, { Channel, CommandInteraction, Message, MessageActionRow, MessageButton, MessageComponentInteraction, Role } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -20,17 +19,17 @@
ChannelType.GuildText, ChannelType.GuildNews
]));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { renderRole, renderChannel, log, NucleusColors, entry, renderUser } = client.logger;
await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
- let m;
+ let m: Message;
if (interaction.options.getRole("role") || interaction.options.getChannel("channel") || interaction.options.getString("message")) {
- let role;
- let ping;
+ let role: Role;
+ let ping: Role;
const message = interaction.options.getString("message");
try {
- role = interaction.options.getRole("role");
- ping = interaction.options.getRole("ping");
+ role = interaction.options.getRole("role") as Role;
+ ping = interaction.options.getRole("ping") as Role;
} catch {
return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("GUILD.ROLES.DELETE")
@@ -39,9 +38,9 @@
.setStatus("Danger")
]});
}
- let channel;
+ let channel: Channel;
try {
- channel = interaction.options.getChannel("channel");
+ channel = interaction.options.getChannel("channel") as Channel;
} catch {
return await interaction.editReply({embeds: [new EmojiEmbed()
.setEmoji("GUILD.ROLES.DELETE")
@@ -160,8 +159,8 @@
.setDisabled(config.welcome.channel == "dm")
.setStyle("SECONDARY")
])
- ]});
- let i;
+ ]}) as Message;
+ let i: MessageComponentInteraction;
try {
i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) {
@@ -196,7 +195,7 @@
await interaction.editReply({embeds: [m.embeds[0].setFooter({text: "Message closed"})], components: []});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as Discord.GuildMember);
if (!member.permissions.has("MANAGE_GUILD")) throw "You must have the *Manage Server* permission to use this command";
return true;
@@ -204,4 +203,4 @@
export { command };
export { callback };
-export { check };
\ No newline at end of file
+export { check };