From ede1562f3352accce2eef858a94c3c2666b1f826 Mon Sep 17 00:00:00 2001 From: Ean Milligan Date: Sat, 3 May 2025 23:22:59 -0400 Subject: [PATCH] doesnt on empty list --- src/events/guildCreate.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/events/guildCreate.ts b/src/events/guildCreate.ts index d9f281e..9ba046c 100644 --- a/src/events/guildCreate.ts +++ b/src/events/guildCreate.ts @@ -10,16 +10,18 @@ import utils from 'utils/utils.ts'; let guildsJoined: EmbedField[] = []; const sendGuildJoinedBatch = () => { - sendMessage(config.logChannel, { - embeds: [ - { - title: 'Guild Joined!', - color: infoColor1, - fields: guildsJoined, - }, - ], - }).catch((e: Error) => utils.commonLoggers.messageSendError('guildCreate.ts:21', 'Join Guild', e)); - guildsJoined = []; + if (guildsJoined.length) { + sendMessage(config.logChannel, { + embeds: [ + { + title: 'Guild Joined!', + color: infoColor1, + fields: guildsJoined, + }, + ], + }).catch((e: Error) => utils.commonLoggers.messageSendError('guildCreate.ts:21', 'Join Guild', e)); + guildsJoined = []; + } }; setInterval(() => {