mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Added guild.createRole()
This commit is contained in:
@@ -17,18 +17,7 @@ class GuildRoleCreateHandler extends AbstractHandler {
|
||||
let data = packet.d;
|
||||
let client = this.packetManager.client;
|
||||
|
||||
let guild = client.store.get('guilds', data.guild_id);
|
||||
|
||||
if (guild) {
|
||||
let already = guild.store.get('roles', data.role.id);
|
||||
let role = new Role(guild, data.role);
|
||||
guild.store.add('roles', role);
|
||||
|
||||
if (!already) {
|
||||
client.emit(Constants.Events.GUILD_ROLE_CREATE, guild, role);
|
||||
}
|
||||
}
|
||||
|
||||
let response = client.actions.GuildRoleCreate.handle(data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user