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 functionality to mention app commands #5976

Open
Luc1412 opened this issue Jan 31, 2023 · 0 comments · May be fixed by #6278
Open

Add functionality to mention app commands #5976

Luc1412 opened this issue Jan 31, 2023 · 0 comments · May be fixed by #6278
Assignees
Labels
Complex Issue This issue may require more than a surface level fix or be highly integrated with other components High Priority High priority Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Feature New feature or request.

Comments

@Luc1412
Copy link

Luc1412 commented Jan 31, 2023

Type of feature request

API functionality

Description of the feature you're suggesting

Currently mentioning an app command is pain with plain discord.py. You would need to fetch all commands from api and search for the right command. This can be improved by implementing a cache.

A tag from discord.py:

To have your bot mention its own commands without hardcoding them, you'll need to use either tree.sync or tree.fetch_commands to get the commands from discord then .mention the command(s) you want.
It's recommended to subclass CommandTree to override these methods and cache the results to avoid unnecessary api calls.

The best way would be adding such cache in the tree. This cache is either supplied on sync or when triggering manually an update with a method.

Furthermore a method to get a mention would be nice. E.g. Bot.get_app_command_mention(name: str, guild_id: Optional[int]) -> Optional[str]
Usage:

  • bot.get_app_command_mention('ban')
  • bot.get_app_command_mention('cog update')
  • bot.get_app_command_mention('load', guild_id=133049272517001216)

Anything else?

No response

@Luc1412 Luc1412 added the Type: Feature New feature or request. label Jan 31, 2023
@github-actions github-actions bot added the Status: Needs Triage This has not been labeled or discussed for handling yet. label Jan 31, 2023
@Flame442 Flame442 added High Priority High priority Status: Accepted We want this Complex Issue This issue may require more than a surface level fix or be highly integrated with other components and removed Status: Needs Triage This has not been labeled or discussed for handling yet. labels Mar 27, 2023
@Flame442 Flame442 added this to the 3.5.1 milestone Apr 13, 2023
@Flame442 Flame442 self-assigned this Apr 13, 2023
@Flame442 Flame442 added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this labels Apr 13, 2023
@Jackenmen Jackenmen removed this from the 3.5.6 milestone Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complex Issue This issue may require more than a surface level fix or be highly integrated with other components High Priority High priority Status: In Progress There's a PR open to deal with this, or an org member is working on this internally Type: Feature New feature or request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants