Update Examples (closes #380) (#383)

* Update examples

* Forgot to save send-files
This commit is contained in:
Manuel Kraus
2016-05-29 03:55:39 +02:00
committed by abalabahaha
parent b9506d01ab
commit 8d64435def
9 changed files with 114 additions and 176 deletions

View File

@@ -9,23 +9,23 @@ var AuthDetails = require("./auth.json");
var bot = new Discord.Client();
bot.on("ready", () => {
console.log("Ready to begin! Serving in " + bot.channels.length + " channels");
console.log(`Ready to begin! Serving in ${bot.channels.length} channels`);
});
bot.on("disconnected", () => {
console.log("Disconnected!");
process.exit(1); //exit node.js with an error
});
bot.on("message", (msg) => {
if( msg.content === "avatar" ){
// if the message was avatar
bot.reply( msg, msg.sender.avatarURL );
// if the message is avatar
if (msg.content === "avatar") {
bot.reply(msg, "Here is the URL for your avatar: " + msg.author.avatarURL);
}
});
bot.login(AuthDetails.email, AuthDetails.password);
bot.loginWithToken(AuthDetails.token);