SourceStalker is a Discord bot that tracks League of Legends players with live game monitoring, match history, and rank progression visualization.
Choose one of two setup methods:
-
Docker Desktop for Windows
- Download from: https://www.docker.com/products/docker-desktop
- System Requirements:
- Windows 10/11
- WSL 2 (Windows Subsystem for Linux)
- Virtualization enabled in BIOS
-
Git for Windows
- Download from: https://git-scm.com/download/win
- Used to clone the repository
-
Required Accounts/API Keys
- Discord Developer Account
- Discord Bot Token
- Riot Games API Key
-
Python 3.9+
- Linux:
sudo apt install python3 python3-pip python3-venv
(Ubuntu/Debian) - macOS: Install via Homebrew
brew install python
or download from python.org
- Linux:
-
Git
- Linux:
sudo apt install git
(Ubuntu/Debian) - macOS:
brew install git
or use Xcode Command Line Tools
- Linux:
-
Required Accounts/API Keys
- Discord Developer Account
- Discord Bot Token
- Riot Games API Key
- Go to https://discord.com/developers/applications
- Click "New Application"
- Give your application a name (e.g., "SourceStalker")
- Go to the "Bot" section
- Click "Add Bot"
- Under "Token", click "Copy" to copy your bot token (save this for later)
- Under "Privileged Gateway Intents", enable:
- Presence Intent
- Server Members Intent
- Message Content Intent
- Go to "OAuth2" > "URL Generator"
- Select the following scopes:
- bot
- applications.commands
- Select the following bot permissions:
- Send Messages
- Embed Links
- Attach Files
- Read Message History
- Use Slash Commands
- Copy the generated URL and use it to invite the bot to your server
- Go to https://developer.riotgames.com/
- Sign in with your Riot Developer account
- Register a new application
- Wait for application approval
- Save the application API key for later use
-
Install Docker Desktop (if not already installed)
- Download and install Docker Desktop
- Enable WSL 2 when prompted
- Restart your computer
- Ensure Docker is running (system tray icon)
-
Set Up the Project
mkdir C:\SourceStalker
cd C:\SourceStalker
git clone [repository-url] .
mkdir config
- Download Emoji Assets
python scripts/download_assets.py
- Configure and Run
docker-compose up
- Set Up the Project
git clone [repository-url] SourceStalker
cd SourceStalker
- Create Virtual Environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install Dependencies
pip install -r requirements.txt
- Download Emoji Assets
python scripts/download_assets.py
- Create Config Directory
mkdir config
- Run the Bot
python main.py
When you first run the bot, a configuration GUI will appear. Fill in:
- Discord Bot Token (from Discord Developer Portal)
- Discord Channel ID (Right-click channel in Discord > Copy ID)
- Riot API Key (from Riot Developer Portal)
- Summoner Name and Tag (e.g., "PlayerName#NA1")
- Select your region (NA1, EUW1, etc.)
- Leave other settings at default unless you need to change them
Click "Save Configuration", then you can close the window. The bot is now running.
- Start:
docker-compose up -d
- Stop:
docker-compose down
- View logs:
docker-compose logs -f
- Start:
python main.py
(with virtual environment activated) - Stop: Ctrl+C in terminal
Once the bot is running, you can use these commands in your Discord server:
/stalkmatches
- View recent match history with detailed stats and KDA/livegame
- Check if the player is in a game and see team compositions/stalkrank
- View current rank and 30-day rank progression graph/sync
- (Owner only) Manually sync slash commands if they're not working- Use
/sync global_sync:True
to sync commands to all servers
- Use
The bot will also automatically:
- Monitor when the tracked player enters a game
- Send notifications for game results (win/loss)
- Track death count and LP changes after ranked games
SourceStalker uses emoji assets for champions, ranks, and summoner spells. These are not included in the repository to keep it lightweight.
Run this command after cloning the repository:
python scripts/download_assets.py
This will download:
- Champion icons (emoji_assets/champions/)
- Rank icons (emoji_assets/ranks/)
- Summoner spell icons (emoji_assets/spells/)
Note: You'll need these assets for the bot to display champion emojis properly in Discord. The download script will automatically fetch the latest assets from Riot's CDN.
-
Docker won't start
- Ensure virtualization is enabled in BIOS
- Verify WSL 2 is installed and updated
- Try running:
wsl --update
-
Container won't build
- Clear Docker cache:
docker system prune -a
- Ensure all files are in the correct locations
- Check Docker logs for specific errors
- Clear Docker cache:
-
Container starts but bot doesn't respond
- Verify bot token is correct
- Check if bot has proper permissions in Discord
- Review logs for error messages
-
Commands don't work or show as "not synced"
- Ensure bot has proper permissions and was invited with 'applications.commands' scope
- Bot owner can run
/sync
command to manually sync slash commands - Commands sync automatically to the bot's guild on startup
- For global sync across all servers, use
/sync global_sync:True
- Check bot logs for any sync errors during startup
-
Riot API errors
- Verify API key is valid and not expired
- Check rate limits
- Ensure summoner name/tag are correct
-
Database errors
- Check if data directory has proper permissions
- Try stopping the container and starting it again
- Verify database file exists in data directory
- Updating the Bot
docker-compose down
git pull
docker-compose build --no-cache
docker-compose up -d
- Changing Configuration
- Edit
config/config.json
directly - Or stop the bot and delete config to trigger GUI on next start
If you encounter issues not covered in this guide:
- Check the logs:
docker-compose logs -f
- Verify all prerequisites are properly installed
- Ensure all tokens and API keys are valid
- Try restarting Docker Desktop
- Check Discord Developer Portal for bot status
- Keep your bot token and API key secure
- Don't share your config.json file
- Use a dedicated Discord server for testing
- Keep Docker Desktop and WSL updated
- Monitor your Riot API usage
The bot will need occasional updates:
-
Discord bot token rarely needs updating unless compromised
-
Keep Docker Desktop updated for security and performance
Remember to regularly check logs for any issues.