1020 lines
40 KiB
Java
1020 lines
40 KiB
Java
package tech.nevets.modbot;
|
|
|
|
import net.dv8tion.jda.api.events.*;
|
|
import net.dv8tion.jda.api.events.application.*;
|
|
import net.dv8tion.jda.api.events.channel.category.*;
|
|
import net.dv8tion.jda.api.events.channel.category.update.*;
|
|
import net.dv8tion.jda.api.events.channel.store.*;
|
|
import net.dv8tion.jda.api.events.channel.store.update.*;
|
|
import net.dv8tion.jda.api.events.channel.text.*;
|
|
import net.dv8tion.jda.api.events.channel.text.update.*;
|
|
import net.dv8tion.jda.api.events.channel.voice.*;
|
|
import net.dv8tion.jda.api.events.channel.voice.update.*;
|
|
import net.dv8tion.jda.api.events.emote.*;
|
|
import net.dv8tion.jda.api.events.emote.update.*;
|
|
import net.dv8tion.jda.api.events.guild.*;
|
|
import net.dv8tion.jda.api.events.guild.invite.*;
|
|
import net.dv8tion.jda.api.events.guild.member.*;
|
|
import net.dv8tion.jda.api.events.guild.member.update.*;
|
|
import net.dv8tion.jda.api.events.guild.override.*;
|
|
import net.dv8tion.jda.api.events.guild.update.*;
|
|
import net.dv8tion.jda.api.events.guild.voice.*;
|
|
import net.dv8tion.jda.api.events.http.HttpRequestEvent;
|
|
import net.dv8tion.jda.api.events.interaction.*;
|
|
import net.dv8tion.jda.api.events.message.*;
|
|
import net.dv8tion.jda.api.events.message.guild.*;
|
|
import net.dv8tion.jda.api.events.message.guild.react.*;
|
|
import net.dv8tion.jda.api.events.message.priv.*;
|
|
import net.dv8tion.jda.api.events.message.priv.react.*;
|
|
import net.dv8tion.jda.api.events.message.react.*;
|
|
import net.dv8tion.jda.api.events.role.*;
|
|
import net.dv8tion.jda.api.events.role.update.*;
|
|
import net.dv8tion.jda.api.events.self.*;
|
|
import net.dv8tion.jda.api.events.stage.*;
|
|
import net.dv8tion.jda.api.events.stage.update.*;
|
|
import net.dv8tion.jda.api.events.user.*;
|
|
import net.dv8tion.jda.api.events.user.update.*;
|
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
|
|
|
import javax.annotation.Nonnull;
|
|
import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.Method;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class EventExecutor extends ListenerAdapter {
|
|
private final List<Method> listenerMethods = new ArrayList<>();
|
|
|
|
public void registerListener(ListenerAdapter listener) {
|
|
Class<? extends ListenerAdapter> clazz = listener.getClass();
|
|
listenerMethods.addAll(List.of(clazz.getDeclaredMethods()));
|
|
}
|
|
|
|
@Override
|
|
public void onGenericEvent(@Nonnull GenericEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGenericEvent")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGenericUpdate(@Nonnull UpdateEvent<?, ?> event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGenericUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onRawGateway(@Nonnull RawGatewayEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onRawGateway")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGatewayPing(@Nonnull GatewayPingEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGatewayPing")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//JDA Events
|
|
@Override
|
|
public void onReady(@Nonnull ReadyEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onReady")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onResumed(@Nonnull ResumedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onResumed")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onReconnected(@Nonnull ReconnectedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onReconnected")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onDisconnect(@Nonnull DisconnectEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onDisconnect")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onShutdown(@Nonnull ShutdownEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onShutdown")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onStatusChange(@Nonnull StatusChangeEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onStatusChange")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onException(@Nonnull ExceptionEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onException")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Interaction Events
|
|
@Override
|
|
public void onSlashCommand(@Nonnull SlashCommandEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSlashCommand")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onButtonClick(@Nonnull ButtonClickEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onButtonClick")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onSelectionMenu(@Nonnull SelectionMenuEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSelectionMenu")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Application Events
|
|
@Override
|
|
public void onApplicationCommandUpdate(@Nonnull ApplicationCommandUpdateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onApplicationCommandUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onApplicationCommandDelete(@Nonnull ApplicationCommandDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onApplicationCommandDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onApplicationCommandCreate(@Nonnull ApplicationCommandCreateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onApplicationCommandCreate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//User Events
|
|
@Override
|
|
public void onUserUpdateName(@Nonnull UserUpdateNameEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateName")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateDiscriminator(@Nonnull UserUpdateDiscriminatorEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateDiscriminator")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateAvatar(@Nonnull UserUpdateAvatarEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateAvatar")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateOnlineStatus(@Nonnull UserUpdateOnlineStatusEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateOnlineStatus")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateActivityOrder(@Nonnull UserUpdateActivityOrderEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateActivityOrder")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateFlags(@Nonnull UserUpdateFlagsEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateFlags")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserTyping(@Nonnull UserTypingEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserTyping")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserActivityStart(@Nonnull UserActivityStartEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserActivityStart")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserActivityEnd(@Nonnull UserActivityEndEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserActivityEnd")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onUserUpdateActivities(@Nonnull UserUpdateActivitiesEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onUserUpdateActivities")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Self Events. Fires only in relation to the currently logged in account.
|
|
@Override
|
|
public void onSelfUpdateAvatar(@Nonnull SelfUpdateAvatarEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSelfUpdateAvatar")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onSelfUpdateMFA(@Nonnull SelfUpdateMFAEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSelfUpdateMFA")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onSelfUpdateName(@Nonnull SelfUpdateNameEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSelfUpdateName")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onSelfUpdateVerified(@Nonnull SelfUpdateVerifiedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onSelfUpdateVerified")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Message Events
|
|
//Guild (TextChannel) Message Events
|
|
@Override
|
|
public void onGuildMessageReceived(@Nonnull GuildMessageReceivedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageReceived")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageUpdate(@Nonnull GuildMessageUpdateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageDelete(@Nonnull GuildMessageDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageEmbed(@Nonnull GuildMessageEmbedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageEmbed")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageReactionAdd(@Nonnull GuildMessageReactionAddEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageReactionAdd")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageReactionRemove(@Nonnull GuildMessageReactionRemoveEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageReactionRemove")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageReactionRemoveAll(@Nonnull GuildMessageReactionRemoveAllEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageReactionRemoveAll")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onGuildMessageReactionRemoveEmote(@Nonnull GuildMessageReactionRemoveEmoteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onGuildMessageReactionRemoveEmote")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Private Message Events
|
|
@Override
|
|
public void onPrivateMessageReceived(@Nonnull PrivateMessageReceivedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageReceived")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPrivateMessageUpdate(@Nonnull PrivateMessageUpdateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPrivateMessageDelete(@Nonnull PrivateMessageDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPrivateMessageEmbed(@Nonnull PrivateMessageEmbedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageEmbed")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPrivateMessageReactionAdd(@Nonnull PrivateMessageReactionAddEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageReactionAdd")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPrivateMessageReactionRemove(@Nonnull PrivateMessageReactionRemoveEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPrivateMessageReactionRemove")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//Combined Message Events (Combines Guild and Private message into 1 event)
|
|
@Override
|
|
public void onMessageReceived(@Nonnull MessageReceivedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageReceived")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageUpdate(@Nonnull MessageUpdateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageDelete(@Nonnull MessageDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageBulkDelete(@Nonnull MessageBulkDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageBulkDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageEmbed(@Nonnull MessageEmbedEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageEmbed")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageReactionAdd(@Nonnull MessageReactionAddEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageReactionAdd")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageReactionRemove(@Nonnull MessageReactionRemoveEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageReactionRemove")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageReactionRemoveAll(@Nonnull MessageReactionRemoveAllEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageReactionRemoveAll")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onMessageReactionRemoveEmote(@Nonnull MessageReactionRemoveEmoteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onMessageReactionRemoveEmote")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//PermissionOverride Events
|
|
@Override
|
|
public void onPermissionOverrideDelete(@Nonnull PermissionOverrideDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPermissionOverrideDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPermissionOverrideUpdate(@Nonnull PermissionOverrideUpdateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPermissionOverrideUpdate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onPermissionOverrideCreate(@Nonnull PermissionOverrideCreateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onPermissionOverrideCreate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//StoreChannel Events
|
|
@Override
|
|
public void onStoreChannelDelete(@Nonnull StoreChannelDeleteEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onStoreChannelDelete")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onStoreChannelUpdateName(@Nonnull StoreChannelUpdateNameEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onStoreChannelUpdateName")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onStoreChannelUpdatePosition(@Nonnull StoreChannelUpdatePositionEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onStoreChannelUpdatePosition")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onStoreChannelCreate(@Nonnull StoreChannelCreateEvent event) {
|
|
for (Method method : listenerMethods) {
|
|
if (method.getName().equals("onStoreChannelCreate")) {
|
|
try {
|
|
method.invoke(event);
|
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//TextChannel Events
|
|
public void onTextChannelDelete(@Nonnull TextChannelDeleteEvent event) {}
|
|
public void onTextChannelUpdateName(@Nonnull TextChannelUpdateNameEvent event) {}
|
|
public void onTextChannelUpdateTopic(@Nonnull TextChannelUpdateTopicEvent event) {}
|
|
public void onTextChannelUpdatePosition(@Nonnull TextChannelUpdatePositionEvent event) {}
|
|
public void onTextChannelUpdateNSFW(@Nonnull TextChannelUpdateNSFWEvent event) {}
|
|
public void onTextChannelUpdateParent(@Nonnull TextChannelUpdateParentEvent event) {}
|
|
public void onTextChannelUpdateSlowmode(@Nonnull TextChannelUpdateSlowmodeEvent event) {}
|
|
public void onTextChannelUpdateNews(@Nonnull TextChannelUpdateNewsEvent event) {}
|
|
public void onTextChannelCreate(@Nonnull TextChannelCreateEvent event) {}
|
|
|
|
//VoiceChannel Events
|
|
public void onVoiceChannelDelete(@Nonnull VoiceChannelDeleteEvent event) {}
|
|
public void onVoiceChannelUpdateName(@Nonnull VoiceChannelUpdateNameEvent event) {}
|
|
public void onVoiceChannelUpdatePosition(@Nonnull VoiceChannelUpdatePositionEvent event) {}
|
|
public void onVoiceChannelUpdateUserLimit(@Nonnull VoiceChannelUpdateUserLimitEvent event) {}
|
|
public void onVoiceChannelUpdateBitrate(@Nonnull VoiceChannelUpdateBitrateEvent event) {}
|
|
public void onVoiceChannelUpdateParent(@Nonnull VoiceChannelUpdateParentEvent event) {}
|
|
public void onVoiceChannelUpdateRegion(@Nonnull VoiceChannelUpdateRegionEvent event) {}
|
|
public void onVoiceChannelCreate(@Nonnull VoiceChannelCreateEvent event) {}
|
|
|
|
//Category Events
|
|
public void onCategoryDelete(@Nonnull CategoryDeleteEvent event) {}
|
|
public void onCategoryUpdateName(@Nonnull CategoryUpdateNameEvent event) {}
|
|
public void onCategoryUpdatePosition(@Nonnull CategoryUpdatePositionEvent event) {}
|
|
public void onCategoryCreate(@Nonnull CategoryCreateEvent event) {}
|
|
|
|
//StageInstance Event
|
|
public void onStageInstanceDelete(@Nonnull StageInstanceDeleteEvent event) {}
|
|
public void onStageInstanceUpdateTopic(@Nonnull StageInstanceUpdateTopicEvent event) {}
|
|
public void onStageInstanceUpdatePrivacyLevel(@Nonnull StageInstanceUpdatePrivacyLevelEvent event) {}
|
|
public void onStageInstanceCreate(@Nonnull StageInstanceCreateEvent event) {}
|
|
|
|
//Guild Events
|
|
public void onGuildReady(@Nonnull GuildReadyEvent event) {}
|
|
public void onGuildTimeout(@Nonnull GuildTimeoutEvent event) {}
|
|
public void onGuildJoin(@Nonnull GuildJoinEvent event) {}
|
|
public void onGuildLeave(@Nonnull GuildLeaveEvent event) {}
|
|
public void onGuildAvailable(@Nonnull GuildAvailableEvent event) {}
|
|
public void onGuildUnavailable(@Nonnull GuildUnavailableEvent event) {}
|
|
public void onUnavailableGuildJoined(@Nonnull UnavailableGuildJoinedEvent event) {}
|
|
public void onUnavailableGuildLeave(@Nonnull UnavailableGuildLeaveEvent event) {}
|
|
public void onGuildBan(@Nonnull GuildBanEvent event) {}
|
|
public void onGuildUnban(@Nonnull GuildUnbanEvent event) {}
|
|
public void onGuildMemberRemove(@Nonnull GuildMemberRemoveEvent event) {}
|
|
|
|
//Guild Update Events
|
|
public void onGuildUpdateAfkChannel(@Nonnull GuildUpdateAfkChannelEvent event) {}
|
|
public void onGuildUpdateSystemChannel(@Nonnull GuildUpdateSystemChannelEvent event) {}
|
|
public void onGuildUpdateRulesChannel(@Nonnull GuildUpdateRulesChannelEvent event) {}
|
|
public void onGuildUpdateCommunityUpdatesChannel(@Nonnull GuildUpdateCommunityUpdatesChannelEvent event) {}
|
|
public void onGuildUpdateAfkTimeout(@Nonnull GuildUpdateAfkTimeoutEvent event) {}
|
|
public void onGuildUpdateExplicitContentLevel(@Nonnull GuildUpdateExplicitContentLevelEvent event) {}
|
|
public void onGuildUpdateIcon(@Nonnull GuildUpdateIconEvent event) {}
|
|
public void onGuildUpdateMFALevel(@Nonnull GuildUpdateMFALevelEvent event) {}
|
|
public void onGuildUpdateName(@Nonnull GuildUpdateNameEvent event){}
|
|
public void onGuildUpdateNotificationLevel(@Nonnull GuildUpdateNotificationLevelEvent event) {}
|
|
public void onGuildUpdateOwner(@Nonnull GuildUpdateOwnerEvent event) {}
|
|
|
|
public void onGuildUpdateSplash(@Nonnull GuildUpdateSplashEvent event) {}
|
|
public void onGuildUpdateVerificationLevel(@Nonnull GuildUpdateVerificationLevelEvent event) {}
|
|
public void onGuildUpdateLocale(@Nonnull GuildUpdateLocaleEvent event) {}
|
|
public void onGuildUpdateFeatures(@Nonnull GuildUpdateFeaturesEvent event) {}
|
|
public void onGuildUpdateVanityCode(@Nonnull GuildUpdateVanityCodeEvent event) {}
|
|
public void onGuildUpdateBanner(@Nonnull GuildUpdateBannerEvent event) {}
|
|
public void onGuildUpdateDescription(@Nonnull GuildUpdateDescriptionEvent event) {}
|
|
public void onGuildUpdateBoostTier(@Nonnull GuildUpdateBoostTierEvent event) {}
|
|
public void onGuildUpdateBoostCount(@Nonnull GuildUpdateBoostCountEvent event) {}
|
|
public void onGuildUpdateMaxMembers(@Nonnull GuildUpdateMaxMembersEvent event) {}
|
|
public void onGuildUpdateMaxPresences(@Nonnull GuildUpdateMaxPresencesEvent event) {}
|
|
public void onGuildUpdateNSFWLevel(@Nonnull GuildUpdateNSFWLevelEvent event) {}
|
|
|
|
//Guild Invite Events
|
|
public void onGuildInviteCreate(@Nonnull GuildInviteCreateEvent event) {}
|
|
public void onGuildInviteDelete(@Nonnull GuildInviteDeleteEvent event) {}
|
|
|
|
//Guild Member Events
|
|
public void onGuildMemberJoin(@Nonnull GuildMemberJoinEvent event) {}
|
|
public void onGuildMemberRoleAdd(@Nonnull GuildMemberRoleAddEvent event) {}
|
|
public void onGuildMemberRoleRemove(@Nonnull GuildMemberRoleRemoveEvent event) {}
|
|
|
|
//Guild Member Update Events
|
|
public void onGuildMemberUpdate(@Nonnull GuildMemberUpdateEvent event) {}
|
|
public void onGuildMemberUpdateNickname(@Nonnull GuildMemberUpdateNicknameEvent event) {}
|
|
public void onGuildMemberUpdateAvatar(@Nonnull GuildMemberUpdateAvatarEvent event) {}
|
|
public void onGuildMemberUpdateBoostTime(@Nonnull GuildMemberUpdateBoostTimeEvent event) {}
|
|
public void onGuildMemberUpdatePending(@Nonnull GuildMemberUpdatePendingEvent event) {}
|
|
|
|
//Guild Voice Events
|
|
public void onGuildVoiceUpdate(@Nonnull GuildVoiceUpdateEvent event) {}
|
|
public void onGuildVoiceJoin(@Nonnull GuildVoiceJoinEvent event) {}
|
|
public void onGuildVoiceMove(@Nonnull GuildVoiceMoveEvent event) {}
|
|
public void onGuildVoiceLeave(@Nonnull GuildVoiceLeaveEvent event) {}
|
|
public void onGuildVoiceMute(@Nonnull GuildVoiceMuteEvent event) {}
|
|
public void onGuildVoiceDeafen(@Nonnull GuildVoiceDeafenEvent event) {}
|
|
public void onGuildVoiceGuildMute(@Nonnull GuildVoiceGuildMuteEvent event) {}
|
|
public void onGuildVoiceGuildDeafen(@Nonnull GuildVoiceGuildDeafenEvent event) {}
|
|
public void onGuildVoiceSelfMute(@Nonnull GuildVoiceSelfMuteEvent event) {}
|
|
public void onGuildVoiceSelfDeafen(@Nonnull GuildVoiceSelfDeafenEvent event) {}
|
|
public void onGuildVoiceSuppress(@Nonnull GuildVoiceSuppressEvent event) {}
|
|
public void onGuildVoiceStream(@Nonnull GuildVoiceStreamEvent event) {}
|
|
public void onGuildVoiceVideo(@Nonnull GuildVoiceVideoEvent event) {}
|
|
public void onGuildVoiceRequestToSpeak(@Nonnull GuildVoiceRequestToSpeakEvent event) {}
|
|
|
|
//Role events
|
|
public void onRoleCreate(@Nonnull RoleCreateEvent event) {}
|
|
public void onRoleDelete(@Nonnull RoleDeleteEvent event) {}
|
|
|
|
//Role Update Events
|
|
public void onRoleUpdateColor(@Nonnull RoleUpdateColorEvent event) {}
|
|
public void onRoleUpdateHoisted(@Nonnull RoleUpdateHoistedEvent event) {}
|
|
public void onRoleUpdateIcon(@Nonnull RoleUpdateIconEvent event) {}
|
|
public void onRoleUpdateMentionable(@Nonnull RoleUpdateMentionableEvent event) {}
|
|
public void onRoleUpdateName(@Nonnull RoleUpdateNameEvent event) {}
|
|
public void onRoleUpdatePermissions(@Nonnull RoleUpdatePermissionsEvent event) {}
|
|
public void onRoleUpdatePosition(@Nonnull RoleUpdatePositionEvent event) {}
|
|
|
|
//Emote Events
|
|
public void onEmoteAdded(@Nonnull EmoteAddedEvent event) {}
|
|
public void onEmoteRemoved(@Nonnull EmoteRemovedEvent event) {}
|
|
|
|
//Emote Update Events
|
|
public void onEmoteUpdateName(@Nonnull EmoteUpdateNameEvent event) {}
|
|
public void onEmoteUpdateRoles(@Nonnull EmoteUpdateRolesEvent event) {}
|
|
|
|
// Debug Events
|
|
public void onHttpRequest(@Nonnull HttpRequestEvent event) {}
|
|
|
|
//Generic Events
|
|
public void onGenericApplicationCommand(@Nonnull GenericApplicationCommandEvent event) {}
|
|
public void onGenericInteractionCreate(@Nonnull GenericInteractionCreateEvent event) {}
|
|
public void onGenericComponentInteractionCreate(@Nonnull GenericComponentInteractionCreateEvent event) {}
|
|
public void onGenericMessage(@Nonnull GenericMessageEvent event) {}
|
|
public void onGenericMessageReaction(@Nonnull GenericMessageReactionEvent event) {}
|
|
public void onGenericGuildMessage(@Nonnull GenericGuildMessageEvent event) {}
|
|
public void onGenericGuildMessageReaction(@Nonnull GenericGuildMessageReactionEvent event) {}
|
|
public void onGenericPrivateMessage(@Nonnull GenericPrivateMessageEvent event) {}
|
|
public void onGenericPrivateMessageReaction(@Nonnull GenericPrivateMessageReactionEvent event) {}
|
|
public void onGenericUser(@Nonnull GenericUserEvent event) {}
|
|
public void onGenericUserPresence(@Nonnull GenericUserPresenceEvent event) {}
|
|
public void onGenericSelfUpdate(@Nonnull GenericSelfUpdateEvent event) {}
|
|
public void onGenericStoreChannel(@Nonnull GenericStoreChannelEvent event) {}
|
|
public void onGenericStoreChannelUpdate(@Nonnull GenericStoreChannelUpdateEvent event) {}
|
|
public void onGenericTextChannel(@Nonnull GenericTextChannelEvent event) {}
|
|
public void onGenericTextChannelUpdate(@Nonnull GenericTextChannelUpdateEvent event) {}
|
|
public void onGenericVoiceChannel(@Nonnull GenericVoiceChannelEvent event) {}
|
|
public void onGenericVoiceChannelUpdate(@Nonnull GenericVoiceChannelUpdateEvent event) {}
|
|
public void onGenericCategory(@Nonnull GenericCategoryEvent event) {}
|
|
public void onGenericCategoryUpdate(@Nonnull GenericCategoryUpdateEvent event) {}
|
|
public void onGenericStageInstance(@Nonnull GenericStageInstanceEvent event) {}
|
|
public void onGenericStageInstanceUpdate(@Nonnull GenericStageInstanceUpdateEvent event) {}
|
|
public void onGenericGuild(@Nonnull GenericGuildEvent event) {}
|
|
public void onGenericGuildUpdate(@Nonnull GenericGuildUpdateEvent event) {}
|
|
public void onGenericGuildInvite(@Nonnull GenericGuildInviteEvent event) {}
|
|
public void onGenericGuildMember(@Nonnull GenericGuildMemberEvent event) {}
|
|
public void onGenericGuildMemberUpdate(@Nonnull GenericGuildMemberUpdateEvent event) {}
|
|
public void onGenericGuildVoice(@Nonnull GenericGuildVoiceEvent event) {}
|
|
public void onGenericRole(@Nonnull GenericRoleEvent event) {}
|
|
public void onGenericRoleUpdate(@Nonnull GenericRoleUpdateEvent event) {}
|
|
public void onGenericEmote(@Nonnull GenericEmoteEvent event) {}
|
|
public void onGenericEmoteUpdate(@Nonnull GenericEmoteUpdateEvent event) {}
|
|
public void onGenericPermissionOverride(@Nonnull GenericPermissionOverrideEvent event) {}
|
|
}
|