I want to make my bot to not create another ticket if there is an open ticket by the user requesting this action.
const ticketCategory = interaction.guild.channels.cache.find((c) => c.id === "1052297483952345159");
let existingChannel = interaction.guild.channels.cache.find(c => c.name = `Ticket-${interaction.user.discriminator}`);
if (existingChannel) {
return interaction.reply({ content: '❌ There is already a Ticket opened by you!', ephemeral: true });
} else {
return interaction.reply('test')
}