only send auto embed if message was valid

This commit is contained in:
ShuriZma 2024-04-03 16:42:44 +02:00
parent ae9a1f93c4
commit 7f653930f0
Signed by: ShuriZma
GPG Key ID: 8D289758EE9B8074
1 changed files with 4 additions and 4 deletions

View File

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