Incendo / cloud-discord

Discord integrations for Cloud v2.
https://cloud.incendo.org/discord/
MIT License
5 stars 1 forks source link

Avoid always having auto complete #47

Closed BlueTree242 closed 3 months ago

BlueTree242 commented 6 months ago

Currently, all arguments are registered with auto completions, or with choices. This is not always a good idea because sometimes there's a guarantee that there will be no suggestions returned (like in case of string parser)

I think the suggestions system may need some changes to make this work, I think it's very important because on low end phones discord trying to get auto completions cause delay/lag.

BlueTree242 commented 6 months ago

I think i found a solution that could fix this problem:

  1. SuggestionProvider#noSuggestions should always return the same value, from a final variable.
  2. Add a system on the manager where you could set your predicate, that decides wherethere autocomplete should be true or false. Default checks if SuggestionProvider#noSuggestions equals the provider of the argument, this predicate doesn't get called if DiscordChoices is the type of provider, this predicate would help you detect your own custom providers and act accordingly.
  3. Add a function that allows you to convert the SuggestionProvider into DiscordChoices, that you can set from the manager. (This isn't necessary to resolve this issue, but is helpful in general)