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

Double cooldowns in Duels #18

Closed
CRASNY opened this issue Mar 16, 2017 · 5 comments
Closed

Double cooldowns in Duels #18

CRASNY opened this issue Mar 16, 2017 · 5 comments

Comments

@CRASNY
Copy link

CRASNY commented Mar 16, 2017

Without modifying any code, I'm getting two cooldown messages on cooldown. Any idea how to work around that?

[1:13 PM] Liz: >duel David
[1:13 PM] BOTFSY: You are on cooldown. Try again in 8.12s
[1:13 PM] BOTFSY: This command is on cooldown. Try again in 8.12 seconds.

@calebj
Copy link
Owner

calebj commented Mar 16, 2017 via email

@CRASNY
Copy link
Author

CRASNY commented Mar 16, 2017

Thanks for the really fast reply. Maybe you can help me understand cooldowns actually, since I haven't found that in documentation.

@commands.cooldown(1, 60, commands.BucketType.user)
I know the 60 represents a minute cooldown, but what is the 1? If I change that to 2, it will allow 2 per 60 seconds, or?

@calebj
Copy link
Owner

calebj commented Mar 16, 2017 via email

@CRASNY
Copy link
Author

CRASNY commented Mar 16, 2017

Thanks for the help. I managed to fix this by commenting out this line in red.py:

            #await bot.send_message(channel, error)
            await bot.send_message(channel, "This command is on cooldown. "
                                            "Try again in {:.2f} seconds."
                                            "".format(error.retry_after))

I'm not sure why it was performing both of these sends, and not entirely sure of the consequences to other cogs in commenting that out, but at least Duels works better now.

One more unrelated question though, I'm noticing after the fifth message that's sent it's as if the bot gets throttled and it pauses for a moment before continuing to output duel results. Do you know why that is?

@calebj
Copy link
Owner

calebj commented Mar 16, 2017

That looks like a modified version of red.py; the mainline version doesn't have two send_messages.

In any case, this is a Red issue and not with my cogs specifically. I think you should git reset your red.py to match the maintained version, or more things are bound to break.

@calebj calebj closed this as completed Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants