Removed all instances of client.interaction with import client from utils
diff --git a/src/automations/roleMenu.ts b/src/automations/roleMenu.ts
index cac15a5..10342ff 100644
--- a/src/automations/roleMenu.ts
+++ b/src/automations/roleMenu.ts
@@ -34,7 +34,7 @@
itt += 1
code = ""
for (let i = 0; i < length; i++) { code += chars.charAt(Math.floor(Math.random() * chars.length)); }
- if (code in interaction.client.roleMenu) continue;
+ if (code in client.roleMenu) continue;
if (itt > 1000) {
itt = 0
length += 1
@@ -42,7 +42,7 @@
}
break;
}
- interaction.client.roleMenu[code] = {
+ client.roleMenu[code] = {
guild: interaction.guild.id,
guildIcon: interaction.guild.iconURL({format: "png"}),
user: interaction.member.user.id,
diff --git a/src/automations/tickets/create.ts b/src/automations/tickets/create.ts
index 9642089..ffc89d9 100644
--- a/src/automations/tickets/create.ts
+++ b/src/automations/tickets/create.ts
@@ -10,8 +10,7 @@
}
export default async function (interaction) {
- // @ts-ignore
- const { log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = interaction.client.logger
+ const { log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = client.logger
let config = await client.database.read(interaction.guild.id);
if (!config.tickets.enabled || !config.tickets.category) {
@@ -196,7 +195,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
} catch (e) { console.log(e)}
await interaction.editReply({embeds: [new generateEmojiEmbed()
.setTitle("Create Ticket")
diff --git a/src/automations/tickets/delete.ts b/src/automations/tickets/delete.ts
index 1d577a4..a974b2e 100644
--- a/src/automations/tickets/delete.ts
+++ b/src/automations/tickets/delete.ts
@@ -5,7 +5,7 @@
export default async function (interaction) {
// @ts-ignore
- const { log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = interaction.client.logger
+ const { log, NucleusColors, entry, renderUser, renderChannel, renderDelta } = client.logger
let config = await client.database.read(interaction.guild.id);
let thread = false; let threadChannel
@@ -45,7 +45,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
interaction.channel.delete();
return;
} else if (status == "Active") {
@@ -95,7 +95,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
await interaction.editReply({embeds: [new generateEmojiEmbed()
.setTitle("Close Ticket")
.setDescription("This ticket has been closed.\nType `/ticket close` again to delete it.")
diff --git a/src/automations/verify.ts b/src/automations/verify.ts
index bf26505..f84ba20 100644
--- a/src/automations/verify.ts
+++ b/src/automations/verify.ts
@@ -10,8 +10,7 @@
}
export default async function(interaction) {
- // @ts-ignore
- let verify = interaction.client.verify
+ let verify = client.verify
await interaction.reply({embeds: [new generateEmojiEmbed()
.setTitle("Loading")
.setDescription(step(-1))
diff --git a/src/commands/categorisationTest.ts b/src/commands/categorisationTest.ts
index 33f99e9..4a28841 100644
--- a/src/commands/categorisationTest.ts
+++ b/src/commands/categorisationTest.ts
@@ -10,8 +10,7 @@
.setDescription("Categorises your servers channels")
const callback = async (interaction: CommandInteraction) => {
- // @ts-ignore
- const { renderChannel } = interaction.client.logger
+ const { renderChannel } = client.logger
let channels = interaction.guild.channels.cache.filter(c => c.type !== "GUILD_CATEGORY");
let categorised = {}
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 854f38f..1ae8dff 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -22,8 +22,7 @@
.addChoices([["Yes", "yes"], ["No", "no"]]))
const callback = async (interaction: CommandInteraction): Promise<any> => {
- // @ts-ignore
- const { log, NucleusColors, renderUser, entry } = interaction.client.logger
+ const { log, NucleusColors, renderUser, entry } = client.logger
const user = interaction.options.getMember("user") as GuildMember
const reason = interaction.options.getString("reason")
const time = {
@@ -200,7 +199,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
} else {
await interaction.editReply({embeds: [new generateEmojiEmbed()
.setEmoji("PUNISH.MUTE.GREEN")
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index 96738c6..c09e197 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -57,7 +57,7 @@
let nickname = interaction.options.getString("name")
member.setNickname(nickname ?? null, "Nucleus Nickname command")
// @ts-ignore
- const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = interaction.client.logger
+ const { log, NucleusColors, entry, renderUser, renderDelta, getAuditLog } = client.logger
let data = {
meta: {
type: 'memberUpdate',
@@ -78,7 +78,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
} catch {
await interaction.editReply({embeds: [new generateEmojiEmbed()
.setEmoji("PUNISH.NICKNAME.RED")
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 46e2871..092fdaa 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -17,8 +17,7 @@
)
const callback = async (interaction: CommandInteraction): Promise<any> => {
- // @ts-ignore
- const { log, NucleusColors, renderUser, entry } = interaction.client.logger
+ const { log, NucleusColors, renderUser, entry } = client.logger
// TODO:[Modals] Replace this with a modal
let confirmation = await new confirmationMessage(interaction)
.setEmoji("PUNISH.WARN.RED")
@@ -77,7 +76,7 @@
guild: interaction.guild.id
}
}
- log(data, interaction.client);
+ log(data, client);
let failed = (dmd == false && interaction.options.getString("notify") != "no")
if (!failed) {
await interaction.editReply({embeds: [new generateEmojiEmbed()
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 44934e1..8b25820 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -2,6 +2,7 @@
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -17,7 +18,7 @@
], components: [new MessageActionRow().addComponents([new MessageButton()
.setLabel("Invite")
.setStyle("LINK")
- .setURL(`https://discord.com/api/oauth2/authorize?client_id=${interaction.client.user.id}&permissions=295157886134&scope=bot%20applications.commands`)
+ .setURL(`https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=295157886134&scope=bot%20applications.commands`)
])], ephemeral: true});
}
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index ab23bf7..58413c6 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -2,6 +2,7 @@
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import { WrappedCheck } from "jshaiku";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -23,8 +24,8 @@
.setTitle("Ping")
.setDescription(
`**Ping:** \`${ping}ms\`\n` +
- `**To Discord:** \`${interaction.client.ws.ping}ms\`\n` +
- `**From Expected:** \`±${Math.abs((ping / 2) - interaction.client.ws.ping)}ms\``
+ `**To Discord:** \`${client.ws.ping}ms\`\n` +
+ `**From Expected:** \`±${Math.abs((ping / 2) - client.ws.ping)}ms\``
)
.setEmoji("CHANNEL.SLOWMODE.OFF")
.setStatus("Danger")
diff --git a/src/commands/nucleus/stats.ts b/src/commands/nucleus/stats.ts
index c12b950..1a0602e 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -2,6 +2,7 @@
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -13,8 +14,8 @@
embeds: [new generateEmojiEmbed()
.setTitle("Stats")
.setDescription(
- `**Servers:** ${interaction.client.guilds.cache.size}\n` +
- `**Ping:** \`${interaction.client.ws.ping*2}ms\``
+ `**Servers:** ${client.guilds.cache.size}\n` +
+ `**Ping:** \`${client.ws.ping*2}ms\``
)
.setStatus("Success")
.setEmoji("GUILD.GRAPHS")
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index d1d6a03..c07d9b8 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -3,6 +3,7 @@
import { WrappedCheck } from "jshaiku";
import confirmationMessage from "../../utils/confirmationMessage.js";
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -12,7 +13,7 @@
const callback = async (interaction: CommandInteraction) => {
// @ts-ignore
- const { renderUser } = interaction.client.logger
+ const { renderUser } = client.logger
let suggestion = interaction.options.getString("suggestion");
let confirmation = await new confirmationMessage(interaction)
.setEmoji("ICONS.OPP.ADD")
@@ -23,7 +24,7 @@
.setInverted(true)
.send()
if (confirmation.success) {
- await (interaction.client.channels.cache.get('955161206459600976') as Discord.TextChannel).send({
+ await (client.channels.cache.get('955161206459600976') as Discord.TextChannel).send({
embeds: [
new generateEmojiEmbed()
.setTitle(`Suggestion`)
diff --git a/src/commands/server/about.ts b/src/commands/server/about.ts
index 054cad3..895d2cc 100644
--- a/src/commands/server/about.ts
+++ b/src/commands/server/about.ts
@@ -4,6 +4,7 @@
import generateEmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import generateKeyValueList, { toCapitals } from "../../utils/generateKeyValueList.js";
+import client from "../../utils/client.js"
const command = (builder: SlashCommandSubcommandBuilder) => builder
.setName("about")
@@ -11,8 +12,7 @@
const callback = async (interaction: CommandInteraction) => {
let guild = interaction.guild as Guild;
- // @ts-ignore
- const { renderUser, renderDelta } = interaction.client.logger
+ const { renderUser, renderDelta } = client.logger
interaction.reply({embeds: [new generateEmojiEmbed()
.setTitle("Server Info")
.setStatus("Success")
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index aac271e..e6bfecf 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -286,7 +286,7 @@
options.push(new SelectMenuOption({
label: capitalize(type),
value: type,
- emoji: interaction.client.emojis.cache.get(getEmojiByName(`TICKETS.${type.toUpperCase()}`, "id")),
+ emoji: client.emojis.cache.get(getEmojiByName(`TICKETS.${type.toUpperCase()}`, "id")),
default: inUse.includes(type)
}))
})
diff --git a/src/commands/tag.ts b/src/commands/tag.ts
index 8d6d8c9..7ef80dd 100644
--- a/src/commands/tag.ts
+++ b/src/commands/tag.ts
@@ -2,13 +2,14 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import { callback as statsChannelAdd } from '../automations/statsChannelAdd.js';
+import client from "../utils/client.js"
const command = new SlashCommandBuilder()
.setName("tag")
.setDescription("Get and manage the servers tags")
const callback = (interaction: CommandInteraction) => {
- try { statsChannelAdd(interaction.client, interaction.member); } catch {} // TODO: REMOVE THIS FOR PRODUCTION
+ try { statsChannelAdd(client, interaction.member); } catch {} // TODO: REMOVE THIS FOR PRODUCTION
interaction.reply("This command is not yet finished [tag]");
}
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