Added callback fallbacks, create server & channels

This commit is contained in:
hydrabolt
2015-08-25 12:54:39 +01:00
parent 15f995c07c
commit fb3bdcf079
5 changed files with 341 additions and 164 deletions

View File

@@ -2,7 +2,7 @@ var Discord = require("../lib/index.js");
var Auth = require("./auth.json");
var mybot = new Discord.Client();
mybot.login(Auth.email+"a", Auth.password)
mybot.login(Auth.email, Auth.password)
.then(function (token) {
console.log("wooo!");
@@ -12,6 +12,15 @@ mybot.login(Auth.email+"a", Auth.password)
mybot.on("ready", function () {
console.log("Ready!");
mybot.createServer("myServer", "london").then(function(server){
console.log("New server! Based in "+server.region+" and is called "+server.name);
mybot.createChannel(server, "wooof", "text", function(err, chann){
console.log(chann.name);
});
});
})
mybot.on("message", function (msg) {
@@ -38,4 +47,8 @@ mybot.on("serverRemoveMember", function (user) {
});
mybot.on("userUpdate", function (oldUser, newUser) {
console.log(oldUser, "vs", newUser);
});
});
mybot.on("channelCreate", function(chann){
console.log(chann);
})