Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.
/ Serenity Public archive

The intelligent traffic controller for your Discord server. Monitors channel activity in real-time and automatically adjusts slowmode settings to maintain healthy conversation flow during high-traffic periods. Customisable thresholds, admin controls, and almost zero setup required.

License

Notifications You must be signed in to change notification settings

patelheet30/Serenity

Repository files navigation

Serenity Discord Bot

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.

Invite the Bot here

Features

  • 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

Local Development

Prerequisites

Setup

  1. Clone the repository:

    git clone https://github.com/patelheet30/serenity.git
    cd serenity
  2. Install dependencies:

    uv sync
  3. Create a .env file with your Discord bot token:

    TOKEN=your_discord_bot_token_here
    
  4. Run the bot:

    uv run bot.py

Deployment to Fly.io

Prerequisites

  1. Install the Fly.io CLI:

    curl -L https://fly.io/install.sh | sh

    Or on macOS with Homebrew:

    brew install flyctl
  2. Log in to Fly.io:

    fly auth login

Deployment Steps

  1. Create the Fly.io app:

    fly apps create auto-slowmode-bot
  2. Set up volume storage for database persistence:

    fly volumes create auto_slowmode_data --size 1 --region lhr

    Note: Replace lhr with your preferred region.

  3. Add your Discord bot token as a secret:

    fly secrets set TOKEN=your_discord_bot_token_here
  4. Deploy your application:

    fly deploy
  5. Monitor your deployment:

    fly status
    fly logs

Bot Commands

Admin Commands

  • /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

Configuration

The bot stores configuration and message data in an SQLite database, which is automatically created when the bot starts.

Default Settings

  • Default message rate threshold: 10 messages per minute
  • Update interval: 30 seconds
  • Message data retention: 24 hours

Acknowledgements

About

The intelligent traffic controller for your Discord server. Monitors channel activity in real-time and automatically adjusts slowmode settings to maintain healthy conversation flow during high-traffic periods. Customisable thresholds, admin controls, and almost zero setup required.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published