Closed ephemeral8997 closed 2 years ago
I changed the /example command to a subclass of SlashCommand
so we can wrap the callback and add PycordManager.pycord_examples
as choices of option. All these changes have been comitted to this pull request, the only remaining issue is filenames are limited to 25 choices per option, and this isn't enough for pycord/examples sadly
I think we should use an embed to get the best results of the example found by regex.
Since Discord has limited the choices to only 25 choices per option, embeds can contain more content.
Good idea, maybe not regex but kinda like if search_string in example["name"]
maybe the code should loop over the string and check if most letters match the example filename
I think it's better than checking if the whole name is inside the example name, since typos might be in the search string
I think It's ready for review
It's finally ready for review, everything should be good now.
Added in #32, it was a simpler approach. Thanks anyways.
The
PycordManager
object will havepycord_examples
attribute which has all file names of pycord/examples, pycord/examples/app_commands and pycord_examples/views which can be used as choices for thep.example
command.