You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
447 B
JavaScript
20 lines
447 B
JavaScript
6 years ago
|
const Action = require('./Action');
|
||
|
|
||
|
class GuildRolesPositionUpdate extends Action {
|
||
|
handle(data) {
|
||
|
const client = this.client;
|
||
|
|
||
|
const guild = client.guilds.get(data.guild_id);
|
||
|
if (guild) {
|
||
|
for (const partialRole of data.roles) {
|
||
|
const role = guild.roles.get(partialRole.id);
|
||
|
if (role) role.position = partialRole.position;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return { guild };
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = GuildRolesPositionUpdate;
|