I want to code a timed ban or mute, but with that I can restart my bot. Is there a nice libary or anyone has an idea to code it?
Thank you very much!
I code with discordpy cogs
If it involves restarting your bot, then you cannot use your RAM to store your data but you need to use your Hard Disk for that. When your bot is running, it is storing its data inside the RAM and that's why you can re-use them while the bot is online. Once it goes offline or gets restarted, all the data are removed from the RAM because the program is shut down.
To store those data within the Hard Disk, you need a database. For such small projects, you can use JSON or SQLite. If the project scales, you can move to another SQL like MySQL that will handle a more complex and heavy database.
To make a bot that can do a timed message:

You need to store the data of when the message is going to be sent on your hard disk (database), then use that data to send that message. For example, you want to send "hello" in 1 day. That basically means that you want to send it at 8/7/2021 6:19 PM (it's 7/7/2021 6:19 PM right now). So, you store 8/7/2021 6:19 PM as a piece of data of when the bot is going to send the message.
Then you make the bot compare the current time with the time that you saved on your database. If it is greater, then it will send the message and delete the data from the database.
You can use the same technique with timed ban, role and everything else.

From a technical standpoint, you can use Discordpy for all the Discord stuff, datetime to check the time, JSON (or SQlite3) for the database.
Discordpy timed message or ban or role, WITH bot restart | discordpy