[Français]
Je voudrait savoir comment changer pendant que le serveur tourne l’argument GenericArguments.choices
Merci a ceux qui m’aideront
[English with Google Translate]
I would like to know how to change while the server is running the GenericArguments.choices argument.
Thanks to those who will help me
[Google translate]
I have a list of stations (too long to explain) that all have a name that is random because there are a lot of them. And I want us to be able to choose a station (with the name) to get information about that station.
No, do not do that. There is a native way to do this in the API without having to do this - there is a dynamic choices argument that was designed for this exact situation.
The Supplier<Collection<String>> will return the valid strings that can be selected each time the command parameter is invoked. So, your supplier could point to the list of stations. The Function<String, ?> converts the selected string into the object that would be put into the CommandContext, if you just want the string, you could just use Function::Identity or the lambda x -> x.