added start method protection

This commit is contained in:
mmacierzanka committed 2021-09-04 21:13:52 +02:00
1 parent d898ddc81d
commit 535e59c7ea
1 file changed
+3
+3
View File
@@ -121,6 +121,9 @@ export class Bot extends EventEmitter {
*/
public async start(port?: number, register?: boolean): Promise<boolean> {
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 === "") {