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.
My implementation of a CommandTree subclass which allows for finding a mention for a given app command.
Just copy the entire third file into a new file python of your project, and import it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any, Callable, Optional, TypeVar | |
import discord | |
from discord.ext import commands | |
T_contra = TypeVar('T_contra', contravariant=True) | |
class AsyncCooldownMapping(commands.CooldownMapping[T_contra]): |