use of net.dv8tion.jda.core.events.guild.voice.GuildVoiceLeaveEvent in project FlareBot by FlareBot.
the class ModlogEvents method onEvent.
@Override
public void onEvent(Event event) {
if (!(event instanceof GenericGuildEvent) && !(event instanceof GenericRoleEvent) && !(event instanceof GenericTextChannelEvent) && !(event instanceof GenericVoiceChannelEvent) && !(event instanceof GenericMessageEvent))
return;
Guild g = null;
if (event instanceof GenericGuildEvent && ((GenericGuildEvent) event).getGuild() != null)
g = ((GenericGuildEvent) event).getGuild();
else if (event instanceof GenericRoleEvent && ((GenericRoleEvent) event).getGuild() != null)
g = ((GenericRoleEvent) event).getGuild();
else if (event instanceof GenericTextChannelEvent && ((GenericTextChannelEvent) event).getGuild() != null)
g = ((GenericTextChannelEvent) event).getGuild();
else if (event instanceof GenericVoiceChannelEvent && ((GenericVoiceChannelEvent) event).getGuild() != null)
g = ((GenericVoiceChannelEvent) event).getGuild();
else if (event instanceof GenericMessageEvent && ((GenericMessageEvent) event).getGuild() != null)
g = ((GenericMessageEvent) event).getGuild();
if (g == null)
return;
GuildWrapper guildWrapper = FlareBotManager.instance().getGuild(g.getId());
if (guildWrapper == null)
return;
// GUILD
if (event instanceof GuildBanEvent)
onGuildBan((GuildBanEvent) event, guildWrapper);
else if (event instanceof GuildMemberJoinEvent)
onGuildMemberJoin((GuildMemberJoinEvent) event, guildWrapper);
else if (event instanceof GuildMemberLeaveEvent)
onGuildMemberLeave((GuildMemberLeaveEvent) event, guildWrapper);
else if (event instanceof GuildVoiceJoinEvent)
onGuildVoiceJoin((GuildVoiceJoinEvent) event, guildWrapper);
else if (event instanceof GuildVoiceLeaveEvent)
onGuildVoiceLeave((GuildVoiceLeaveEvent) event, guildWrapper);
else // ROLES
if (event instanceof RoleCreateEvent)
onRoleCreate((RoleCreateEvent) event, guildWrapper);
else if (event instanceof RoleDeleteEvent)
onRoleDelete((RoleDeleteEvent) event, guildWrapper);
else if (event instanceof GenericRoleUpdateEvent)
onGenericRoleUpdate((GenericRoleUpdateEvent) event, guildWrapper);
else if (event instanceof GuildMemberRoleAddEvent)
onGuildMemberRoleAdd((GuildMemberRoleAddEvent) event, guildWrapper);
else if (event instanceof GuildMemberRoleRemoveEvent)
onGuildMemberRoleRemove((GuildMemberRoleRemoveEvent) event, guildWrapper);
else // CHANNEL
if (event instanceof TextChannelCreateEvent)
onTextChannelCreate((TextChannelCreateEvent) event, guildWrapper);
else if (event instanceof VoiceChannelCreateEvent)
onVoiceChannelCreate((VoiceChannelCreateEvent) event, guildWrapper);
else if (event instanceof TextChannelDeleteEvent)
onTextChannelDelete((TextChannelDeleteEvent) event, guildWrapper);
else if (event instanceof VoiceChannelDeleteEvent)
onVoiceChannelDelete((VoiceChannelDeleteEvent) event, guildWrapper);
else /*else if (event instanceof GuildMessageReceivedEvent)
onGuildMessageReceived((GuildMessageReceivedEvent) event, guildWrapper);*/
if (event instanceof MessageUpdateEvent)
onMessageUpdate((MessageUpdateEvent) event, guildWrapper);
else if (event instanceof MessageDeleteEvent)
onMessageDelete((MessageDeleteEvent) event, guildWrapper);
else // GUILD
if (event instanceof GuildUpdateExplicitContentLevelEvent)
onGuildUpdateExplicitContentLevel((GuildUpdateExplicitContentLevelEvent) event, guildWrapper);
else if (event instanceof GuildMemberNickChangeEvent)
onGuildMemberNickChange((GuildMemberNickChangeEvent) event, guildWrapper);
else if (event instanceof GenericGuildUpdateEvent)
onGenericGuildUpdate((GenericGuildUpdateEvent) event, guildWrapper);
else if (event instanceof GuildVoiceMoveEvent)
onGuildVoiceMove((GuildVoiceMoveEvent) event, guildWrapper);
}
Aggregations