You would have to use a database system such as MongoDB or MySQL. You will have to store the active timed ban/mute in a record/document or another table/collection. Then if you are using MySQL you would only select user's that are timed by using Tasks. In MongoDB, you just search for any users that are timed.
You would either make a separate cog or keep it in your moderation cog, it must be executed when it's ready and execute every 5-30 minutes checking if the time is older than the current time. You could use timestamps to accomplish this. Then just update the document/record once the time is up and remove their id from a ban list.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…