Coding

index.js
//import modules
const Discord = require('discord.js');
const config = require('./config.json');
//initialize client
const client = new Discord.Client();
//ready event
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
client.user.setActivity(`${config.prefix}help`, {type: 'PLAYING'})
});
//message event
client.on('message', message => {
//to reduce code
var cmd = message.content.slice(prefix.length);
if (cmd === 'ping') {
message.channel.send(`Pong! \`${Math.floor(client.ping)}ms\``);
} else if (cmd ==='help') {
//create new embed using this constructor
helpEmbed = new Discord.RichEmbed()
helpEmbed
.setDescription('Help has arrived!');
message.channel.send(helpEmbed);
} else if (cmd === 'reboot') {
if (message.author.id !== config.ownerId) return;
message.channel.send('Rebooting...');
setTimeout(() => {
process.exit();
}, 1000);
};
});
//token is hidden in config.json
client.login(config.token);
config.json
{
"prefix": "$",
"ownerId": "123456789012345678",
"token": "iafpiq3n8vi90navrnqwvrv21i.asdasdi3asdsgddag"
}

Use node index.js to start bot