use of net.dv8tion.jda.core.events.guild.GuildLeaveEvent in project MantaroBot by Mantaro.
the class MantaroListener method onEvent.
@Override
public void onEvent(Event event) {
if (event instanceof ShardMonitorEvent) {
if (MantaroBot.getInstance().getShards()[shardId].getEventManager().getLastJDAEventTimeDiff() > 120000)
return;
((ShardMonitorEvent) event).alive(shardId, ShardMonitorEvent.MANTARO_LISTENER);
return;
}
if (event instanceof GuildMessageReceivedEvent) {
GuildMessageReceivedEvent e = (GuildMessageReceivedEvent) event;
Async.thread("BirthdayThread", () -> onMessage(e));
return;
}
//Log intensifies
if (event instanceof GuildMessageUpdateEvent) {
Async.thread("LogThread(Edit)", () -> logEdit((GuildMessageUpdateEvent) event));
return;
}
if (event instanceof GuildMessageDeleteEvent) {
Async.thread("LogThread(Delete)", () -> logDelete((GuildMessageDeleteEvent) event));
return;
}
if (event instanceof GuildMemberJoinEvent) {
Async.thread("LogThread(Join)", () -> onUserJoin((GuildMemberJoinEvent) event));
return;
}
if (event instanceof GuildMemberLeaveEvent) {
Async.thread("LogThread(Leave)", () -> onUserLeave((GuildMemberLeaveEvent) event));
return;
}
if (event instanceof GuildUnbanEvent) {
Async.thread("LogThread(Unban)", () -> logUnban((GuildUnbanEvent) event));
return;
}
if (event instanceof GuildBanEvent) {
Async.thread("LogThread(Ban)", () -> logBan((GuildBanEvent) event));
return;
}
if (event instanceof GuildJoinEvent) {
Async.thread("LogThread(GuildJoin)", () -> onJoin((GuildJoinEvent) event));
return;
}
if (event instanceof GuildLeaveEvent) {
Async.thread("LogThread(GuildLeave)", () -> onLeave((GuildLeaveEvent) event));
}
//debug
if (event instanceof StatusChangeEvent) {
logStatusChange((StatusChangeEvent) event);
}
if (event instanceof DisconnectEvent) {
onDisconnect((DisconnectEvent) event);
}
if (event instanceof ExceptionEvent) {
onException((ExceptionEvent) event);
}
}
Aggregations