Removed all instances of client.interaction with import client from utils
diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index bdd73c4..00aeffe 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -5,6 +5,7 @@
import getEmojiByName from "../../utils/getEmojiByName.js";
import generateKeyValueList from "../../utils/generateKeyValueList.js";
import createPageIndicator from "../../utils/createPageIndicator.js";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -26,8 +27,7 @@
const callback = async (interaction: CommandInteraction) => {
- // @ts-ignore
- const { renderUser, renderDelta } = interaction.client.logger
+ const { renderUser, renderDelta } = client.logger
let member = (interaction.options.getMember("user") || interaction.member) as Discord.GuildMember;
let flags: string[] = [];
if ([
@@ -36,7 +36,7 @@
"261900651230003201", // Coded
"511655498676699136", // Zan
].includes(member.user.id)) { flags.push("NUCLEUSDEVELOPER") }
- if ((await interaction.client.guilds.cache.get("684492926528651336")?.members.fetch())?.filter(m => m.roles.cache.has("760896837866749972"))?.map(m => m.id).includes(member.user.id)) { flags.push("CLICKSDEVELOPER") }
+ if ((await client.guilds.cache.get("684492926528651336")?.members.fetch())?.filter(m => m.roles.cache.has("760896837866749972"))?.map(m => m.id).includes(member.user.id)) { flags.push("CLICKSDEVELOPER") }
member.user.flags.toArray().map(flag => {
flags.push(flag.toString())
})
diff --git a/src/commands/user/avatar.ts b/src/commands/user/avatar.ts
index eb9042a..9a84118 100644
--- a/src/commands/user/avatar.ts
+++ b/src/commands/user/avatar.ts
@@ -4,6 +4,7 @@
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import generateKeyValueList from "../../utils/generateKeyValueList.js";
+import client from "../../client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -12,8 +13,7 @@
.addUserOption(option => option.setName("user").setDescription("The user to get the avatar of | Default: Yourself"))
const callback = async (interaction: CommandInteraction) => {
- // @ts-ignore
- const { renderUser } = interaction.client.logger
+ const { renderUser } = client.logger
let member = (interaction.options.getMember("user") || interaction.member) as Discord.GuildMember;
await interaction.reply({embeds: [new generateEmojiEmbed()
.setTitle("User Info")
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index f96f718..ae3f7ec 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -22,8 +22,7 @@
}
const callback = async (interaction: CommandInteraction) => {
- // @ts-ignore
- const { renderUser } = interaction.client.logger;
+ const { renderUser } = client.logger;
const member = interaction.options.getMember("user") as GuildMember;
const guild = interaction.guild;
let config = await client.database.read(guild.id);
@@ -46,7 +45,7 @@
label: option.name,
value: index.toString(),
description: option.track.length == 0 ? "No" : addPlural(option.track.length, "role"),
- emoji: interaction.client.emojis.resolve(getEmojiByName("TRACKS.SINGLE." + (hasRoleInTrack ? "ACTIVE" : "INACTIVE"), "id"))
+ emoji: client.emojis.resolve(getEmojiByName("TRACKS.SINGLE." + (hasRoleInTrack ? "ACTIVE" : "INACTIVE"), "id"))
})
})).setCustomId("select").setMaxValues(1)
let allowed = []
@@ -166,7 +165,7 @@
if (member.id == interaction.guild.ownerId) return true
// Check if the user can manage any of the tracks
// @ts-ignore
- let tracks = (await interaction.client.database.get(interaction.guild.id)).tracks
+ let tracks = (await client.database.get(interaction.guild.id)).tracks
let managed = false
tracks.forEach(element => { if (element.track.manageableBy.some(role => member.roles.cache.has(role))) managed = true });
// Check if the user has manage_roles permission