added avatar bot working on cat

This commit is contained in:
hydrabolt
2015-08-30 17:31:18 +01:00
parent b32d526937
commit 5968958ba4
3 changed files with 86 additions and 6 deletions

View File

@@ -11,23 +11,26 @@ var AuthDetails = require("./auth.json");
var bot = new Discord.Client();
bot.on("ready", function(){
bot.on("ready", function () {
console.log("Ready to begin! Serving in " + bot.channels.length + " channels");
});
bot.on("disconnected", function(){
bot.on("disconnected", function () {
console.log("Disconnected!");
process.exit(1); //exit node.js with an error
});
bot.on("message", function(msg){
if(msg.content.substring(0,4) === "ping"){
bot.on("message", function (msg) {
if (msg.content.substring(0, 4) === "ping") {
//send a message to the channel the ping message was sent in.
bot.sendMessage( msg.channel, "pong!" );
bot.sendMessage(msg.channel, "pong!");
//alert the console
console.log("pong-ed " + msg.sender.username);
}
});