Closed
Conversation
Bumps com.github.johnrengelman.shadow from 6.0.0 to 6.1.0. Signed-off-by: dependabot[bot] <support@github.com>
Bumps jmh-generator-annprocess from 1.25.2 to 1.26. Signed-off-by: dependabot[bot] <support@github.com>
Bumps JDA from 4.2.0_207 to 4.2.0_210. Signed-off-by: dependabot[bot] <support@github.com>
Bumps [checker-qual](https://github.com/typetools/checker-framework) from 3.5.0 to 3.7.0. - [Release notes](https://github.com/typetools/checker-framework/releases) - [Changelog](https://github.com/typetools/checker-framework/blob/master/changelog.txt) - [Commits](typetools/checker-framework@checker-framework-3.5.0...checker-framework-3.7.0) Signed-off-by: dependabot[bot] <support@github.com>
* ✨ Add LocationArgument to cloud-bukkit * 🎨 Use the Bukkit CommandSender from the command context in LocationArgument * 🐛 Fixed quoted parsing in StringArgument * 📚 Fix code style Co-authored-by: jmp <jasonpenilla2@me.com>
This will be used for Sponge & Fabric, that both require command registration to happen (at latest) in specific events. This way we lock writing after that event has occurred. As a side effect, we're able to collect & merge all commands before registering them to the platform, which means we don't have to hackily force-inject duplicate commands.
Changed list usages to set and made the default builders use the mention parser
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
Basic example also showing a basic implementation of the permission mapper
…elp (#197) * ✨ Allow for more easily using translatable components with MinecraftHelp * Add missing Javadoc
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.
- 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
… mappers. This is necessary for the `ChannelArgument` parser to work.
broccolai
approved these changes
Jan 9, 2021
JarFiles
approved these changes
Jan 9, 2021
zml2008
approved these changes
Jan 9, 2021
48702ad to
c7b2b0f
Compare
Closed
Member
|
closing for #518 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR takes the goal of adding type-safe sender type casts such that following code can be written:
This is done through some generic changes and a couple casts that should be safe given the new generic type
Nholds the expectationN extends C, whereCis the old type. This is safe, because by the time the command is called, the sender type should already be checked.Nis therefore always going to be assignable to the typeC(like howStringis assignable toCharSequence, and(Class<CharSequence>) classInstancewhereClass<? extends CharSequence> classInstance = String.classis safe).This should AFAIK be ABI-compatible with the previous code.