Skip to content

Instantly share code, notes, and snippets.

View LeoCx1000's full-sized avatar

Leonardo LeoCx1000

View GitHub Profile
@LeoCx1000
LeoCx1000 / ___README.md
Last active April 1, 2024 20:01
Mentionable CommandTree implementation to allow mentioning slash commands in discord.py

discord.py MentionableTree implementation

My implementation of a CommandTree subclass which allows for finding a mention for a given app command.

Changelog

  • 2023-08-14: Turn find_mention_for into a coroutine, and make it auto-fetch commands.
  • 2024-03-12: Make find_mention_for respect fallback_to_global.
  • 2024-03-24: Fix this issue.

Multiple concurrencies

Here is an example on how to use commmands.MaxConcurrency for multiple bucket types. If you want to add more concurrencies, you will need to add more try/except blocks and in each one's except statement you need to release all the previous concurrencies that you have acquired.