mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 05:52:05 +00:00
Fixed Guild Role Delete Handling
This commit is contained in:
parent
c96ecec24c
commit
ddd3ea9727
2 changed files with 7 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ class GuildRoleDeleteAction extends Action {
|
||||||
if (guild) {
|
if (guild) {
|
||||||
let exists = guild.roles.get(data.role_id);
|
let exists = guild.roles.get(data.role_id);
|
||||||
if (exists) {
|
if (exists) {
|
||||||
guild.roles.remove(data.role_id);
|
guild.roles.delete(data.role_id);
|
||||||
this.deleted[guild.id + data.role_id] = exists;
|
this.deleted[guild.id + data.role_id] = exists;
|
||||||
this.scheduleForDeletion(guild.id, data.role_id);
|
this.scheduleForDeletion(guild.id, data.role_id);
|
||||||
client.emit(Constants.Events.GUILD_ROLE_DELETE, guild, exists);
|
client.emit(Constants.Events.GUILD_ROLE_DELETE, guild, exists);
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,12 @@ class Message {
|
||||||
* @type {String}
|
* @type {String}
|
||||||
*/
|
*/
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
|
/**
|
||||||
|
* A map of roles mentioned in the message, the key is the role ID.
|
||||||
|
* @type {Map<String, Role>}
|
||||||
|
*/
|
||||||
|
this.roleMentions = new Map();
|
||||||
|
|
||||||
for (const mention of data.mentions) {
|
for (const mention of data.mentions) {
|
||||||
let user = this.client.users.get(mention.id);
|
let user = this.client.users.get(mention.id);
|
||||||
if (user) {
|
if (user) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue