me.schlaubi.commandcord.event.EventAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commandCord Show documentation
Show all versions of commandCord Show documentation
A very feature rich framework for discord bot commands written in Java
The newest version!
package me.schlaubi.commandcord.event;
import me.schlaubi.commandcord.event.events.CommandExecutedEvent;
import me.schlaubi.commandcord.event.events.CommandFailedEvent;
import me.schlaubi.commandcord.event.events.Event;
import me.schlaubi.commandcord.event.events.NoPermissionEvent;
/**
* @author Schlaubi / Michael Rittmeister
*/
public abstract class EventAdapter implements Listener {
public void onCommandExecution(CommandExecutedEvent event) {
}
public void onCommandFail(CommandFailedEvent event) {
}
public void onPermissionViolation(NoPermissionEvent event) {
}
public void onEvent(Event event) {
if (event instanceof CommandExecutedEvent)
this.onCommandExecution((CommandExecutedEvent) event);
else if (event instanceof CommandFailedEvent)
this.onCommandFail((CommandFailedEvent) event);
else if (event instanceof NoPermissionEvent)
this.onPermissionViolation((NoPermissionEvent) event);
}
}