#No cooldown for certain roles

1 messages · Page 1 of 1 (latest)

sacred vessel
#

Hi, I've been trying to make some roles not incur a cooldown at all but I haven't been successful so far. I've been trying to extend the ExecuteChecksAsync() method with my code checking for roles, but I have the problem that the method is called from yet another sealed class SlashCommandsExtension. Does anybody have a good solution for my problem that doesn't include basically rewriting the whole SlashCommandsExtension class?

rapid schooner
#

You can use Dependency Injection and get the id or what ever it is your missing.

sacred vessel
#

Can you elaborate? I am not very familiar with dependency injection, but I am not sure how it would help me. My problem isn't that I can't access the user's roles, my problem is that the SlashCommandsExtension class and the SlashCooldownAttribute classes are sealed and I can't override the methods they contain

rapid schooner
#

ahh, you could copy the code from SlashCooldownAttribute and make your own attribute

sacred vessel
#

yea i thought about that too but wanted to avoid that if at all possible

sacred vessel
#

think its not really possible at all tbh, there are so many protected and internal classes etc.