|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package net.pingex.dcf.commands;
|
|
|
|
|
|
|
|
|
|
import sx.blah.discord.handle.impl.events.MessageReceivedEvent;
|
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
@ -142,9 +143,9 @@ public abstract class Command implements ICommandExecutor
|
|
|
|
|
return new Command(name, aliases, description, isEnabled, usage)
|
|
|
|
|
{
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(List<String> arguments) throws Throwable
|
|
|
|
|
public void execute(MessageReceivedEvent event, List<String> arguments) throws Throwable
|
|
|
|
|
{
|
|
|
|
|
toExecute.execute(arguments);
|
|
|
|
|
toExecute.execute(event, arguments);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
@ -157,7 +158,14 @@ public abstract class Command implements ICommandExecutor
|
|
|
|
|
*/
|
|
|
|
|
public Command build(Method target, Object invokable)
|
|
|
|
|
{
|
|
|
|
|
return build(arguments -> target.invoke(invokable));
|
|
|
|
|
return new Command(name, aliases, description, isEnabled, usage)
|
|
|
|
|
{
|
|
|
|
|
@Override
|
|
|
|
|
public void execute(MessageReceivedEvent event, List<String> arguments) throws Throwable
|
|
|
|
|
{
|
|
|
|
|
target.invoke(invokable, event, arguments);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|