A Discord bot that automates gift code redemption for Kingshot players using browser automation. Redeem codes for multiple accounts simultaneously with a single command.
The migration in 1.1.0 update has a major oversight for docker volumes. Please backup your data NOW to avoid data loss.
# Export bot data from a running container
## Version 1.1.0
docker cp kingshot-redeemer:/data/botData.json ./botData.json
## Version 1.0.0
docker cp kingshot-redeemer:/app/data/players.json ./players.json- 🎁 Bulk Redemption - Redeem gift codes for all registered players at once
- 🤖 Browser Automation - Uses Playwright for reliable web interaction
- 💾 Auto-Sync Player Names - Player nicknames automatically update from the offician redeeming site
- 📋 Player Management - Add, remove, search, and list players
- 🔄 Auto-Update Check - Automatically checks for new Docker image versions every 24h
- 🐳 Docker Ready - Easy deployment with Docker/Docker Compose
- 🔄 Cross-Platform - Supports AMD64 and ARM64 architectures
- A Discord bot token (Get one here)
- Docker installed on your system
Option 1: Docker Run
docker run -d \
--name kingshot-redeemer \
-e DISCORD_TOKEN=your_discord_token_here \
-e TIMEOUT_MS=500 \
-v kingshot-data:/app/data \
--restart unless-stopped \
jarecoder/kingshot-redeemer:latestOption 2: Docker Compose (Recommended)
- Create a
docker-compose.ymlfile:
version: '3.8'
services:
kingshot-redeemer:
image: jarecoder/kingshot-redeemer:latest
container_name: kingshot-redeemer-bot
restart: unless-stopped
environment:
- DISCORD_TOKEN=${DISCORD_TOKEN}
- TIMEOUT_MS=${TIMEOUT_MS}
volumes:
- kingshot-data:/app/data
volumes:
kingshot-data:- Create a
.envfile:
DISCORD_TOKEN=your_discord_token_here
TIMEOUT_MS=500- Start the bot:
docker-compose up -d- View logs:
docker-compose logs -f- Go to the Discord Developer Portal
- Click "New Application"
- Give it a name (e.g., "Kingshot Redeemer")
- Click "Create"
- In your application, go to the "Bot" tab
- Click "Add Bot" → "Yes, do it!"
- Under the bot's username, click "Reset Token" and copy it
⚠️ Save this token securely - you'll need it for theDISCORD_TOKENenvironment variable
- Bot can be public or private up to your choosing. I will always recommend private bots for security reasons.
- Go to the "OAuth2" → "URL Generator" tab
- Select these scopes:
- ✅
bot - ✅
applications.commands
- ✅
- Select these bot permissions:
- ✅ Send Messages
- ✅ Use Slash Commands
- Copy the generated URL and open it in your browser
- Select your server and authorize
| Command | Description | Example |
|---|---|---|
/setup <channel> <role> |
Configure update notifications channel and admin role | /setup #my-channel @KingshotAdmin |
/redeem <gift_code> |
Redeem a gift code for all registered players | /redeem KSFB15K |
/add <player_id> |
Add a new player by their Kingshot ID | /add 123456789 |
/remove <query> |
Remove a player by ID or nickname | /remove Jareggie |
/list |
View all registered players (paginated, 10 per page) | /list |
/find <query> |
Search for a player by ID or nickname | /find 123456789 |
/help |
Display all available commands and usage | /help |
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_TOKEN |
✅ Yes | - | Your Discord bot token from the Developer Portal |
TIMEOUT_MS |
❌ No | 500 |
Browser automation timeout in milliseconds |
Bot data (including players and configuration) is stored in /app/data/botData.json inside the container. The Docker volume kingshot-data ensures your data persists across:
- Container restarts
- Bot updates
- System reboots
Global sync (up to 1 hour):
- Wait up to 1 hour for Discord to propagate commands globally
- Or kick & reinvite the bot
- Check logs:
docker-compose logs -f - Verify
DISCORD_TOKENis correct - Ensure bot has proper permissions in Discord
- Check that Message Content Intent is enabled
Nicknames auto-update when:
- A gift code is successfully redeemed
- The game page returns a valid player name
- The stored name differs from the page name
# Clone the repository
git clone https://github.com/JareCoder/KingshotRedeemer.git
cd KingshotRedeemer
# Build the Docker image
docker build -t kingshot-redeemer .
# Run it
docker-compose up -d- ✅
linux/amd64(x86_64 - Most PCs and servers) - ✅
linux/arm64(Apple Silicon Macs, Raspberry Pi, ARM servers)
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for personal or commercial purposes.