fix: don't send birthday message when no birthdays

This commit is contained in:
Naomi Carrigan 2024-07-10 02:55:46 -07:00
parent 5c68f84d29
commit dbbc281380
Signed by: naomi
SSH Key Fingerprint: SHA256:rca1iUI2OhAM6n4FIUaFcZcicmri0jgocqKiTTAfrt8

View File

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