Skip to content

Commit

Permalink
feat: sends correct message error on adding birthday
Browse files Browse the repository at this point in the history
  • Loading branch information
willy-r committed Apr 27, 2024
1 parent 3b4ff25 commit 145efd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/birthday/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ module.exports = {
await interaction.reply('Your birthday has been added successfully! 🎉');
}
catch (err) {
await interaction.reply('Failed to add your birthday 😥');
let message = 'Failed to add your birthday';
if (err.message.includes('already exists')) {
message = 'That birthday already exists in this server for this user';
}
await interaction.reply(`${message} 😥`);
}
},
};

0 comments on commit 145efd9

Please sign in to comment.