From e4cc0d960eae4afb12b5daf9c806fc28b95dd219 Mon Sep 17 00:00:00 2001 From: ItzEmerald Date: Sun, 5 Jan 2020 15:33:23 +0000 Subject: [PATCH] Update ticket.js --- commands/ticket.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/ticket.js b/commands/ticket.js index fa57cdb..9f8b0ec 100644 --- a/commands/ticket.js +++ b/commands/ticket.js @@ -15,6 +15,9 @@ exports.run = (bot, message, args) => { const alreadyopen = new Discord.RichEmbed() .setDescription(`:x: Cannot create a ticket because **${bot.settings.Ticket_Channel_Name}-${message.author.username}** already exists.`) .setColor(bot.settings.colour) + + if (message.guild.channels.exists('name', `${bot.settings.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen); + if (message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen); message.guild.createChannel(`${bot.settings.Ticket_Channel_Name}-${message.author.username}`, { type: 'text',