Skip to content

Command Arguments

pumbas600 edited this page Aug 14, 2021 · 19 revisions

Written for HalpBot-Core-1.0.1

In HalpBot, method parameters are automatically assumed to be command arguments except in the following 3 situations:

  1. The parameter type extends GenericEvent (E.g: MessageReceivedEvent). Instead, it'll pass the MessageReceivedEvent that JDA received when the command was called.

  2. The parameter type extends AbstractCommandAdapter (E.g: TokenCommandAdapter). Instead, it'll pass the TokenCommandAdapter that the command is registered to.

  3. The parameter is annotated with @Source. This tells HalpBot that the parameter is meant to be extracted from the MessageReceivedEvent (Just so that you don't have to).

Supported Types

Built-In Annotations

Custom Objects

Reflections

Custom Type Parsers

Clone this wiki locally