From 024822d1f3c7a6e6fbf9378deb3cd4aaf45a7166 Mon Sep 17 00:00:00 2001 From: Slincnik Date: Sun, 8 Dec 2024 18:09:44 +0300 Subject: [PATCH] fix: doesnt commands registered, when client doesnt ready --- handlers/command-handler/functions/registerCommands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/command-handler/functions/registerCommands.js b/handlers/command-handler/functions/registerCommands.js index 18b32119..e0e50d2e 100644 --- a/handlers/command-handler/functions/registerCommands.js +++ b/handlers/command-handler/functions/registerCommands.js @@ -2,7 +2,7 @@ import differentCommands from "../utils/differentcommands.js"; export default async function registerCommands(props) { const globalCommands = props.commands.filter(cmd => !cmd.options?.devOnly); - await registerGlobalCommands(props.client, globalCommands); + props.client.once("ready", () => registerGlobalCommands(props.client, globalCommands)); } const registerGlobalCommands = async (client, commands) => {