From f781fb1ae5ba1e929663fd5f09229ac346b8ca73 Mon Sep 17 00:00:00 2001 From: Essem Date: Sat, 1 Oct 2022 12:02:18 -0500 Subject: [PATCH] Fix ready event running multiple times --- events/ready.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/events/ready.js b/events/ready.js index 2de2c8f..d408ec9 100644 --- a/events/ready.js +++ b/events/ready.js @@ -6,8 +6,12 @@ import { logger } from "../utils/logger.js"; import { readFileSync } from "fs"; const { types } = JSON.parse(readFileSync(new URL("../config/commands.json", import.meta.url))); +let ready = false; export default async (client) => { + if (ready) return; + + // send slash command data if (types.application) { try { await send(client); @@ -29,6 +33,8 @@ export default async (client) => { checkBroadcast(client); activityChanger(client); + + ready = true; logger.log("info", "Started esmBot."); }; \ No newline at end of file