use of io.discloader.discloader.common.event.guild.role.GuildRoleUpdateEvent in project DiscLoader by R3alCl0ud.
the class RoleUpdate method handle.
@Override
public void handle(SocketPacket packet) {
String d = this.gson.toJson(packet.d);
Packet data = this.gson.fromJson(d, Packet.class);
IGuild guild = EntityRegistry.getGuildByID(data.guild_id);
IRole oldRole = guild.getRoleByID(data.role.id);
IRole role = guild.addRole(data.role);
GuildRoleUpdateEvent event = new GuildRoleUpdateEvent(role, oldRole);
loader.emit(DLUtil.Events.GUILD_ROLE_UPDATE, event);
loader.emit(event);
}
Aggregations