A Discord bot that automatically sets slowmode on channels based on message activity.
The bot is still growing and is currently being utilised by 50+ servers across Discord.
- Automatically adjust slowmode settings based on channel activity
- Configure thresholds per channel or server-wide
- Admin commands for configuration and monitoring
- Message rate tracking with configurable time windows
- Scheduled cleanup of old message data
- Python 3.13+
- UV (https://github.com/astral-sh/uv)
-
Clone the repository:
git clone https://github.com/patelheet30/serenity.git cd serenity -
Install dependencies:
uv sync
-
Create a
.envfile with your Discord bot token:TOKEN=your_discord_bot_token_here -
Run the bot:
uv run bot.py
-
Install the Fly.io CLI:
curl -L https://fly.io/install.sh | shOr on macOS with Homebrew:
brew install flyctl
-
Log in to Fly.io:
fly auth login
-
Create the Fly.io app:
fly apps create auto-slowmode-bot
-
Set up volume storage for database persistence:
fly volumes create auto_slowmode_data --size 1 --region lhr
Note: Replace
lhrwith your preferred region. -
Add your Discord bot token as a secret:
fly secrets set TOKEN=your_discord_bot_token_here -
Deploy your application:
fly deploy
-
Monitor your deployment:
fly status fly logs
/auto-slowmode channel enable [channel]- Enable auto-slowmode for a channel/auto-slowmode channel disable [channel]- Disable auto-slowmode for a channel/auto-slowmode channel threshold <threshold> [channel]- Set message rate threshold/auto-slowmode server enable- Enable auto-slowmode server-wide/auto-slowmode server disable- Disable auto-slowmode server-wide/auto-slowmode server threshold <threshold>- Set default message rate threshold/auto-slowmode stats [channel]- View activity and slowmode statistics
The bot stores configuration and message data in an SQLite database, which is automatically created when the bot starts.
- Default message rate threshold: 10 messages per minute
- Update interval: 30 seconds
- Message data retention: 24 hours
- Built with Hikari and Hikari-arc
- Uses UV for dependency management