fix/detect already existing alarm name
This commit is contained in:
2 files changed
+2
-5
No files matched your search
+1
-4
@@ -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 = {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayzr-bot",
|
||||
"version": "13.1.0",
|
||||
"version": "13.1.1",
|
||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
Reference in new issue
Block a user