Skip to content
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

Open
wants to merge 2 commits into
base: V3/develop
Choose a base branch
from

Conversation

Flame442
Copy link
Member

@Flame442 Flame442 commented Dec 29, 2023

Description of the changes

Adds bot.get_app_command_id and bot.get_app_command_mention which pull from the ID cache built when RedTree.syncing.

Potential future work:

  • Hook into CommandTree.fetch_commands to update the cache manually using the fetched command data
  • Migrate the current data structure to allow storing guild specific app command IDs on guild sync, and allow these new methods to be used to pull from that cache as well

Fixes #5976

Have the changes in this PR been tested?

Yes

@Flame442 Flame442 added the Type: Feature New feature or request. label Dec 29, 2023
@Flame442 Flame442 added this to the 3.5.6 milestone Dec 29, 2023
@github-actions github-actions bot added the Category: Core - Bot Class This is related to the `redbot.core.bot.Red` class. label Dec 29, 2023
@Jackenmen
Copy link
Member

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?

@Flame442
Copy link
Member Author

Flame442 commented Dec 29, 2023

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)

@Jackenmen
Copy link
Member

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.

@Jackenmen Jackenmen modified the milestones: 3.5.6, 3.5.7 Mar 18, 2024
Daniel07468

This comment was marked as spam.

@Jackenmen Jackenmen modified the milestones: 3.5.9, 3.5.10 Apr 20, 2024
@Flame442 Flame442 added the High Priority High priority label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core - Bot Class This is related to the `redbot.core.bot.Red` class. High Priority High priority Type: Feature New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functionality to mention app commands
3 participants