module.exports.run = async (bot, message, args) => {
let ticketreason = args[1];
let ticketname = \"ticket\" + ticketreason;
message.guild.createChannel
You can use
So something like this:
if (message.guild.channels.exists('name', ticketname)) { //checks if there in an item in the channels collection that corresponds with the supplied parameters, returns a boolean
message.reply(`The ${ticketname} channel already exists in this guild.`).catch(console.error);
return; //prevents the rest of the code from being executed
}
// Code that creates the channel {ticketname}...