worked on settings/rolemenu and help
diff --git a/src/utils/client.ts b/src/utils/client.ts
index 46d9f92..a199b5b 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -1,4 +1,4 @@
-import Discord, { Client, Interaction, AutocompleteInteraction, GatewayIntentBits } from 'discord.js';
+import Discord, { Client, Interaction, AutocompleteInteraction, GatewayIntentBits, Collection } from 'discord.js';
import { Logger } from "../utils/log.js";
import Memory from "../utils/memory.js";
import type { VerifySchema } from "../reflex/verify.js";
@@ -32,7 +32,7 @@
check: (interaction: Interaction) => Promise<boolean> | boolean,
autocomplete: (interaction: AutocompleteInteraction) => Promise<string[]>
}> = {};
-
+ fetchedCommands: Collection<string, Discord.ApplicationCommand> = new Collection();
constructor(database: typeof NucleusClient.prototype.database) {
super({ intents: [
GatewayIntentBits.Guilds,
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index 4a13807..abc8c39 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -213,6 +213,7 @@
await client.application?.commands.set(commandList);
}
}
+
await registerCommandHandler();
await registerEvents();
console.log(`${colours.green}Registered commands, events and context menus${colours.none}`)
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 7d54674..6dc424e 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -188,8 +188,7 @@
});
} catch (e) {
success = false;
- returnComponents = true;
- continue;
+ break;
}
if (component.customId === "yes") {
component.deferUpdate();
@@ -277,8 +276,6 @@
}
const returnValue: Awaited<ReturnType<typeof this.send>> = {};
- if (returnComponents || success !== undefined) returnValue.components = this.customButtons;
- if (success !== undefined) returnValue.success = success;
if (cancelled) {
await this.timeoutError()
returnValue.cancelled = true;
@@ -294,6 +291,8 @@
});
return {success: false}
}
+ if (returnComponents || success !== undefined) returnValue.components = this.customButtons;
+ if (success !== undefined) returnValue.success = success;
if (newReason) returnValue.newReason = newReason;
const typedReturnValue = returnValue as {cancelled: true} |