generated from nhcarrigan/template
fix: don't send birthday message when no birthdays
This commit is contained in:
parent
5c68f84d29
commit
dbbc281380
@ -41,6 +41,9 @@ export const postBirthdays = async (bot: ExtendedClient) => {
|
|||||||
const isBirthdayToday = hasBirthdaySet.filter(
|
const isBirthdayToday = hasBirthdaySet.filter(
|
||||||
(r) => r.birthday === todayIn2000
|
(r) => r.birthday === todayIn2000
|
||||||
);
|
);
|
||||||
|
if (!isBirthdayToday.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const names = isBirthdayToday.map((r) => `<@${r.userId}>`).join(", ");
|
const names = isBirthdayToday.map((r) => `<@${r.userId}>`).join(", ");
|
||||||
await channel.send(`Happy birthday to these lovely people~!\n${names}`);
|
await channel.send(`Happy birthday to these lovely people~!\n${names}`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user