-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add methods for getting app command IDs/mentions from cache #6278
Add methods for getting app command IDs/mentions from cache #6278
Conversation
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 |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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