Open Flame442 opened 10 months ago
Potential future work:
- Migrate the current data structure to allow caching on guild
sync
, and allow these new methods to be used to pull from that cache as well
Having such a cache now would mean we don't need to make these methods asynchronous and such a change to method signature is not really something we can do once the API is released. Is there any reason we wouldn't want those methods to be synchronous?
I don't mean a memory cache, I mean storing in config guild specific command ids. Currently, only global app command ids are stored, since that is all the [p]slash
system cares about.
(Edited original to be more clear)
Oh yeah, I missed that this remark is about guild stuff. Either way, I am still wondering about the in-memory cache thing to get a synchronous API, it does seem a bit unfortunate that it requires awaiting right now.
Description of the changes
Adds
bot.get_app_command_id
andbot.get_app_command_mention
which pull from the ID cache built whenRedTree.sync
ing.Potential future work:
CommandTree.fetch_commands
to update the cache manually using the fetched command datasync
, and allow these new methods to be used to pull from that cache as wellFixes #5976
Have the changes in this PR been tested?
Yes