From 8ff7fa2766bc686f7a47e6c7b33d490aa165a0d7 Mon Sep 17 00:00:00 2001 From: Gabriel Tavares Date: Wed, 12 Jun 2024 23:33:14 -0400 Subject: [PATCH] fix: month without birthdays --- src/commands/guild/birthdays.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/commands/guild/birthdays.ts b/src/commands/guild/birthdays.ts index 8bc9466..e0b30bf 100644 --- a/src/commands/guild/birthdays.ts +++ b/src/commands/guild/birthdays.ts @@ -45,6 +45,15 @@ export class BirthdayCommand extends Command { }, }); + if (!birthdays || birthdays.length <= 0) { + await interaction.reply({ + content: "Não há aniversários neste mês!", + ephemeral: false, + fetchReply: false, + }); + return; + } + const monthStatus = month ? `Mês ${pad(month)}` : ""; const birthdayList = birthdays.map( (event) =>