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";
diff --git a/src/commands/nucleus/guide.ts b/src/commands/nucleus/guide.ts
index 507730b..3141f9f 100644
--- a/src/commands/nucleus/guide.ts
+++ b/src/commands/nucleus/guide.ts
@@ -1,8 +1,4 @@
-import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
-import getEmojiByName from "../../utils/getEmojiByName.js";
-import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import guide from "../../reflex/guide.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -15,7 +11,7 @@
guide(interaction.guild, interaction);
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
return true;
};
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 5a1ea59..ebc3c34 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
@@ -9,7 +8,7 @@
.setName("invite")
.setDescription("Invites Nucleus to your server");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
interaction.reply({embeds: [new EmojiEmbed()
.setTitle("Invite")
.setDescription("You can invite Nucleus to your server by clicking the button below")
@@ -22,7 +21,7 @@
])], ephemeral: true});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
return true;
};
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index c153e19..91e8363 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -2,7 +2,6 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
-import { WrappedCheck } from "jshaiku";
import client from "../../utils/client.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -10,7 +9,7 @@
.setName("ping")
.setDescription("Gets the bot's ping time");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
// WEBSOCKET | Nucleus -> Discord
// EDITING | Nucleus -> discord -> nucleus | edit time / 2
const initial = new Date().getTime();
@@ -28,7 +27,7 @@
]});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
return true;
};
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index c8c0f76..9ad2c16 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -1,6 +1,5 @@
-import { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -8,7 +7,7 @@
.setName("premium")
.setDescription("Information about Nucleus Premium");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
interaction.reply({embeds: [new EmojiEmbed()
.setTitle("Premium")
.setDescription(
@@ -22,7 +21,7 @@
], ephemeral: true});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
return true;
};
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index 98b87be..2558997 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -1,6 +1,5 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
@@ -9,7 +8,7 @@
.setName("stats")
.setDescription("Gets the bot's stats");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
interaction.reply({
embeds: [new EmojiEmbed()
.setTitle("Stats")
@@ -24,7 +23,7 @@
});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = () => {
return true;
};
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index 238e7d5..a6657d8 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -11,7 +11,7 @@
.setDescription("Sends a suggestion to the developers")
.addStringOption(option => option.setName("suggestion").setDescription("The suggestion to send").setRequired(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
const { renderUser } = client.logger;
const suggestion = interaction.options.getString("suggestion");
const confirmation = await new confirmationMessage(interaction)
@@ -49,7 +49,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
return true;
};
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index ca56fcd..8fb6b40 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -2,7 +2,6 @@
import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
import { SelectMenuOption, SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
-import { testLink, testMalware, testNSFW } from "../reflex/scanners.js";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
import getEmojiByName from "../utils/getEmojiByName.js";
import createPageIndicator from "../utils/createPageIndicator.js";
@@ -26,7 +25,7 @@
setComponents(components: MessageActionRow[]) { this.components = components; return this; }
}
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
const pages = [
new Embed()
.setEmbed(new EmojiEmbed()
@@ -73,8 +72,7 @@
new MessageButton().setLabel("Clear all data").setCustomId("clear-all-data").setStyle("DANGER")
])])
] : []);
- let m;
- m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+ const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
let page = 0;
let selectPaneOpen = false;
@@ -166,7 +164,7 @@
});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
return true;
};
diff --git a/src/commands/role/user.ts b/src/commands/role/user.ts
index d2b05e9..b54ee1e 100644
--- a/src/commands/role/user.ts
+++ b/src/commands/role/user.ts
@@ -18,7 +18,7 @@
]));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
const { renderUser, renderRole } = client.logger;
const action = interaction.options.getString("action");
// TODO:[Modals] Replace this with a modal
@@ -65,7 +65,7 @@
}
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
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/rolemenu.ts b/src/commands/rolemenu.ts
index 1a5f297..dd3cb34 100644
--- a/src/commands/rolemenu.ts
+++ b/src/commands/rolemenu.ts
@@ -7,11 +7,11 @@
.setName("rolemenu")
.setDescription("Lets you choose from sets of roles to apply to yourself");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
await roleMenu(interaction);
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
return true;
};
diff --git a/src/commands/server/about.ts b/src/commands/server/about.ts
index b70d0a6..c0a2ede 100644
--- a/src/commands/server/about.ts
+++ b/src/commands/server/about.ts
@@ -1,4 +1,4 @@
-import Discord, { CommandInteraction, Guild, MessageActionRow, MessageButton } from "discord.js";
+import { CommandInteraction, Guild } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -10,7 +10,7 @@
.setName("about")
.setDescription("Shows info about the server");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
const guild = interaction.guild as Guild;
const { renderUser, renderDelta } = client.logger;
interaction.reply({embeds: [new EmojiEmbed()
@@ -41,7 +41,7 @@
], ephemeral: true});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
return true;
};
diff --git a/src/commands/settings/commands.ts b/src/commands/settings/commands.ts
index 7b6b309..845e001 100644
--- a/src/commands/settings/commands.ts
+++ b/src/commands/settings/commands.ts
@@ -15,7 +15,7 @@
.setDescription("Links and text shown to a user after a moderator action is performed")
.addRoleOption(o => o.setName("role").setDescription("The role given when a member is muted"));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
let m;
let clicked = "";
@@ -117,7 +117,7 @@
});
let out;
try {
- out = await modalInteractionCollector(m, (m) => m.channel.id === interaction.channel.id, (m) => true);
+ out = await modalInteractionCollector(m, (m) => m.channel.id === interaction.channel.id, (_) => true);
} catch (e) { continue; }
if (out.fields) {
const buttonText = out.fields.getTextInputValue("name");
@@ -133,7 +133,7 @@
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
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;
diff --git a/src/commands/settings/filters.ts b/src/commands/settings/filters.ts
index d35d210..7ee5b8d 100644
--- a/src/commands/settings/filters.ts
+++ b/src/commands/settings/filters.ts
@@ -1,24 +1,16 @@
-import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageButton, MessageSelectMenu } from "discord.js";
+import Discord, { CommandInteraction } 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";
-import generateKeyValueList from "../../utils/generateKeyValueList.js";
-import { ChannelType } from "discord-api-types";
-import getEmojiByName from "../../utils/getEmojiByName.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("filter")
.setDescription("Setting for message filters");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
-
+const callback = async (_interaction: CommandInteraction): Promise<void> => {
+ console.log("Filters");
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = (interaction.member as Discord.GuildMember);
if (!member.permissions.has("MANAGE_MESSAGES")) throw "You must have the *Manage Messages* permission to use this command";
return true;
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index edd1c61..cb96567 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -16,9 +16,8 @@
ChannelType.GuildNews, ChannelType.GuildText
]).setRequired(false));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
- let m;
- m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+ const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Discord.Message;
if (interaction.options.getChannel("channel")) {
let channel;
try {
@@ -141,7 +140,7 @@
])]});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
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;
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index da0d156..4d4a392 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -16,9 +16,8 @@
ChannelType.GuildNews, ChannelType.GuildText
]));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
- let m;
- m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+ const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Discord.Message;
if (interaction.options.getChannel("channel")) {
let channel;
try {
@@ -136,7 +135,7 @@
])]});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
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;
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index 88386c4..110c70e 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -35,7 +35,7 @@
.setName("events")
.setDescription("Sets what events should be logged");
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
let m;
while (true) {
@@ -96,9 +96,10 @@
.setStatus("Success")
.setEmoji("CHANNEL.TEXT.CREATE")
]});
+ return;
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
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;
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index 4d61496..5a1affd 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -1,5 +1,5 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageSelectMenu } from "discord.js";
+import Discord, { CommandInteraction, Message, MessageActionRow, MessageSelectMenu } from "discord.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
@@ -16,10 +16,9 @@
.addChannelOption(option => option.setName("channel").setDescription("The channel to modify"))
.addStringOption(option => option.setName("name").setDescription("The new channel name | Enter any text or use the extra variables like {memberCount}").setAutocomplete(true));
-const callback = async (interaction: CommandInteraction): Promise<any> => {
+const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
singleNotify("statsChannelDeleted", interaction.guild.id, true);
- let m;
- m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+ const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
let config = await client.database.guilds.read(interaction.guild.id);
if (interaction.options.getString("name")) {
let channel;
@@ -140,10 +139,10 @@
await client.database.guilds.write(interaction.guild.id, null, toRemove.map(k => `stats.${k}`));
}
}
- await interaction.editReply({embeds: [m.embeds[0].setFooter({text: "Message closed"})], components: []});
+ await interaction.editReply({embeds: [(m.embeds[0] as Discord.MessageEmbed).setFooter({text: "Message closed"})], components: []});
};
-const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
const member = (interaction.member as Discord.GuildMember);
if (!member.permissions.has("MANAGE_CHANNELS")) throw "You must have the *Manage Channels* permission to use this command";
return true;
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index 31df394..f9df71c 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -2,7 +2,7 @@
import getEmojiByName from "../../utils/getEmojiByName.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
-import Discord, { CommandInteraction, GuildChannel, Interaction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
+import Discord, { CommandInteraction, GuildChannel, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
import { SelectMenuOption, SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { ChannelType } from "discord-api-types";
import client from "../../utils/client.js";
@@ -21,14 +21,13 @@
.addRoleOption(option => option.setName("supportrole").setDescription("This role will have view access to all tickets and will be pinged when a ticket is created").setRequired(false));
const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
- let m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+ let m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
const options = {
enabled: interaction.options.getString("enabled") as string | boolean,
category: interaction.options.getChannel("category"),
maxtickets: interaction.options.getNumber("maxticketsperuser"),
supportping: interaction.options.getRole("supportrole")
};
- console.log(m);
if (options.enabled !== null || options.category || options.maxtickets || options.supportping) {
options.enabled = options.enabled === "yes" ? true : false;
if (options.category) {
@@ -198,10 +197,10 @@
.setStyle("PRIMARY")
.setCustomId("send")
])]
- });
+ }) as Message;
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({ time: 300000 });
+ i = await m.awaitMessageComponent({ time: 300000 });
} catch (e) { break; }
i.deferUpdate();
if ((i.component as MessageActionRowComponent).customId === "clearCategory") {
@@ -261,7 +260,7 @@
]});
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({time: 300000});
+ i = await m.awaitMessageComponent({time: 300000});
} catch(e) { break; }
if ((i.component as MessageActionRowComponent).customId === "template") {
i.deferUpdate();
@@ -350,7 +349,7 @@
await interaction.editReply({ embeds: [embed.setFooter({ text: "Message closed" })], components: [] });
};
-async function manageTypes(interaction: Interaction, data: GuildConfig["tickets"], m: Message) {
+async function manageTypes(interaction: CommandInteraction, data: GuildConfig["tickets"], m: Message) {
while (true) {
if (data.useCustom) {
const customTypes = data.customTypes;
@@ -374,7 +373,10 @@
.setPlaceholder("Select types to remove")
.setMaxValues(customTypes.length)
.setMinValues(1)
- .addOptions(customTypes.map((t) => new SelectMenuOption().setLabel(t).setValue(t)))
+ .addOptions(customTypes.map((t) => ({
+ label: t,
+ value: t
+ })))
])
] : []).concat([
new MessageActionRow().addComponents([
diff --git a/src/commands/settings/verify.ts b/src/commands/settings/verify.ts
index d846511..4efd68c 100644
--- a/src/commands/settings/verify.ts
+++ b/src/commands/settings/verify.ts
@@ -1,9 +1,9 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
+import Discord, { CommandInteraction, Message, MessageActionRow, MessageActionRowComponent, MessageButton, MessageComponentInteraction, MessageEmbed, MessageSelectMenu, Role, SelectMenuInteraction, TextInputComponent } from "discord.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
-import { Embed, SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import client from "../../utils/client.js";
import { modalInteractionCollector } from "../../utils/dualCollector.js";
@@ -14,7 +14,7 @@
.addRoleOption(option => option.setName("role").setDescription("The role to give after verifying").setRequired(false));
const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
- const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true});
+ const m = await interaction.reply({embeds: LoadingEmbed, ephemeral: true, fetchReply: true}) as Message;
if (interaction.options.getRole("role")) {
let role: Role;
try {
@@ -109,7 +109,7 @@
])]});
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({time: 300000});
+ i = await m.awaitMessageComponent({time: 300000});
} catch(e) { break; }
i.deferUpdate();
if ((i.component as MessageActionRowComponent).customId === "clear") {
@@ -157,7 +157,7 @@
]});
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({time: 300000});
+ i = await m.awaitMessageComponent({time: 300000});
} catch(e) { break; }
if ((i.component as MessageActionRowComponent).customId === "template") {
i.deferUpdate();
@@ -239,7 +239,7 @@
break;
}
}
- await interaction.editReply({embeds: [(m.embeds[0] as Embed).setFooter({text: "Message closed"})], components: []});
+ await interaction.editReply({embeds: [(m.embeds[0] as MessageEmbed).setFooter({text: "Message closed"})], components: []});
};
const check = (interaction: CommandInteraction) => {
diff --git a/src/commands/tags/edit.ts b/src/commands/tags/edit.ts
index d7cfd04..b9cdddf 100644
--- a/src/commands/tags/edit.ts
+++ b/src/commands/tags/edit.ts
@@ -13,7 +13,7 @@
.addStringOption(o => o.setName("value").setRequired(false).setDescription("The new value of the tag / Rename"))
.addStringOption(o => o.setName("newname").setRequired(false).setDescription("The new name of the tag / Edit"));
-const callback = async (interaction: CommandInteraction): Promise<void | unknown> => {
+const callback = async (interaction: CommandInteraction): Promise<void> => {
const name = interaction.options.getString("name");
const value = interaction.options.getString("value") || "";
const newname = interaction.options.getString("newname") || "";
diff --git a/src/commands/tags/list.ts b/src/commands/tags/list.ts
index accdd94..1a6c22c 100644
--- a/src/commands/tags/list.ts
+++ b/src/commands/tags/list.ts
@@ -52,7 +52,7 @@
.setStatus("Success")
).setTitle(`Page ${pages.length + 1}`).setPageId(pages.length));
}
- const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+ const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true}) as Message;
let page = 0;
let selectPaneOpen = false;
while (true) {
@@ -88,7 +88,7 @@
});
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({time: 300000 });
+ i = await m.awaitMessageComponent({time: 300000 });
} catch (e) { break; }
i.deferUpdate();
if ((i.component as MessageActionRowComponent).customId === "left") {
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index 4835cd1..ede84b3 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -157,7 +157,7 @@
.setThumbnail(member.user.displayAvatarURL({dynamic: true}))
).setTitle("Key Permissions").setDescription("Key permissions the user has").setPageId(2)
];
- const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true});
+ const m = await interaction.reply({embeds: LoadingEmbed, fetchReply: true, ephemeral: true}) as Message;
let page = 0;
let breakReason = "";
while (true) {
@@ -208,7 +208,7 @@
});
let i: MessageComponentInteraction;
try {
- i = await (m as Message).awaitMessageComponent({time: 300000});
+ i = await m.awaitMessageComponent({time: 300000});
} catch { breakReason = "Message timed out"; break; }
i.deferUpdate();
if ((i.component as MessageActionRowComponent).customId === "left") {
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index 48733fc..4720032 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -123,10 +123,11 @@
currentRoleIndex === data.track.length - 1 || currentRoleIndex <= -1
) || !allowed[currentRoleIndex])
])
- ])});
+ ])
+ }) as Message;
let component;
try {
- component = await (m as Message).awaitMessageComponent({time: 300000});
+ component = await m.awaitMessageComponent({time: 300000});
} catch (e) {
return;
}