From ddd3ea9727ab419f760bb16402f62687c775937d Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Mon, 22 Aug 2016 22:45:02 +0100 Subject: [PATCH] Fixed Guild Role Delete Handling --- src/client/actions/GuildRoleDelete.js | 2 +- src/structures/Message.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/actions/GuildRoleDelete.js b/src/client/actions/GuildRoleDelete.js index e5a8db0fc..078cdcbb7 100644 --- a/src/client/actions/GuildRoleDelete.js +++ b/src/client/actions/GuildRoleDelete.js @@ -16,7 +16,7 @@ class GuildRoleDeleteAction extends Action { if (guild) { let exists = guild.roles.get(data.role_id); if (exists) { - guild.roles.remove(data.role_id); + guild.roles.delete(data.role_id); this.deleted[guild.id + data.role_id] = exists; this.scheduleForDeletion(guild.id, data.role_id); client.emit(Constants.Events.GUILD_ROLE_DELETE, guild, exists); diff --git a/src/structures/Message.js b/src/structures/Message.js index b44585563..092eed8cf 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -88,6 +88,12 @@ class Message { * @type {String} */ this.id = data.id; + /** + * A map of roles mentioned in the message, the key is the role ID. + * @type {Map} + */ + this.roleMentions = new Map(); + for (const mention of data.mentions) { let user = this.client.users.get(mention.id); if (user) {