discord.js v.12 dependencies code example
Example 1: discord.js create channel
guild.channels.create('new-general', { reason: 'Needed a cool new channel' })
.then(console.log)
.catch(console.error);
guild.channels.create('new-voice', {
type: 'voice',
permissionOverwrites: [
{
id: message.author.id,
deny: ['VIEW_CHANNEL'],
},
],
})
Example 2: discord.js package
const Discord = require ('discord.js')
const bot = new Discord.Client()
bot.on("ready", async () => {
console.log("the bot is ready")
})
client.on('message', msg => {
if (msg.content === '!ping')
msg.reply(
"pong!"
)
});
bot.login('TOKEN')