mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
Added callback fallbacks, create server & channels
This commit is contained in:
17
test/bot.js
17
test/bot.js
@@ -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);
|
||||
})
|
||||
Reference in New Issue
Block a user