use of io.discloader.discloader.common.event.guild.GuildUpdateEvent in project DiscLoader by R3alCl0ud.
the class GuildUpdate method handle.
@Override
public void handle(SocketPacket packet) {
String d = gson.toJson(packet.d);
GuildJSON data = gson.fromJson(d, GuildJSON.class);
IGuild guild = EntityRegistry.getGuildByID(data.id);
IGuild oldGuild = guild.clone();
guild.setup(data);
GuildUpdateEvent event = new GuildUpdateEvent(guild, oldGuild);
loader.emit(DLUtil.Events.GUILD_UPDATE, event);
loader.emit(event);
}
Aggregations