Search in sources :

Example 1 with GuildBanRemoveEvent

use of io.discloader.discloader.common.event.guild.GuildBanRemoveEvent in project DiscLoader by R3alCl0ud.

the class GuildBanRemove method handle.

@Override
public void handle(SocketPacket packet) {
    String d = gson.toJson(packet.d);
    GuildMemberRemoveJSON data = gson.fromJson(d, GuildMemberRemoveJSON.class);
    IGuild guild = EntityRegistry.getGuildByID(data.guild_id);
    IUser user = EntityRegistry.addUser(data.user);
    GuildBanRemoveEvent event = new GuildBanRemoveEvent(guild, user);
    loader.emit(DLUtil.Events.GUILD_BAN_REMOVE, event);
    loader.emit(event);
}
Also used : GuildMemberRemoveJSON(io.discloader.discloader.network.json.GuildMemberRemoveJSON) GuildBanRemoveEvent(io.discloader.discloader.common.event.guild.GuildBanRemoveEvent) IUser(io.discloader.discloader.entity.user.IUser) IGuild(io.discloader.discloader.entity.guild.IGuild)

Aggregations

GuildBanRemoveEvent (io.discloader.discloader.common.event.guild.GuildBanRemoveEvent)1 IGuild (io.discloader.discloader.entity.guild.IGuild)1 IUser (io.discloader.discloader.entity.user.IUser)1 GuildMemberRemoveJSON (io.discloader.discloader.network.json.GuildMemberRemoveJSON)1