COMMAND REGISTRATION WORKS
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> => {