Skip to main content

A modular Discord bot framework for The Aakhri Station

Project description


๐Ÿ”ฅ Ember

Modular. Modern. Production-ready Discord bot framework.

Python 3.11+ discord.py Unlicense Ruff

CI Code Style: Black PRs Welcome pre-commit

Overview โ€ข Cogs โ€ข Quick Start โ€ข Docker โ€ข Extras โ€ข Development โ€ข Credits


Overview

Ember is a fully modular Discord bot built on discord.py 2.4+ and Components V2. Every feature is a self-contained cog โ€” enable or disable anything without touching the core. It ships with a real permissions framework, per-guild config, a central modlog, and a service-layer architecture that keeps business logic testable and clean.

Inspired by Red-DiscordBot's battle-tested patterns, built clean from scratch with modern Python and async-first design.

The default cog set includes:

  • Moderation (warn, mute, ban, kick, modlog with case cards)
  • Community tools (birthdays, AFK, booster roles, welcome messages, activity roles)
  • Utility (temp voice channels, thread cleaner, custom commands, channel management)
  • Fun (game pings, emoji stealer, general commands)
  • Economy (bank, credits)
  • Integrations (Twitch streams, GitHubโ†’Discord, DuckDNS, backups)

Extra plugins (privacy-sensitive features, shipped separately in Ember-extras):

  • Confessions โ€” anonymous confession system with replies and mod tools
  • ShadowChat โ€” anonymous gender-matched chat roulette with DM relay

Cogs

admin โ€” Bot management and configuration
Cog Description
cleanup Bulk message deletion and channel pruning
cog_manager Load, unload, and reload cogs at runtime
dev Developer utilities and debug commands
downloader Install cogs from external repositories
permissions_mgr Fine-grained per-guild permission overrides
settings Bot-wide and per-guild configuration panel
community โ€” Engagement and social features
Cog Description
activity_roles Auto-assign roles based on game activity
afk AFK status with auto-mention suppression
birthday Birthday tracking, announcements, and role assignment
booster_roles Custom colour roles for server boosters
promoter Self-promotion channel with cooldown management
welcome Configurable welcome embeds and DMs for new members
mod โ€” Moderation and logging
Cog Description
moderation Warn, mute, kick, ban, softban with case tracking
modlog Central moderation log with sequential case cards
bot_logging Audit log mirroring and event logging
branding Server branding enforcement and asset management
filter Word/phrase filter with configurable actions
reports User report system with staff escalation
utility โ€” Quality-of-life tools
Cog Description
channels Channel lock/unlock and management shortcuts
customcom Custom slash commands with variable substitution
dragme Move users between voice channels
feedback Structured feedback collection with staff routing
multi_lounge Multiple persistent lounge channels
nick Server-wide nickname management
rolementions Temporarily mentionable role toggle
status Rotating bot status messages
tempvc Dynamic temporary voice channel creation
thread_cleaner Auto-archive or delete inactive threads
fun โ€” Entertainment
Cog Description
emoji_stealer Steal and add emojis from other servers
game_ping Game-activity-based role ping system
general Miscellaneous fun commands
ping Latency check with gateway and API round-trip
economy โ€” Virtual currency
Cog Description
bank Virtual bank with credits, transfers, and leaderboard
integrations โ€” External service connectors
Cog Description
backups Automated database backups to Backblaze B2
duckdns DuckDNS IP updater for dynamic DNS
reconnect Auto-reconnect watchdog for gateway drops
streams Twitch live-stream alerts

Quick Start

Prerequisites

  • Python 3.11 or higher
  • A Discord bot token โ€” create one at the Developer Portal
  • Enable Message Content, Server Members, and Presence intents

Install

git clone https://github.com/guardiansofspartax/Ember.git
cd Ember
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env

Edit .env โ€” at minimum, set BOT_TOKEN:

BOT_TOKEN=your_discord_bot_token_here

# Optional but recommended
OWNER_IDS=111111111111111111
GUILD_ID=123456789012345678        # dev guild for instant slash command sync
EMBER_DB_BACKEND=sqlite            # sqlite | postgres | mongo

Run

python main.py          # load all cogs
python main.py birthday # load one cog (dev/debug)

On first start, slash commands sync to your dev guild instantly. Global sync takes up to one hour.


Docker

# Production
docker compose --profile production up -d

# Development (code mounted, auto-reload)
docker compose --profile development up

See docs/DEPLOYMENT.md for full Docker, PM2, and systemd deployment guides.


Plugins

Privacy-sensitive cogs live in the separate Ember-extras repository so the core stays clean and auditable.

Install a plugin:

# Clone extras next to Ember
git clone https://github.com/guardiansofspartax/Ember-extras.git ../Ember-extras

# Symlink (or copy) the plugin into cogs/
ln -s ../../Ember-extras/confessions cogs/community/confessions

Then restart the bot โ€” Ember's auto-loader will pick it up.


Development

make install        # create venv + install all deps
make pre-commit     # install git hooks

make lint           # ruff + black + mypy
make test           # pytest
make test-cov       # pytest with coverage report
make security       # bandit + pip-audit + safety
make dev-checks     # everything above together

Adding a Cog

cogs/<category>/<cog_name>/
โ”œโ”€โ”€ __init__.py    # async setup(bot)
โ”œโ”€โ”€ cog.py         # EmberCog subclass with commands
โ””โ”€โ”€ service.py     # business logic (optional, recommended)
from discord import app_commands
from core.cog import EmberCog
from core.permissions import PermissionLevel, requires

class MyCog(EmberCog):
    @app_commands.command(name="hello", description="Say hello")
    @requires(PermissionLevel.USER)
    async def hello(self, interaction: discord.Interaction) -> None:
        await self.send_success(interaction, f"Hey, {interaction.user.mention}!")

async def setup(bot):
    await bot.add_cog(MyCog(bot))

See docs/COG_CONTRIBUTION.md for the full guide and docs/FRAMEWORK_API.md for the API reference (Store, cards, errors, checks, modlog, bank, i18n, formatting).


Project Structure

Ember/
โ”œโ”€โ”€ cogs/                  # All bot extensions (auto-discovered)
โ”‚   โ”œโ”€โ”€ admin/
โ”‚   โ”œโ”€โ”€ community/
โ”‚   โ”œโ”€โ”€ economy/
โ”‚   โ”œโ”€โ”€ fun/
โ”‚   โ”œโ”€โ”€ integrations/
โ”‚   โ”œโ”€โ”€ mod/
โ”‚   โ””โ”€โ”€ utility/
โ”œโ”€โ”€ core/                  # Framework internals
โ”‚   โ”œโ”€โ”€ bot.py             # EmberBot โ€” subclasses discord.ext.commands.Bot
โ”‚   โ”œโ”€โ”€ cog.py             # EmberCog base class
โ”‚   โ”œโ”€โ”€ database.py        # Multi-backend DatabaseManager (sqlite/pg/mongo/json)
โ”‚   โ”œโ”€โ”€ permissions.py     # @requires() decorator + PermissionLevel enum
โ”‚   โ”œโ”€โ”€ modlog.py          # Central moderation logging
โ”‚   โ”œโ”€โ”€ rpc.py             # JSON-RPC 2.0 server (optional)
โ”‚   โ””โ”€โ”€ errors.py          # Exception hierarchy
โ”œโ”€โ”€ utils/                 # Shared helpers
โ”‚   โ”œโ”€โ”€ cards.py           # LayoutView card builders (Components V2)
โ”‚   โ”œโ”€โ”€ views.py           # Reusable UI views
โ”‚   โ””โ”€โ”€ validators.py      # Input validation utilities
โ”œโ”€โ”€ config/                # Environment and startup config
โ”œโ”€โ”€ docs/                  # Guides and architecture docs
โ”œโ”€โ”€ scripts/               # CLI utilities (ember.py, dev_utils.py)
โ”œโ”€โ”€ test/                  # Test suite
โ”œโ”€โ”€ main.py                # Entry point
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ””โ”€โ”€ .env.example

Credits

Ember is built on the shoulders of giants:

  • discord.py by Rapptz โ€” the async Discord library powering everything
  • Red-DiscordBot by the Cog Creators team โ€” architectural inspiration for the cog system, permissions model, and modlog design
  • Pycord โ€” reference for Components V2 UI patterns

License

Released into the public domain under the Unlicense.


Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ember_discord_bot-1.3.0.tar.gz (271.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ember_discord_bot-1.3.0-py3-none-any.whl (327.0 kB view details)

Uploaded Python 3

File details

Details for the file ember_discord_bot-1.3.0.tar.gz.

File metadata

  • Download URL: ember_discord_bot-1.3.0.tar.gz
  • Upload date:
  • Size: 271.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for ember_discord_bot-1.3.0.tar.gz
Algorithm Hash digest
SHA256 8a0353fc9e26c0ff97f13cfd9e2db6efca988cc27531105410a888de20bc65af
MD5 a95052c79f5816576fe69fce850dd708
BLAKE2b-256 828e76469a9b0d141055299cc73f62beae47d613d4bae1aa19308c1d46403be6

See more details on using hashes here.

File details

Details for the file ember_discord_bot-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ember_discord_bot-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cfee57d3456c835005dbf0454a7cdcd5b75c34f6d6217d3719eb6c6354c62b3
MD5 d844bfe9a2d12326c580983e50c44d9e
BLAKE2b-256 e10b621e7017c124cc97980ca8763565b708dfe6cb6377e2992ba28034835904

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page