Performance testing
diff --git a/src/commands/nucleus/_meta.ts b/src/commands/nucleus/_meta.ts
index d66b5d2..521b338 100644
--- a/src/commands/nucleus/_meta.ts
+++ b/src/commands/nucleus/_meta.ts
@@ -5,4 +5,6 @@
const subcommand = await command(name, description, `nucleus`)
-export { name, description, subcommand as command };
+const allowedInDMs = true;
+
+export { name, description, subcommand as command, allowedInDMs };
diff --git a/src/commands/nucleus/guide.ts b/src/commands/nucleus/guide.ts
index ffc441a..d3370ba 100644
--- a/src/commands/nucleus/guide.ts
+++ b/src/commands/nucleus/guide.ts
@@ -1,11 +1,12 @@
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { CommandInteraction } from 'discord.js';
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import guide from "../../reflex/guide.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder.setName("guide").setDescription("Shows the welcome guide for the bot");
-const callback = async (interaction) => {
- guide(interaction.guild, interaction);
+const callback = async (interaction: CommandInteraction) => {
+ guide(interaction.guild!, interaction);
};
const check = () => {
diff --git a/src/commands/nucleus/invite.ts b/src/commands/nucleus/invite.ts
index 7c36d62..fd65e51 100644
--- a/src/commands/nucleus/invite.ts
+++ b/src/commands/nucleus/invite.ts
@@ -1,5 +1,5 @@
import { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
@@ -16,12 +16,12 @@
.setStatus("Danger")
],
components: [
- new ActionRowBuilder().addComponents([
+ new ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder()
.setLabel("Invite")
.setStyle(ButtonStyle.Link)
.setURL(
- `https://discord.com/api/oauth2/authorize?client_id=${client.user.id}&permissions=295157886134&scope=bot%20applications.commands`
+ `https://discord.com/api/oauth2/authorize?client_id=${client.user!.id}&permissions=295157886134&scope=bot%20applications.commands`
)
])
],
diff --git a/src/commands/nucleus/ping.ts b/src/commands/nucleus/ping.ts
index 59b6393..3cbd049 100644
--- a/src/commands/nucleus/ping.ts
+++ b/src/commands/nucleus/ping.ts
@@ -1,6 +1,6 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
-import { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { CommandInteraction } from "discord.js";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
@@ -19,8 +19,8 @@
.setTitle("Ping")
.setDescription(
`**Ping:** \`${ping}ms\`\n` +
- `**To Discord:** \`${client.ws.ping}ms\`\n` +
- `**From Expected:** \`±${Math.abs(ping / 2 - 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 a67cd36..d8b2807 100644
--- a/src/commands/nucleus/stats.ts
+++ b/src/commands/nucleus/stats.ts
@@ -1,5 +1,5 @@
-import { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { CommandInteraction } from "discord.js";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index 49c80fb..a75e8a0 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -1,4 +1,5 @@
-import Discord, { CommandInteraction } from "discord.js";
+import type { CommandInteraction } from "discord.js";
+import type Discord from "discord.js";
import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -13,8 +14,9 @@
);
const callback = async (interaction: CommandInteraction): Promise<void> => {
+ await interaction.guild?.members.fetch(interaction.member!.user.id)
const { renderUser } = client.logger;
- const suggestion = interaction.options.getString("suggestion");
+ const suggestion = interaction.options.get("suggestion")?.value as string;
const confirmation = await new confirmationMessage(interaction)
.setEmoji("ICONS.OPP.ADD")
.setTitle("Suggest")
@@ -32,7 +34,7 @@
new EmojiEmbed()
.setTitle("Suggestion")
.setDescription(
- `**From:** ${renderUser(interaction.member.user)}\n**Suggestion:**\n> ${suggestion}`
+ `**From:** ${renderUser(interaction.member!.user as Discord.User)}\n**Suggestion:**\n> ${suggestion}`
)
.setStatus("Danger")
.setEmoji("NUCLEUS.LOGO")