instafluff / ComfyJS

Comfiest Twitch Chat Library for JavaScript | NodeJS + Browser Support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cooldown Timer Support

instafluff opened this issue · comments

It will be nice to add a timer cooldown to the extra parameter for onCommand() that includes the time since the individual user has used the command (user cooldown) and the time since any user has used the command (global cooldown) so that it would be easy for the Comfy.JS user to skip handling commands that are longer than X amount of time. Implementation details are still open for ideas too!

I'm interested in implementing this feature. So if I'm understanding correctly, it sounds like that we would want to save the user interaction with the commands in a global variable, and then pass the time-passed-since-last value to the end user implementation of the onCommand function, i.e. to this line:

ComfyJS/app.js

Line 208 in 7a33e52

comfyJS.onCommand( user, command, msg, flags, extra );

That sounds like a great way to do it!

Great, I'll see what I can do about it!

@instafluff can you release new version with this feature? Want to use it ASAP! bitmoji

Thanks for reminding me @talk2MeGooseman ! It was done with 176bb20 and 1.0.12 is now published!