I made a discord bot, if an user enters in a specific voice channel, an another voice channel is temporary created and the user is moved in. But the channel which the bot created goes to the top of the discord server and it goes into "Temporary Channels". So you can see my problem on the screen, the temporary channel moves all the existing channel and if there are lots of users on the server ... It creates a problem.
https://gyazo.com/05853a3ba35d2850d60207459b0075ea
I tried with createChannel() or clone(), it works but with the same problem.
client.on('voiceStateUpdate', (oldMember, newMember) => {
const defaultCategory = '542554305194885120';
const defaultCreate = '541105891248701450';
if(newMember.voiceChannelID === defaultCreate){
newMember.guild.createChannel(`Salon de ${newMember.user.username}`, 'voice')
.then(tempChannel => {
tempChannel.setParent(defaultCategory);
newMember.setVoiceChannel(tempChannel.id);
})
.catch(console.error);
}
});
I want to create a channel in "temporary channels" category, not by creating first on the top, on discord server then moving into the category
Thank you for your help.