added createRole, updateRole and deleteRole

This commit is contained in:
hydrabolt
2015-11-05 17:37:27 +00:00
parent ca6f582853
commit e54da00282
6 changed files with 310 additions and 21 deletions

View File

@@ -13,10 +13,20 @@ a.on("warn", function (m) {
});
a.on("message", function (m) {
if (m.content === "$$$") a.createChannel(m.channel.server, "quackducks").then(function (c) {
a.sendMessage(c, "I'm alive!");
});
if (m.content === "$$$") {
a.createRole(m.channel.server, {
name: "a_role!",
color: 0xFF0000,
hoist: true,
permissions: ["manageRoles"]
}).then(function (role) {
a.deleteRole(role).then(function () {
a.reply(m, "deleted!");
});
})["catch"](function (e) {
console.log(e.stack);
});
}
});
a.on("userTypingStart", function (user, chan) {
console.log(user.username + " typing");