ClearTimer is a Discord bot designed to automatically clear messages in specified channels at regular intervals. This bot uses the Discord API and the APScheduler library to schedule and manage message deletion tasks.
You can add the bot to your server using this link. Alternatively, you can self-host the bot using the guide provided below.
- Python 3.8+
- Discord Bot Token
- Required Python packages (listed in
requirements.txt
)
-
Clone the repository:
git clone https://github.com/biast12/ClearTimerBot.git cd ClearTimerBot
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Ensure
servers.json
andtimezones.json
exist:servers.json
should be an empty JSON object{}
initially.timezones.json
should contain valid timezone abbreviations and their corresponding full names.
-
Run
main.py
and set environment variables:- When running the script for the first time, it will ask you to enter your Discord bot token for the
.env
file. - Additionally, you will be prompted to enter your
OWNER_ID
andGUILD_ID
. These are optional but recommended if you want to use owner-only commands or test the bot in a specific server.
- When running the script for the first time, it will ask you to enter your Discord bot token for the
-
Run the bot on Linux:
python3 main.py
-
Run the bot on Windows:
python main.py
Subscribe a channel to message deletion.
- Timer syntax:
1d2h3m
for days, hours, and minutes orHH:MM <timezone>
for specific times every day. - Example:
/sub 24h #general
subscribes the#general
channel to message deletion every 24 hours.
Unsubscribe a channel from message deletion.
- Example:
/unsub #general
unsubscribes the#general
channel from message deletion.
Check when the next message clear is scheduled.
- Example:
/next #general
shows the next scheduled message clear time for the#general
channel.
Check the bot's latency.
- Example:
/ping
returns the bot's current latency.
Display available commands and help server link.
List all servers and channels subscribed to message deletion.
Force unsubscribe a server or channel from message deletion.
Blacklist a server from subscribing to message deletion.
Remove a server from the blacklist.
List all blacklisted servers.
Reload all commands without restarting the bot.
Display owner-specific commands and help.
By using this bot, you agree to the Terms of Service.
Your privacy is important to us. Please review our Privacy Policy for more information.
For further assistance, join our support Discord server.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Thank you for using ClearTimer! If you have any questions or feedback, feel free to reach out on our support server.