eslint problems fixed, now theres only 850 ts ones to go
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) => {