1
votes

How can I make the channel that is created called for example "TheRedyYT's Channel"?

addChannel.guild.channels.create(member.user.username, {
            type: 'voice',
            parent: addCategory.id,
            permissionOverwrites: [{
                id: member.id,
                allow: ['MANAGE_CHANNELS', 'MANAGE_ROLES']
            }]
    
1

1 Answers

0
votes

If you want the channel named to the executor of the command you can try:

addChannel.guild.channels.create(`${member.user.username}'s Channel`, {
        type: 'voice',
        parent: addCategory.id,
        permissionOverwrites: [{
            id: member.id,
            allow: ['MANAGE_CHANNELS', 'MANAGE_ROLES']
        }]

I have to assume that addChannel, member and addCategory are already defined. In the code example above I made a string as the name of the created channel. In this string I used the username of the member as you did, but with the result that you want. For example if I would execute the command the channel would be named Freem | Jannik's Channel.