fix/alarm name already exists bug

This commit is contained in:
SowinskiBraeden committed 2024-04-24 08:30:40 -07:00
1 parent efde626f1a
commit 5d5767dc3f
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -225,7 +225,10 @@ module.exports = {
if (args[0].name == 'create') {
if (args[0].options[3].value.includes('-') || args[0].options[3].value.includes(' ')) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Red).setDescription('**Invalid Name:** Alarm Names cannot include hyphens or spaces.')] })
let exists = undefined == GuildDB.alarms.find(alarm => alarm.name = args[0].options[3].value) ? true : false;
console.log(args[0].options);
console.log(GuildDB.alarms);
let exists = GuildDB.alarms.find(alarm => alarm.name = args[0].options[3].value);
if (exists) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription('**Invalid Name**\nAn alarm already exists with this name.')]});
let alarm = {