chore(core): deprecate prefixed accessors/mutators in CommandManager.java
All prefixed (actual) getters/setters in CommandManager have been deprecated, and non-prefixed alternatives have been introduced. I've also put some effort into improving the JavaDocs of these methods.
* build: switch to spotless
add in some other basic formatting steps that allow for easy
auto-correction
* build: lint text files as well
* chore: remove license headers from package-info files
spotless can't verify these
* fabric: Update Loom to 0.7-SNAPSHOT
* Update to Gradle 7
Switch to CadixDev/licenser
The plugin we were using before does not support Gradle 7, and hasn't been updated in over a year.
* Remove `jcenter()` references
* Move to new JDA repo and bump version
* Use setup-java v2 and Adopt JDK 16 in gh actions
* build: Temporarily add Incendo repo for plugin resolution
Allows building until licenser has a new release
* Import indra plugin classes instead of string applies
* remove space
Co-authored-by: broccolai <me@broccol.ai>
* Fix NPE with webhook messages.
Webhook messages would be constructed as `JDAGuildSender`, which calls `Objects.requireNonNull(event.getMember())` however the JDA documentation states that the `getMember()` method will `be null in case of Message being received in a PrivateChannel or isWebhookMessage() returning true.` If the message is a webhook message, a generic `JDACommandSender` instance will be constructed instead of a `JDAGuildSender`
* Add webhook fix to changelog
- Ensure that the parsing modes list cannot be empty when constructing `MessageParser`
- Don't proceed if the command context does not have the message event stored
- Don't proceed if the message was not sent in a guild
- Remove `|| modes.size() == 1` check in channel mention parsing
If only `ParserMode.MENTION` was set as a parsing mode, the initial check for `input.endsWith(">")` would be bypassed and the input would begin to be parsed like a mention. If the input was less than three characters long then the `substring` calls would give a very ambiguous error along the lines of `begin 2, end X-1, length X`.
This commit fixes this issue by adding a check to make sure the input is an actual user mention. If the input isn't a mention then an exception will be set stating that the sender's input was not a user mention.
In addition, this commit also removes the `modes.size() == 1` check in the mention parser. I'm not sure why this was there to begin with, but I don't think that the input parsing check should be bypassed because only one parsing mode is specified. I settled on a check in the `UserParser` constructor to make sure that the parsing modes list isn't empty in order to ensure that at least one parser mode handles the input.
Also added some new tasks to only build/install to maven local certain platforms
`buildMinecraft`, `installMinecraft`, `buildDiscord`, `installDiscord`, `buildIRC`, `installIRC`
Switches the command sender class to JDACommandSender and allows for it to be constructed with a nullable MessageReceivedEvent allowing for poeple to have backwards mappers
Adds the possibility to specify a custom mapper for command permissions (e.G. for permissions in private messages or if you just don't want to use discord's built-in permission system)