Fix ready event running multiple times

This commit is contained in:
Essem 2022-10-01 12:02:18 -05:00
parent a50c86a0e2
commit f781fb1ae5
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -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.");
};