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

@@ -7,12 +7,22 @@ a.on("debug", (m) => console.log("[debug]",m));
a.on("warn", (m) => console.log("[warn]", m));
a.on("message", m => {
if(m.content === "$$$")
a.createChannel(m.channel.server, "quackducks").then( 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( role => {
a.deleteRole(role).then(() => {
a.reply(m, "deleted!");
})
}).catch( e => {
console.log(e.stack)
});
}
});
a.on("userTypingStart", (user, chan) => {
console.log(user.username + " typing");