Configuring extensions¶
Passing instances of Extension.Data
¶
If we want to configure an extension, we can pass an instance of the extension specific implementation of Extension.Data
to the JDA-Commands builder. In case of our MyExtension
example, that would be:
Example
Filtering found Extensions¶
Filtering extensions is crucial for resolving cycling dependencies.
To filter which extensions we want to include in our application, we can utilize the
JDACBuilder#filterExtensions(JDACBuilder.FilterStrategy, String...)
method. You need to pass the following two parameters:
JDACBuilder.FilterStrategy
, which will either exclude (FilterStrategy.EXCLUDE
) or include (FilterStrategy.INCLUDE
) the passed extensions.String...
is an enumeration of the full class names, which should be either included or excluded. The strings will be matched to the full class names of the classes extendingExtension
usingString#startWith
, thus specifying package names is possible.