use of io.discloader.discloader.common.event.guild.role.GuildRoleDeleteEvent in project DiscLoader by R3alCl0ud.
the class RoleDelete method handle.
@Override
public void handle(SocketPacket packet) {
String d = this.gson.toJson(packet.d);
GuildRoleJSON data = this.gson.fromJson(d, GuildRoleJSON.class);
IGuild guild = EntityRegistry.getGuildByID(data.guild_id);
IRole role = guild.removeRole(data.role_id);
if (role == null)
return;
GuildRoleDeleteEvent event = new GuildRoleDeleteEvent(role);
loader.emit(DLUtil.Events.GUILD_ROLE_DELETE, event);
loader.emit(event);
}
Aggregations