use of io.discloader.discloader.common.event.channel.ChannelCreateEvent in project DiscLoader by R3alCl0ud.
the class ChannelCreate method handle.
@Override
public void handle(SocketPacket packet) {
String d = gson.toJson(packet.d);
ChannelJSON data = gson.fromJson(d, ChannelJSON.class);
IGuild guild = EntityRegistry.getGuildByID(data.guild_id);
IChannel channel = EntityRegistry.addChannel(data, loader, guild);
ChannelCreateEvent event = new ChannelCreateEvent(channel);
loader.emit(Events.CHANNEL_CREATE, event);
loader.emit(event);
}
Aggregations