mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
added createRole, updateRole and deleteRole
This commit is contained in:
18
lib/index.js
18
lib/index.js
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user