How to save command cooldown?
How to save command cooldown? The code below adds a cooldown for command, but when bot restarts, the cooldown resets. So how can I make the bot remember from previous usage? If the cooldown limit is 5 times per day and if the member used 3 times and if bot restarts it should start from where it was left for all members. token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" prefix = "?" import discord from discord.ext import commands import pickle, os bot = commands.Bot(command_prefix=prefix) @bot.event async def on_ready(): print('Logged in as') print(bot.user.name) print(bot.user.id) print('------') cooldown_info_path = "cd.pkl" # the file to store the data if os.path.exists(cooldown_info_path): # on the initial run where "cd.pkl" file hadn't been created yet with open(cooldown_info_path, 'rb') as f: d = pickle.load(f) for name, func in bot.commands.items(): if name in d: # if th...