I'm trying to make discord ticket bot, every thing is okay but I want to the ticket text channel create in the selected category, but with this code the channel will create in none category.
These the part of create channel codes:
function crearTicket(message, user){
var canal = message.guild.channels.cache.find(c => c.name == `ticket-${user.id}`);
if (!canal) {
message.guild.channels.create(`ticket-${user.id}`,{type: "ticket"}).then(channel => { EnviarMensaje(channel, user);
var rol = message.guild.roles.cache.find(r => r.name === "@everyone");
channel.createOverwrite(user, {
SEND_MESSAGES: true,
VIEW_CHANNEL: true,
READ_MESSAGE_HISTORY: true,
});
channel.createOverwrite(rol, {
SEND_MESSAGES: false,
VIEW_CHANNEL: false,
});
});
}
}
And this is the link for all of the code:
https://raw.githubusercontent.com/hadiazt/hadiazt.github.io/main/js/bot.js
Thanks for reading my questions
sorry for my bad English
["category","text","voice"]
- felony123