mirror of
https://github.com/BluemediaGER/discord-cleanup-bot.git
synced 2024-09-07 21:46:40 +02:00
1.7 KiB
1.7 KiB
discord-cleanup-bot
A simple discord bot to clean up messages in a channel after a configured amount of time.
Limitations / special features
- Only messages not older than 14 days can be deleted
- Threads are not processed by the bot
- Pinned messages are excluded from deletion
Setup using Docker
Using Docker is the easiest way to use this bot:
- Copy the
docker-compose.yaml
to your server - Create a bot account using this guide (ignore the "Inviting Your Bot" section - the bot will show you the correct invite link later)
- Paste your bot token behind
BOT_TOKEN=
in thedocker-compose.yaml
- Start the container using
docker compose up -d
- Run
docker compose logs
and copy the invite link to your browser
Manual setup
If you don't want to use Docker, you can set up the bot manually:
- Clone the Git repo
- Create and activate a new venv
- Install the requirements using
requirements.txt
- Create a bot account using this guide (ignore the "Inviting Your Bot" section - the bot will show you the correct invite link later)
- Set your bot token in the environment variable
BOT_TOKEN
and specify a file path for the SQLite database usingDB_PATH
- Start the
bot.py
script - Copy the invite link to your browser
Commands
All commands provide help messages and support auto-completion.
/purge (days)
Delete all messages of the last x days now an only once./retention [get|set|disable] (retention_period)
Manage continous cleanup. The background job runs every 15 minutes.