AdelinaM17n / DukeCordEx

A Command-Handler built ontop of Javacord drawing inspiration from Kordex commandhandling system
Mozilla Public License 2.0
0 stars 0 forks source link

Chat command will ignore argument if a optional arg can't be parsed and will not try to parse it to the next arg #1

Open AdelinaM17n opened 1 year ago

AdelinaM17n commented 1 year ago

When chat commands are parsed and it reaches a non coalescing argument, it will try to parse the argument to the current index arg type, and if it fails it will return null to that optional arg and remove the content string

var currentFieldType = orderedList[i].getType();
listObjects[i] = converterMap.containsKey(currentFieldType)
                        ? converterMap.get(currentFieldType).get(contents.get(0),apiWrapper) : null;
if(listObjects[i] != null) orderedList[i] = null;
contents.remove(0);

if the argument it tried to parse the content to is an optional one, it should not remove content string and rather try to parse it with the next argument