fix/alarm name already exists bug
This commit is contained in:
2 files changed
+5
-2
No files matched your search
+4
-1
@@ -225,7 +225,10 @@ module.exports = {
|
|||||||
if (args[0].name == 'create') {
|
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.')] })
|
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.')]});
|
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 = {
|
let alarm = {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayzr-bot",
|
"name": "dayzr-bot",
|
||||||
"version": "13.0.12",
|
"version": "13.0.13",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user