From 535e59c7eaaa8b34b99382fb921b2e7749f507cf Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Sat, 4 Sep 2021 21:13:52 +0200 Subject: [PATCH] added start method protection --- src/structures/Bot.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/structures/Bot.ts b/src/structures/Bot.ts index dfa914b..06951ea 100644 --- a/src/structures/Bot.ts +++ b/src/structures/Bot.ts @@ -121,6 +121,9 @@ export class Bot extends EventEmitter { */ public async start(port?: number, register?: boolean): Promise { try { + if (applicationState.running) { + throw new Error("This bot is already running"); + } console.log(`\nBot name: ${this.name}`); console.log(`Prefix: ${this.commands.prefix || "/ (only slash commands)"} \n`); if (this.token === "") {