From 7f653930f0ba2563c21209e8db35a009ec92b47e Mon Sep 17 00:00:00 2001 From: ShuriZma Date: Wed, 3 Apr 2024 16:42:44 +0200 Subject: [PATCH] only send auto embed if message was valid --- src/bot.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index 9793a4e..9d15507 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -71,7 +71,7 @@ export class Bot { } }); - client.on(Events.MessageCreate, async (msg) => { + client.on(Events.MessageCreate, (msg) => { if ( this.channel && msg.channel.id === this.channel @@ -100,10 +100,10 @@ export class Bot { ] ); console.log('added word to library, set lastUser and increased counter') - } - if (this.counter === this.autoEmbedMessages) { - this.sendEmbed(msg); + if (this.counter === this.autoEmbedMessages) { + this.sendEmbed(msg); + } } });