A powerful community management bot designed specifically for the PESU Discord Server. This bot provides essential moderation tools, anonymous messaging capabilities, user linking systems, and various utility commands to enhance the Discord experience for PESU students.
The bot is built with security and privacy in mind, ensuring safe and effective community management while maintaining user confidentiality.
Warning
The bot is hosted on a free-tier GCP e2-micro VM with limited hardware. Users may experience lag during peak usage times.
The bot is currently deployed and active in the PESU Discord Server. Use slash commands to interact with the bot:
- Type
/in any channel to see available commands - Use
/helpfor detailed command documentation - Contact moderators for support with bot-related issues
- Check our project board for current work
- Read the contribution guidelines
- Set up your development environment
- Create a branch:
(discord-username)/feature-description - Submit a PR to the
devbranch
For detailed development setup and contribution instructions, see our Contributing Guide.
βββ pyproject.toml # Project metadata and dependencies
βββ uv.lock # uv lockfile
βββ Dockerfile # Container image definition
βββ LICENSE # Project license
βββ README.md # This file
βββ scripts/ # Operational scripts
β βββ sync_guild_commands.py # Deploy-time guild command sync
βββ src/ # Discord bot package (run via `python -m src`)
βββ __init__.py # Package bootstrap: env loading, logging, version
βββ __main__.py # Entry point for `python -m src`
βββ bot.py # DiscordBot subclass (setup_hook, cog loading, events)
βββ .env.example # Example environment variables
βββ data/ # Static data files
β βββ faq.json # FAQ responses data
βββ cogs/ # Bot functionality modules (Discord.py cogs)
β βββ events.py # Event handling (member joins, ghost pings, etc.)
β βββ anon.py # Anonymous messaging system
β βββ help.py # Help and command documentation
β βββ link.py # User linking and verification
β βββ mod.py # Moderation commands
β βββ utils.py # Utility commands (ping, uptime, etc.)
βββ utils/ # Shared utilities and configuration helpers
βββ config.py # Environment, guild/role/channel IDs and access helpers
βββ general.py # General helper functions
The bot uses Discord.py's cogs system to organize functionality into modular components:
- Events Cogs: Handle Discord events such as member joins, message events, and server updates
- Slash Command Cogs: Implement modern Discord slash commands for user interactions
- Utility Functions: Shared helper functions used across different cogs
The bot maintains several MongoDB collections:
link: Stores Discord-PESU account linksstudent: Student linking dataanonban: Anonymous messaging ban recordsmute: Server mute records
The bot's behavior is controlled primarily through environment variables and code-based configuration:
Refer to our Contributing Guide for environment setup and the list of variables: .github/CONTRIBUTING.md. An example file is provided at src/.env.example.
Holds guild-specific role and channel ID mappings and exposes helpers like get_role/get_channel.
Stores frequently asked questions and their responses for quick access.
Made with β€οΈ by
Powered by contrib.rocks
We welcome contributions from the PESU community! Whether you're fixing bugs, adding new features, or improving documentation, your help is appreciated.
π Read our detailed Contributing Guide for complete setup instructions and development workflow.
The project uses an immutable-image promotion flow designed for free-tier hosting:
- PR to
dev: lint + source checks + Docker image build validation (no push) - Merge to
dev: checks run again, image is pushed to GHCR as<commit_sha>, then deployed to dev - Post-dev health success: deployed SHA is retagged as
dev - Manual prod promotion:
dev -> mainfast-forward, deploy the same immutable SHA, and retag asprodonly on success - Prod failure path: automatic rollback deploy to the previous
prodtag
Key deployment files:
.github/workflows/dev_deploy.yml.github/workflows/prod_deploy.yml.github/workflows/build_and_push_image.yml.github/workflows/ghcr_cleanup.ymlops/deploy/README.md
- No Credential Storage: The bot does not store Discord or PESU passwords
- Secure Database: All data is stored securely in MongoDB with proper access controls
- Role-based Access: Commands are restricted based on user permissions and server roles
- Active Development: The bot is actively maintained and updated
- Community Driven: Features are developed based on community needs
- Production Ready: Currently deployed and serving the PESU Discord community
This project is licensed under the MIT License - see the LICENSE file for details.
For questions, support, or feature requests, please visit our project board or join the discussion on the PESU Discord server.