๐ฎ Modern Discord bot for real-time LAN Play server monitoring
Monitor Nintendo Switch games, players, and servers across multiple LAN Play instances with beautiful Discord integration
๐ Quick Start โข ๐ฏ Features โข ๐ Documentation โข ๐ค Support
โจ Quick start with Docker Compose:
git clone https://github.com/LeGeRyChEeSe/LanPlay-DiscordBot.git
cd LanPlay-DiscordBot
cp .env.example .env# Edit .env with a text editor and add your tokens:
# TOKEN=your_discord_bot_token_here
# API_LAN_KEY=your_lan_play_api_key_heredocker-compose up -d- Clone the repository from GitHub
- Copy the environment template:
cp .env.example .env โ ๏ธ Configure your API keys in the.envfile:- Discord Bot Token: Get from Discord Developer Portal
- LAN Play API Key: Get from lan-play.com (see guide)
- Start the bot with Docker or Python
๐ Need help? View detailed setup guide
- ๐ฎ Real-time Game Monitoring: Display active Nintendo Switch games and player counts
- ๐ Multi-Server Support: Monitor multiple LAN Play servers simultaneously
- ๐ง Custom Server Management: Administrators can add/remove custom servers
- ๐ Multi-language Support: Available in English and French
- ๐ Server Uptime Tracking: Display server reliability information
- ๐จ Rich Embeds: Beautiful Discord embeds with game icons and player information
- ๐ณ Docker Ready: Fully containerized for easy deployment
- ๐ Security First: Non-root Docker containers and input validation
Quick Links:
Using Docker Compose:
# 1. Clone and navigate
git clone https://github.com/LeGeRyChEeSe/LanPlay-DiscordBot.git
cd LanPlay-DiscordBot
# 2. Create environment file
cp .env.example .env
# 3. โ ๏ธ EDIT .env file with your tokens:
# TOKEN=your_discord_bot_token_here
# API_LAN_KEY=your_lan_play_api_key_here
# 4. Start the bot
docker-compose up -dUsing Docker Run:
docker run -d \
--name lanplay-discordbot \
-e TOKEN=your_discord_bot_token_here \
-e API_LAN_KEY=your_lan_play_api_key_here \
-v bot_data:/app/data \
garohrl/lanplay-discordbot:latest# 1. Clone and navigate
git clone https://github.com/LeGeRyChEeSe/LanPlay-DiscordBot.git
cd LanPlay-DiscordBot
# 2. Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Create environment file
cp .env.example .env
# 5. โ ๏ธ EDIT .env file with your API keys:
# TOKEN=your_discord_bot_token_here
# API_LAN_KEY=your_lan_play_api_key_here
# 6. Start the bot
python main.pyCreate a .env file with the following variables:
# Discord Bot Token (Required)
TOKEN=your_discord_bot_token
# LAN Play API Key (Required)
API_LAN_KEY=your_lan_play_api_key๐ Step-by-step guide to get your LAN Play API key:
- Visit lan-play.com
- Open Developer Tools (
F12orCtrl+Shift+I) - Go to Network tab and refresh the page
- Find the
getMonitorsrequest and click on it - In the Payload tab, copy the
api_keyvalue - Add it to your .env file:
API_LAN_KEY=your_copied_api_key_here
โ ๏ธ Important: Without a valid API key, the bot cannot fetch LAN Play server data!
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Navigate to the "Bot" section
- Click "Add Bot" and confirm
- Copy the bot token and add it to your
.envfile
The bot requires the following permissions:
Send MessagesSend Messages in ThreadsEmbed LinksRead Message HistoryManage Expressions(for game icons)Create ExpressionsUse Slash Commands
- In the Discord Developer Portal, go to OAuth2 โ URL Generator
- Select these scopes:
botapplications.commands
- Select the permissions listed above
- Use the generated URL to invite the bot to your server
โ ๏ธ Security Note: Keep your bot token secret! Never share it publicly or commit it to version control.
Shows server selection menu with:
- Server uptime percentages
- Real-time player counts (active/idle)
- Game information with custom icons
- Host and player details
- Add Server:
/add server:your-server.com:11451 - Delete Server:
/delete server:your-server.com:11451(with autocomplete)
LanPlay-DiscordBot/
โโโ src/
โ โโโ bot/
โ โ โโโ bot.py # Main bot class and initialization
โ โ โโโ commands.py # Slash command handlers
โ โ โโโ events.py # Event handlers (dropdowns, etc.)
โ โโโ utils/
โ โ โโโ lanplay_client.py # GraphQL client for LAN Play API
โ โ โโโ server_manager.py # Custom server management
โ โ โโโ localization.py # Multi-language support
โ โ โโโ version.py # Semantic versioning system
โ โ โโโ changelog.py # Changelog management
โ โโโ config/
โ โโโ settings.py # Configuration management
โ โโโ locale/ # Language files
โโโ scripts/ # Development and build scripts
โ โโโ version_bump.py # Python version management
โ โโโ version.sh # Shell version commands
โ โโโ docker-build.sh # Docker build with versioning
โโโ static/assets/ # Static resources
โโโ tests/ # Unit tests
โโโ main.py # Application entry point
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Container configuration
โโโ docker-compose.yml # Docker Compose setup
โโโ Makefile # Development commands
โโโ VERSION # Current version number
โโโ CHANGELOG.md # Structured changelog
โโโ VERSIONING.md # Versioning system documentation
โโโ .env.example # Environment template
Running Tests:
python -m pytest tests/Code Formatting:
black src/
flake8 src/Development Setup:
- Fork the project
- Create feature branch:
git checkout -b feature/AmazingFeature - Install dependencies:
pip install -r requirements.txt - Make changes and test
- Document changes:
make add-change TYPE=added DESC="New feature" - Commit:
git commit -m 'feat: Add AmazingFeature' - Release:
make release-bump TYPE=minor(if needed) - Push and create Pull Request
Version Management:
# Show current version
make version
# Add changelog entry
make add-change TYPE=fixed DESC="Fix bug" ISSUE="#42"
# Version bumping
make bump-patch # Bug fixes
make bump-minor # New features
make bump-major # Breaking changes
# Release management
make release # Release unreleased changes
make changelog # View recent changes๐ Licensed under MIT License
- LAN Play Community for the amazing service
- Discord.py developers
- All contributors who helped improve this project
๐จโ๐ป Author: Garoh โข Discord: garohrl




