Fix ready event running multiple times
This commit is contained in:
parent
a50c86a0e2
commit
f781fb1ae5
1 changed files with 6 additions and 0 deletions
|
@ -6,8 +6,12 @@ import { logger } from "../utils/logger.js";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
|
|
||||||
const { types } = JSON.parse(readFileSync(new URL("../config/commands.json", import.meta.url)));
|
const { types } = JSON.parse(readFileSync(new URL("../config/commands.json", import.meta.url)));
|
||||||
|
let ready = false;
|
||||||
|
|
||||||
export default async (client) => {
|
export default async (client) => {
|
||||||
|
if (ready) return;
|
||||||
|
|
||||||
|
// send slash command data
|
||||||
if (types.application) {
|
if (types.application) {
|
||||||
try {
|
try {
|
||||||
await send(client);
|
await send(client);
|
||||||
|
@ -30,5 +34,7 @@ export default async (client) => {
|
||||||
checkBroadcast(client);
|
checkBroadcast(client);
|
||||||
activityChanger(client);
|
activityChanger(client);
|
||||||
|
|
||||||
|
ready = true;
|
||||||
|
|
||||||
logger.log("info", "Started esmBot.");
|
logger.log("info", "Started esmBot.");
|
||||||
};
|
};
|
Loading…
Reference in a new issue