EQUENOS / dislash.py

A Python wrapper for discord slash-commands and buttons, designed to extend discord.py.

Home Page:https://dislashpy.readthedocs.io/en/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reset Cooldown Doesn't Work

LextYi opened this issue · comments

commented

I try to use slash_core.BaseSlashCommand.reset_cooldown(inter) to reset the cooldown.
But it shows this error: reset_cooldown() missing 1 required positional argument: 'inter'

Then I try this: slash_core.BaseSlashCommand.reset_cooldown(self, inter)
But it still shows the error: 'SlashCommand' object has no attribute '_buckets'

commented

You can't use slash_core.BaseSlashCommand.reset_cooldown(inter), it's not a static method. It's a method of slash command. You need to create an instance of slash command (which can be retrieved using an interaction) and use reset_cooldown on it.

So, you'd end up with something like this:
inter.slash_command.reset_cooldown(inter)

This isn't a bug - this is just how python works and as such should be closed.

I think we can close this issue after our discussion on the discord server