Cooldowns affecting other commands

In the Beta version of Nightbot, we’ve created a !deaths command and an !adddeath command. I’ve seen some odd behavior so I ran a few tests and it seems like some command cooldowns are affecting other commands cooldowns.

See this Gist

Basically the !commands add cooldown is affecting the execution of the !test command so it doesn’t execute the aliased command and update the count on !foo. It does count me calling !test even when it doesn’t execute it. This frequently happens after timers are executed as well but I have not tested it with timers just seen the results in the live chat. This does not happen when !test is on cooldown from being executed itself (i.e. if you call !test multiple times very quickly).

After using Nightbot for more than I should have there are a few things that I’ve learned.

First off reguardless of the command, every command has a 5 second cooldown. This cooldown exists as I can assume as a rate limiter to prevent global bans and it exists for the owner, moderators and users.

For any cooldown that is manually set (5 to 300 seconds), this can be bypassed as a owner or moderator.

I can presume that this failed because you used !test which conflicted with the 5 second cooldown for the !command command. This cooldown is limited as a whole command that thus is all under one cooldown. Example !commands add, !commands edit are the same default command even though they do different things, still 5 seconds between.

[15:28:02] <~spacerecycler> !commands add !test -a=!commands edit !foo $(count)

[15:28:21] <~spacerecycler> !commands add !bar baz
[15:28:21] <@+^Nightbot> spacerecycler -> The command "!bar" has been added successfully.
[15:28:22] <~spacerecycler> !test

**As a side note:** The command `!test` doesn't increment the `$(count)` value; it only re-writes the command into the same thing it already was. I would recommend checking out this post for what I believe your trying to achieve.

I mean the command works a majority of the time, counting the increment and the command is mod only, but yeah you are right that it was on cooldown due it being aliased. It seems pretty simple now that you pointed it out. I guess I should test a bit more around timers since that was where I was seeing the issue. I’ve seen the !setdeaths example before but wasn’t ready to change active commands in the channel I was modding. I’ll suggest that as a way to workaround this issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.