From dbbc2813804280979353f17168a7550a4a0c7991 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Wed, 10 Jul 2024 02:55:46 -0700 Subject: [PATCH] fix: don't send birthday message when no birthdays --- src/modules/postBirthdays.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/postBirthdays.ts b/src/modules/postBirthdays.ts index 583d9f6..8e5e650 100644 --- a/src/modules/postBirthdays.ts +++ b/src/modules/postBirthdays.ts @@ -41,6 +41,9 @@ export const postBirthdays = async (bot: ExtendedClient) => { const isBirthdayToday = hasBirthdaySet.filter( (r) => r.birthday === todayIn2000 ); + if (!isBirthdayToday.length) { + return; + } const names = isBirthdayToday.map((r) => `<@${r.userId}>`).join(", "); await channel.send(`Happy birthday to these lovely people~!\n${names}`); }