mullwar / telebot

The easy way to write Telegram bots in Node.js
https://www.npmjs.com/package/telebot
MIT License
1.48k stars 270 forks source link

How to set cooldown for commands? #225

Open sssherrr opened 1 year ago

sssherrr commented 1 year ago

Hello, I ran into a problem while writing the code for telegram bot. I need to set a cooldown for the /go command so that the user can run it every 2 hours and get the same message every time. And if the user tries to run the command before the cooldown ends, he should receive a message with a different text. Maybe someone knows how to write such code?