Commit graph

799 commits

Author SHA1 Message Date
p5nbTgip0r
a2796bee04 Fix JDA mentioned user argument parsing if a mention is not given.
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.
2021-01-16 08:54:07 +01:00
Alexander Söderberg
bb9bc4e579 Add keyed values to CommandContext and do some cleanup 2021-01-16 08:54:07 +01:00
Alexander Söderberg
9276a919d3 Add keyed values to CommandContext and do some cleanup 2021-01-16 08:54:07 +01:00
p5nbTgip0r
591f2750c5 Register ChannelArgument and UserArgument as parsers for JDA 2021-01-16 08:54:07 +01:00
Jason
c8fdf22f4b Allow for more easily using translatable components with MinecraftHelp (#197)
*  Allow for more easily using translatable components with MinecraftHelp

* Add missing Javadoc
2021-01-16 08:54:07 +01:00
jmp
8913b2495e 🐛 Transition to AFTER_REGISTRATION even when no commands have been registered 2021-01-16 08:54:07 +01:00
jmp
7eddcd237a typo 2021-01-16 08:54:07 +01:00
jmp
b848070d57 Use an Object with fields instead of a Map for dependency versions 2021-01-16 08:54:07 +01:00
jmp
f1e467038c Rename vers to versions 2021-01-16 08:54:07 +01:00
jmp
40e85caf1b build.gradle.kts buildscript{} -> buildSrc/build.gradle.kts 2021-01-16 08:54:07 +01:00
jmp
2c188eb130 Convert build scripts to Kotlin
Also added some new tasks to only build/install to maven local certain platforms
`buildMinecraft`, `installMinecraft`, `buildDiscord`, `installDiscord`, `buildIRC`, `installIRC`
2021-01-16 08:54:07 +01:00
jmp
d812ea633a 🐛 Fix suggestions in console (Bukkit/Paper) 2021-01-16 08:54:07 +01:00
Irmo van den Berge
a978adc79f Add support for compound arguments for flags
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
jmp
23c0ad77f9 ⬆️ Bump version to 1.4.0-SNAPSHOT 2021-01-16 08:54:07 +01:00
jmp
f7765d8fe9 Minor formatting changes to MinecraftHelp 2021-01-16 08:54:07 +01:00
Irmo van den Berge
df52e99a8b Show 'no results for query' in help when multi-help topic is empty
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Irmo van den Berge
cabb7f426c Add predicate command filter option to the cloud help system
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Irmo van den Berge
4556f12b6d Fix command argument not accepting characters _ and -
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Irmo van den Berge
b29d1ae5d1 Fix suggestions showing twice on spigot+brigadier
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2021-01-16 08:54:07 +01:00
Alexander Söderberg
f09e0ce8f7
📚 Document compound arguments 2021-01-14 11:28:48 +01:00
Alexander Söderberg
788969b24d
📚 Document the parameter injection system 2021-01-14 10:38:41 +01:00
Alexander Söderberg
42812509c5
📚 Document the confirmation system 2021-01-14 09:17:08 +01:00
Alexander Söderberg
e73c9a3baf
📚 Update the project list 2021-01-09 10:35:03 +01:00
Alexander Söderberg
81a452041b
📚 Add more documentation 2021-01-01 22:30:22 +01:00
Alexander Söderberg
550855ece3
📚 Add glossary and document literals. 2021-01-01 04:59:52 +01:00
Alexander Söderberg
00c63b7c0c
📚 Add some information about the command manager 2021-01-01 04:35:03 +01:00
Alexander Söderberg
dd3ad50dda
📚 Fix TOC placement 2021-01-01 04:00:01 +01:00
dependabot[bot]
939b6d26d7 ⬆️ Bump org.jetbrains.kotlin.jvm from 1.4.21 to 1.4.21-2
Bumps org.jetbrains.kotlin.jvm from 1.4.21 to 1.4.21-2.

Signed-off-by: dependabot[bot] <support@github.com>
2021-01-01 00:38:44 +01:00
Alexander Söderberg
2b2bba9d2d
📚 index -> README 2020-12-30 23:13:04 +01:00
Alexander Söderberg
56ae3b8270
Update docs.yml 2020-12-30 23:02:23 +01:00
Alexander Söderberg
6c6bcb13b0
Create docs.yml 2020-12-30 23:00:41 +01:00
Alexander Söderberg
c8158894e0 Set theme jekyll-theme-minimal 2020-12-30 22:52:49 +01:00
Alexander Söderberg
7efe7466a1
📚 Add documentation structure. 2020-12-30 22:50:32 +01:00
Alexander Söderberg
83edf839e3 :docs: Add missing stuff to changelog 2020-12-18 19:49:57 +01:00
Alexander Söderberg
c281c49edf 🚀 Prepare for release 2020-12-18 19:49:57 +01:00
Alexander Söderberg
94b960a992 🐛 Fix suppression in AnnotationParser 2020-12-18 19:49:57 +01:00
Alexander Söderberg
c48eb28434 🐛 Fix issues with the help system 2020-12-18 19:49:57 +01:00
Alexander Söderberg
97e447739c 🎨 Update example plugins to the new meta format 2020-12-18 19:49:57 +01:00
Alexander Söderberg
9ed40a698a Allow interception of command builders based on annotations in AnnotationParser
Fixes #179
2020-12-18 19:49:57 +01:00
Alexander Söderberg
c684c6607f Allow for literals to be combined with a variable arg(#181)
Co-authored-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2020-12-18 19:49:57 +01:00
Alexander Söderberg
52433a4c3a 🐛 Checkstyle is dumb. 2020-12-18 19:49:57 +01:00
Alexander Söderberg
6cc3a21619 Allow default suggestion providers in @Parser 2020-12-18 19:49:57 +01:00
Alexander Söderberg
e5a35afb8a Add @Parser annotated methods
Fixes #166. Also fixes #180.
2020-12-18 19:49:57 +01:00
jmp
c86ccbe1af Fix build 2020-12-18 19:49:57 +01:00
Jason
e93d285483 Kotlin command builder DSL (#165) 2020-12-18 19:49:57 +01:00
Alexander Söderberg
e9178b0834 Add some QoL methods to FlagContext 2020-12-18 19:49:57 +01:00
Kaden Scott
8aa01847b5 🐛 Fix broken synchronous call (#177) 2020-12-18 19:49:57 +01:00
Alexander Söderberg
744ebc929d 📚 Improve ArgumentParser documentation 2020-12-18 19:49:57 +01:00
Alexander Söderberg
885cc7e005 🎨 Fix formatting 2020-12-18 19:49:57 +01:00
Irmo van den Berge
5224050c99 Support repeating literals or argument names (#168)
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2020-12-18 19:49:57 +01:00