Bot Documentation¶
The Genji Shimada Discord bot is built with discord.py and provides interactive features for the Genji Parkour community.
Overview¶
The bot handles:
- User commands - Interactive Discord slash commands
- Event processing - Async message queue consumers
- Notifications - Discord notifications for completions, maps, and achievements
- Integration - Seamless integration with the REST API
Quick Links¶
-
Architecture
Learn how the bot is structured
-
Messaging
Understand RabbitMQ queue consumers
-
Configuration
Configure the bot for your environment
Key Features¶
Slash Commands¶
The bot uses Discord's slash commands for user interaction:
@app_commands.command(name="map")
async def map_command(interaction: discord.Interaction, map_code: str):
"""Search for a map by code."""
...
Queue Consumers¶
The bot consumes events from RabbitMQ:
@queue_consumer("api.completion.submission", struct_type=CompletionCreatedEvent)
async def handle_completion(event: CompletionCreatedEvent, message: AbstractIncomingMessage) -> None:
# Send Discord notification
...
API Integration¶
The bot calls the API through APIService attached to bot.api:
Bot Structure¶
apps/bot/
├── core/
│ └── genji.py # Main bot class
├── extensions/ # Feature modules
│ ├── rabbit.py # RabbitMQ service
│ ├── api_service.py # API client
│ ├── completions.py # Completion handlers
│ └── ...
├── configs/ # Configuration files
│ ├── dev.toml
│ └── prod.toml
└── main.py # Entry point
Running the Bot¶
Local Development¶
Run the bot natively for fast iteration:
This automatically loads .env.local and connects to infrastructure running in docker-compose.local.yml.
See the Quick Start Guide for full local development setup.
Remote Staging¶
For deploying to a remote staging server:
Remote Production¶
For deploying to a remote production server:
Next Steps¶
- Core Bot Architecture - Understand the bot's structure
- Messaging System - Learn about queue consumers
- Services - Explore shared services
- Configuration - Configure the bot