from time import time cooldown = {} delay = 60.0 @bot.message_handler(commands=["help"]) def help(m): if m.chat.id in cooldown: if cooldown[m.chat.id] + delay < time: return bot.send_message(m.chat.id, time) cooldown[m.chat.id] = time
from time import time cooldown = {} delay = 60.0 @bot.message_handler(commands=["help"]) def help(m): if m.chat.id in cooldown: if cooldown[m.chat.id] + delay < time: return bot.send_message(m.chat.id, time) cooldown[m.chat.id] = time