quotientbot / quotient

Quotient is the ultimate open-source discord bot designed to empower E sports communities
https://quotientbot.xyz
Mozilla Public License 2.0
88 stars 101 forks source link

subclass `CommandTree` #145

Open deadaf opened 1 year ago

deadaf commented 1 year ago

With every help command we make an API call to get a list of all slash commands in the bot. A better way to do this might be overriding fetch_commands method to cache the results.

Also, we need to figure out a way to mention sub-commands since parents mention doesn't work & is basically useless.

image

rtk-rnjn commented 1 year ago

monkey patching fetch_commands() is really bad idea, I say we fetch and cache app commands on bot login. And create arbitrary function something like Quotient.get_app_command() similar to dpy Bot.get_command()

deadaf commented 1 year ago

yeah actually that too is a good idea & even less work tbh. I think a method in the Quotient should be a fine approach here. It will fetch commands for the first time then every time it is called, it will return cached results.