summaryrefslogtreecommitdiff
path: root/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js')
-rw-r--r--node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js b/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js
new file mode 100644
index 0000000..d7abca9
--- /dev/null
+++ b/node_modules/discord.js/src/client/actions/GuildRolesPositionUpdate.js
@@ -0,0 +1,21 @@
+'use strict';
+
+const Action = require('./Action');
+
+class GuildRolesPositionUpdate extends Action {
+ handle(data) {
+ const client = this.client;
+
+ const guild = client.guilds.cache.get(data.guild_id);
+ if (guild) {
+ for (const partialRole of data.roles) {
+ const role = guild.roles.cache.get(partialRole.id);
+ if (role) role.rawPosition = partialRole.position;
+ }
+ }
+
+ return { guild };
+ }
+}
+
+module.exports = GuildRolesPositionUpdate;