docs: (backport) Bring the main doc pages up to date, and add more examples (#2094)

This commit is contained in:
Isabella
2018-04-26 01:13:44 -05:00
parent feb0991c46
commit d7e7803178
11 changed files with 390 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
/*
Send a user a link to their avatar
*/
/**
* Send a user a link to their avatar
*/
// Import the discord.js module
const Discord = require('discord.js');
@@ -8,11 +8,10 @@ const Discord = require('discord.js');
// Create an instance of a Discord client
const client = new Discord.Client();
// The token of your bot - https://discordapp.com/developers/applications/me
const token = 'your bot token here';
// The ready event is vital, it means that your bot will only start reacting to information
// from Discord _after_ ready is emitted
/**
* The ready event is vital, it means that only _after_ this will your bot start reacting to information
* received from Discord
*/
client.on('ready', () => {
console.log('I am ready!');
});
@@ -26,5 +25,5 @@ client.on('message', message => {
}
});
// Log our bot in
client.login(token);
// Log our bot in using the token from https://discordapp.com/developers/applications/me
client.login('your token here');