ShindouMihou/Velen

Add interceptor to commands.

Closed this issue · 0 comments

Interceptor

An interceptor will be an additional option to commands where you can add your own condition that the user or message must meet before the command will be triggered. An example would be:

VelenCommand.of("intercept", velen, (event, message, user, args) -> message.reply("Hello"))
.addInterceptor(event -> event.getMessage().contains("this command"))
.attach();

What the example will do is it will reply with "Hello" IF the message contains this command and it won't trigger if it doesn't. Additionally, if possible, I would also love to add a message which will be sent for intercepted commands that is purely optional.