fix/detect already existing alarm name

This commit is contained in:
SowinskiBraeden committed 2024-04-24 09:02:53 -07:00
1 parent 04b0fac552
commit 8450111b5c
2 files changed
+2 -5

No files matched your search

+1 -4
View File
@@ -225,10 +225,7 @@ 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.')] })
console.log(args[0].options);
console.log(GuildDB.alarms);
let exists = GuildDB.alarms.find(alarm => alarm.name = args[0].options[3].value);
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 = {