COMMAND REGISTRATION WORKS
diff --git a/src/commands/help.ts b/src/commands/help.ts
index df44aaa..4295f9c 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -1,14 +1,13 @@
import { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
const command = new SlashCommandBuilder().setName("help").setDescription("Shows help for commands");
const callback = async (interaction: CommandInteraction): Promise<void> => {
- interaction.reply("hel p"); // TODO: FINISH THIS FOR RELEASE
+ interaction.reply("hel p D:"); // TODO: FINISH THIS FOR RELEASE
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/mod/_meta.ts b/src/commands/mod/_meta.ts
index 7bdd813..987a1c1 100644
--- a/src/commands/mod/_meta.ts
+++ b/src/commands/mod/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "mod";
const description = "Perform moderator actions";
-export { name, description };
+const subcommand = await command(name, description, `mod`)
+
+export { name, description, subcommand as command };
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 9b24b0c..5f4f41c 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -6,11 +6,13 @@
import addPlurals from "../../utils/plurals.js";
import client from "../../utils/client.js";
+
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("ban")
.setDescription("Bans a user from the server")
.addUserOption((option) => option.setName("user").setDescription("The user to ban").setRequired(true))
+ .addStringOption((option) => option.setName("reason").setDescription("The reason for the ban").setRequired(false))
.addNumberOption((option) =>
option
.setName("delete")
@@ -20,6 +22,7 @@
.setRequired(false)
);
+
const callback = async (interaction: CommandInteraction): Promise<void> => {
const { renderUser } = client.logger;
// TODO:[Modals] Replace this with a modal
@@ -34,12 +37,12 @@
.setTitle("Ban")
.setDescription(
keyValueList({
- user: renderUser(interaction.options.getUser("user")),
+ user: renderUser(interaction.options.getUser("user")!),
reason: reason ? "\n> " + (reason).replaceAll("\n", "\n> ") : "*No reason provided*"
}) +
`The user **will${notify ? "" : " not"}** be notified\n` +
`${addPlurals(
- interaction.options.getNumber("delete") ?? 0,
+ (interaction.options.get("delete")?.value as number | null) ?? 0,
"day"
)} of messages will be deleted\n\n` +
`Are you sure you want to ban <@!${(interaction.options.getMember("user") as GuildMember).id}>?`
@@ -80,18 +83,14 @@
)
.setStatus("Danger")
],
- components: [
- new ActionRowBuilder().addComponents(
- config.moderation.ban.text
- ? [
- new ButtonBuilder()
- .setStyle(ButtonStyle.Link)
- .setLabel(config.moderation.ban.text)
- .setURL(config.moderation.ban.link)
- ]
- : []
- )
- ]
+ components: config.moderation.ban.text ? [
+ new ActionRowBuilder().addComponents([
+ new ButtonBuilder()
+ .setStyle(ButtonStyle.Link)
+ .setLabel(config.moderation.ban.text)
+ .setURL(config.moderation.ban.link!)
+ ])
+ ] : []
});
dmd = true;
}
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index 9a101e8..b5e5554 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -1,18 +1,19 @@
import { CommandInteraction, GuildMember } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import keyValueList from "../../utils/generateKeyValueList.js";
import client from "../../utils/client.js";
-const command = (builder: SlashCommandSubcommandBuilder) =>
- builder
- .setName("nick")
- .setDescription("Changes a users nickname")
- .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 command = (builder: SlashCommandSubcommandBuilder) => builder
+ .setName("nick")
+ .setDescription("Changes a users nickname")
+ .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<unknown> => {
const { renderUser } = client.logger;
diff --git a/src/commands/mod/slowmode.ts b/src/commands/mod/slowmode.ts
index 654fbcc..3e883b3 100644
--- a/src/commands/mod/slowmode.ts
+++ b/src/commands/mod/slowmode.ts
@@ -15,22 +15,22 @@
.setName("time")
.setDescription("The delay between messages")
.setRequired(false)
- .addChoices([
- ["Off", "0"],
- ["5 seconds", "5"],
- ["10 seconds", "10"],
- ["15 seconds", "15"],
- ["30 seconds", "30"],
- ["1 minute", "60"],
- ["2 minutes", "120"],
- ["5 minutes", "300"],
- ["10 minutes", "600"],
- ["15 minutes", "900"],
- ["30 minutes", "1800"],
- ["1 hour", "3600"],
- ["2 hours", "7200"],
- ["6 hours", "21600"]
- ])
+ .addChoices(
+ {name: "Off", value: "0"},
+ {name: "5 seconds", value: "5"},
+ {name: "10 seconds", value: "10"},
+ {name: "15 seconds", value: "15"},
+ {name: "30 seconds", value: "30"},
+ {name: "1 minute", value: "60"},
+ {name: "2 minutes", value: "120"},
+ {name: "5 minutes", value: "300"},
+ {name: "10 minutes", value: "600"},
+ {name: "15 minutes", value: "900"},
+ {name: "30 minutes", value: "1800"},
+ {name: "1 hour", value: "3600"},
+ {name: "2 hours", value: "7200"},
+ {name: "6 hours", value: "21600"}
+ )
);
const callback = async (interaction: CommandInteraction): Promise<void> => {
diff --git a/src/commands/mod/viewas.ts b/src/commands/mod/viewas.ts
index ca68a70..a713f55 100644
--- a/src/commands/mod/viewas.ts
+++ b/src/commands/mod/viewas.ts
@@ -7,7 +7,7 @@
SelectMenuBuilder,
ButtonStyle
} from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import pageIndicator from "../../utils/createPageIndicator.js";
diff --git a/src/commands/nucleus/_meta.ts b/src/commands/nucleus/_meta.ts
index a79a596..751feca 100644
--- a/src/commands/nucleus/_meta.ts
+++ b/src/commands/nucleus/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "nucleus";
const description = "Commands relating to Nucleus itself";
-export { name, description };
+const subcommand = await command(name, description, `settings/logs`)
+
+export { name, description, subcommand as command };
diff --git a/src/commands/nucleus/suggest.ts b/src/commands/nucleus/suggest.ts
index bdd55af..49c80fb 100644
--- a/src/commands/nucleus/suggest.ts
+++ b/src/commands/nucleus/suggest.ts
@@ -1,6 +1,5 @@
import Discord, { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
@@ -63,7 +62,7 @@
}
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index 8fce0b8..a427688 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -1,7 +1,6 @@
import { LoadingEmbed } from "./../utils/defaultEmbeds.js";
import Discord, { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
-import { SelectMenuOption, SlashCommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
+import { SlashCommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
import getEmojiByName from "../utils/getEmojiByName.js";
import createPageIndicator from "../utils/createPageIndicator.js";
@@ -232,7 +231,7 @@
});
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/role/_meta.ts b/src/commands/role/_meta.ts
index c5936c9..f546d51 100644
--- a/src/commands/role/_meta.ts
+++ b/src/commands/role/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "role";
const description = "Change roles for users";
-export { name, description };
+const subcommand = await command(name, description, `role`);
+
+export { name, description, subcommand as command };
diff --git a/src/commands/role/user.ts b/src/commands/role/user.ts
index bdadd9d..ac94b47 100644
--- a/src/commands/role/user.ts
+++ b/src/commands/role/user.ts
@@ -1,6 +1,5 @@
import { CommandInteraction, GuildMember, Role } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import client from "../../utils/client.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import keyValueList from "../../utils/generateKeyValueList.js";
@@ -21,10 +20,10 @@
.setName("action")
.setDescription("The action to perform")
.setRequired(true)
- .addChoices([
- ["Add", "give"],
- ["Remove", "remove"]
- ])
+ .addChoices(
+ {name: "Add", value: "give"},
+ {name: "Remove", value: "remove"}
+ )
);
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
@@ -91,7 +90,7 @@
}
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as GuildMember;
const me = interaction.guild.me!;
const apply = interaction.options.getMember("user") as GuildMember | null;
diff --git a/src/commands/rolemenu.ts b/src/commands/rolemenu.ts
index dd3cb34..9aad543 100644
--- a/src/commands/rolemenu.ts
+++ b/src/commands/rolemenu.ts
@@ -1,6 +1,5 @@
-import { CommandInteraction } from "discord.js";
+import type { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import { callback as roleMenu } from "../actions/roleMenu.js";
const command = new SlashCommandBuilder()
@@ -11,7 +10,7 @@
await roleMenu(interaction);
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/server/_meta.ts b/src/commands/server/_meta.ts
index 5c0ba48..250951b 100644
--- a/src/commands/server/_meta.ts
+++ b/src/commands/server/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "server";
const description = "Commands for the server";
-export { name, description };
+const subcommand = await command(name, description, `server`);
+
+export { name, description, subcommand as command };
diff --git a/src/commands/server/about.ts b/src/commands/server/about.ts
index 116071e..b895768 100644
--- a/src/commands/server/about.ts
+++ b/src/commands/server/about.ts
@@ -1,6 +1,5 @@
-import { CommandInteraction } from "discord.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
+import type { CommandInteraction } from "discord.js";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import generateKeyValueList, { toCapitals } from "../../utils/generateKeyValueList.js";
@@ -55,7 +54,7 @@
});
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/settings/_meta.ts b/src/commands/settings/_meta.ts
index 1241322..76e570d 100644
--- a/src/commands/settings/_meta.ts
+++ b/src/commands/settings/_meta.ts
@@ -1,4 +1,9 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "settings";
const description = "Change bot settings";
-export { name, description };
+
+const subcommand = await command(name, description, "settings")
+
+export { name, description, subcommand as command};
diff --git a/src/commands/settings/commands.ts b/src/commands/settings/commands.ts
index 5260858..4493f79 100644
--- a/src/commands/settings/commands.ts
+++ b/src/commands/settings/commands.ts
@@ -3,7 +3,6 @@
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import client from "../../utils/client.js";
import { modalInteractionCollector } from "../../utils/dualCollector.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
@@ -208,7 +207,7 @@
}
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw new Error("You must have the *Manage Server* permission to use this command");
diff --git a/src/commands/settings/logs/_meta.ts b/src/commands/settings/logs/_meta.ts
index fadff33..24a1e54 100644
--- a/src/commands/settings/logs/_meta.ts
+++ b/src/commands/settings/logs/_meta.ts
@@ -1,4 +1,8 @@
+import { group } from "../../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "logs";
const description = "Settings for logging";
-export { name, description };
+const subcommand = await group(name, description, `settings/logs`)
+
+export { name, description, subcommand as command};
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index 38f66fb..7d4fef3 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -4,8 +4,7 @@
import EmojiEmbed from "../../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../../utils/confirmationMessage.js";
import getEmojiByName from "../../../utils/getEmojiByName.js";
-import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import client from "../../../utils/client.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -16,7 +15,7 @@
option
.setName("channel")
.setDescription("The channel to log attachments in")
- .addChannelTypes([ChannelType.GuildNews, ChannelType.GuildText])
+ .addChannelTypes(ChannelType.GuildText)
.setRequired(false)
);
@@ -189,7 +188,7 @@
});
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw new Error("You must have the *Manage Server* permission to use this command");
diff --git a/src/commands/settings/logs/channel.ts b/src/commands/settings/logs/channel.ts
index a06198d..0288bf7 100644
--- a/src/commands/settings/logs/channel.ts
+++ b/src/commands/settings/logs/channel.ts
@@ -5,7 +5,6 @@
import confirmationMessage from "../../../utils/confirmationMessage.js";
import getEmojiByName from "../../../utils/getEmojiByName.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import client from "../../../utils/client.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -16,7 +15,7 @@
option
.setName("channel")
.setDescription("The channel to set the log channel to")
- .addChannelTypes([ChannelType.GuildNews, ChannelType.GuildText])
+ .addChannelTypes(ChannelType.GuildText)
);
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
@@ -181,7 +180,7 @@
});
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw new Error("You must have the *Manage Server* permission to use this command");
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index 793d1fa..9eaf25c 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -1,7 +1,6 @@
import { LoadingEmbed } from "./../../../utils/defaultEmbeds.js";
import Discord, { CommandInteraction, Message, ActionRowBuilder, ButtonBuilder, SelectMenuBuilder, ButtonStyle } 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 { toHexArray, toHexInteger } from "../../../utils/calculate.js";
@@ -104,7 +103,7 @@
return;
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw new Error("You must have the *Manage Server* permission to use this command");
diff --git a/src/commands/settings/logs/staff.ts b/src/commands/settings/logs/staff.ts
index 44b8d69..c1b2380 100644
--- a/src/commands/settings/logs/staff.ts
+++ b/src/commands/settings/logs/staff.ts
@@ -5,8 +5,6 @@
import confirmationMessage from "../../../utils/confirmationMessage.js";
import getEmojiByName from "../../../utils/getEmojiByName.js";
import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-// @ts-expect-error
-import type { WrappedCheck } from "jshaiku";
import client from "../../../utils/client.js";
const command = (builder: SlashCommandSubcommandBuilder) =>
@@ -17,7 +15,7 @@
option
.setName("channel")
.setDescription("The channel to set the staff notifications channel to")
- .addChannelTypes([ChannelType.GuildNews, ChannelType.GuildText])
+ .addChannelTypes(ChannelType.GuildText)
.setRequired(false)
);
@@ -187,7 +185,7 @@
});
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_GUILD"))
throw new Error("You must have the *Manage Server* permission to use this command");
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index b9464b5..02ab93e 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -1,6 +1,5 @@
import Discord, { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
@@ -13,7 +12,7 @@
await interaction.reply("You're mum");
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_ROLES"))
throw Error("You must have the *Manage Roles* permission to use this command");
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index 1bcd49d..f19998a 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -3,7 +3,6 @@
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import confirmationMessage from "../../utils/confirmationMessage.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import client from "../../utils/client.js";
import convertCurlyBracketString from "../../utils/convertCurlyBracketString.js";
import { callback as statsChannelAddCallback } from "../../reflex/statsChannelUpdate.js";
@@ -218,7 +217,7 @@
});
};
-const check = (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (interaction: CommandInteraction) => {
const member = interaction.member as Discord.GuildMember;
if (!member.permissions.has("MANAGE_CHANNELS"))
throw new Error("You must have the *Manage Channels* permission to use this command");
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index d6dee70..48d419d 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -16,7 +16,7 @@
TextInputComponent,
ButtonStyle
} from "discord.js";
-import { SelectMenuOption, SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import { ChannelType } from "discord-api-types/v9";
import client from "../../utils/client.js";
import { toHexInteger, toHexArray, tickets as ticketTypes } from "../../utils/calculate.js";
@@ -33,16 +33,16 @@
.setName("enabled")
.setDescription("If users should be able to create tickets")
.setRequired(false)
- .addChoices([
- ["Yes", "yes"],
- ["No", "no"]
- ])
+ .addChoices(
+ {name: "Yes", value: "yes"},
+ {name: "No",value: "no"}
+ )
)
.addChannelOption((option) =>
option
.setName("category")
.setDescription("The category where tickets are created")
- .addChannelType(ChannelType.GuildCategory)
+ .addChannelTypes(ChannelType.GuildCategory)
.setRequired(false)
)
.addNumberOption((option) =>
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index 679a63d..5284f8a 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -37,7 +37,7 @@
option
.setName("channel")
.setDescription("The channel the welcome message should be sent to")
- .addChannelTypes([ChannelType.GuildText, ChannelType.GuildNews])
+ .addChannelTypes(ChannelType.GuildText)
);
const callback = async (interaction: CommandInteraction): Promise<unknown> => {
diff --git a/src/commands/tags/_meta.ts b/src/commands/tags/_meta.ts
index 2ce5318..aa4fe55 100644
--- a/src/commands/tags/_meta.ts
+++ b/src/commands/tags/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "tags";
const description = "manage server tags";
-export { name, description };
+const subcommand = await command(name, description, `tags`);
+
+export { name, description, subcommand as command };
diff --git a/src/commands/ticket/_meta.ts b/src/commands/ticket/_meta.ts
index e484928..2e0dbbf 100644
--- a/src/commands/ticket/_meta.ts
+++ b/src/commands/ticket/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "ticket";
const description = "Manage modmail tickets";
-export { name, description };
+const subcommand = await command(name, description, `ticket`);
+
+export { name, description, subcommand as command };
diff --git a/src/commands/user/_meta.ts b/src/commands/user/_meta.ts
index 8677d79..0c8bc6b 100644
--- a/src/commands/user/_meta.ts
+++ b/src/commands/user/_meta.ts
@@ -1,4 +1,8 @@
+import { command } from "../../utils/commandRegistration/slashCommandBuilder.js";
+
const name = "user";
const description = "Commands for user info";
-export { name, description };
+const subcommand = await command(name, description, `user`);
+
+export { name, description, subcommand as command };
diff --git a/src/commands/user/avatar.ts b/src/commands/user/avatar.ts
index a6c319d..00be0c9 100644
--- a/src/commands/user/avatar.ts
+++ b/src/commands/user/avatar.ts
@@ -1,6 +1,5 @@
import Discord, { CommandInteraction } from "discord.js";
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
-import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import generateKeyValueList from "../../utils/generateKeyValueList.js";
import client from "../../utils/client.js";
@@ -35,7 +34,7 @@
});
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index a8a837b..dd736aa 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -1,8 +1,6 @@
import { LoadingEmbed } from "./../../utils/defaultEmbeds.js";
import Discord, { CommandInteraction, GuildMember, Message, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
-import { SelectMenuOption, SlashCommandSubcommandBuilder } from "@discordjs/builders";
-// @ts-expect-error
-import { WrappedCheck } from "jshaiku";
+import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import getEmojiByName from "../../utils/getEmojiByName.js";
import addPlural from "../../utils/plurals.js";
@@ -205,7 +203,7 @@
}
};
-const check = async (interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = async (interaction: CommandInteraction) => {
const tracks = (await client.database.guilds.read(interaction.guild.id)).tracks;
if (tracks.length === 0) throw new Error("This server does not have any tracks");
const member = interaction.member as GuildMember;
diff --git a/src/commands/verify.ts b/src/commands/verify.ts
index f2c9c9d..b9556a6 100644
--- a/src/commands/verify.ts
+++ b/src/commands/verify.ts
@@ -1,7 +1,5 @@
import type { CommandInteraction } from "discord.js";
import { SlashCommandBuilder } from "@discordjs/builders";
-// @ts-expect-error
-import { WrappedCheck } from "jshaiku";
import verify from "../reflex/verify.js";
const command = new SlashCommandBuilder().setName("verify").setDescription("Get verified in the server");
@@ -10,7 +8,7 @@
verify(interaction);
};
-const check = (_interaction: CommandInteraction, _defaultCheck: WrappedCheck) => {
+const check = (_interaction: CommandInteraction) => {
return true;
};