1let channelName = args.slice(0).join(' '); //Arguments to set the channel name
2message.guild.channels.create(channelName, {
3 type: "text", //This create a text channel, you can make a voice one too, by changing "text" to "voice"
4 permissionOverwrites: [
5 {
6 id: message.guild.roles.everyone, //To make it be seen by a certain role, user an ID instead
7 allow: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], //Allow permissions
8 deny: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'] //Deny permissions
9 }
10 ],
11 })
12
13//Note, you cant have, for example, VIEW_CHANNEL, in both allow and deny.
1// -- Create Channel/Room
2message.guild.channels.create('name', {
3 type: 'GUILD_TEXT',
4 permissionOverwrites: [{
5 id: message.guild.id,
6 allow: ['VIEW_CHANNEL'],
7 deny: ['SEND_MESSAGES'],
8 }]
9});
10console.info(`name channel: name | type: text channel`)