Skip to content

WingsDevelopment/dota-leaguev2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ DOTA LEAGUE HOSTING PLATFORM

Welcome to the Dota 2 League Hosting Platform, a side project with 100+ active users and ~400 discord members

๐Ÿงฉ How It Works

  • Players join a queue on Discord.
  • Once 10 players are in queue, a Steam bot:
    • Creates a lobby
    • Invites all players
  • The Discord bot notifies players.
  • When all players join:
    • The lobby starts automatically
    • The match is tracked and scored
  • MMR is updated live.
  • In Season 2, enjoy:
    • ๐Ÿง  Full match history
    • ๐Ÿ“Š Detailed stats per game

๐ŸŒ PRODUCTION LINKS

  • ๐Ÿ† Dota League Hosting Platform: https://www.dota-league-hosting.xyz/
  • ๐Ÿฅ‡ Season 1: https://dota-league.vercel.app/
  • ๐Ÿฅˆ Season 2: https://radekomsa.site/

๐Ÿ› ๏ธ DEV DOCUMENTATION

๐Ÿ’ป Frontend Dev (Next.js)

Make sure Node.js is installed.

cd nextjs-app
npm install
npm run dev

๐Ÿ Python Scripts Dev

Make sure Python is installed.

cd python-scripts
pip install -r requirements.txt       # Install dependencies
pip list                              # Check installed packages

# First time setup
python3 discord_db.py

# Run the scripts
python3 run_all.py dev
# Or if using 'python' directly
python run_all.py dev

๐Ÿš€ DEPLOYMENT DOCS

๐Ÿณ Docker Start System

docker-compose up --build

๐Ÿงช Environment Setup

Create environment files:

nano .env.python
nano .env.nextjs

Paste the contents, then:

  • Ctrl+O โ†’ Save
  • Enter โ†’ Confirm filename
  • Ctrl+X โ†’ Exit nano

List files to verify:

ls -la
cat .env.nextjs

๐Ÿ”’ SSL Certificate Fix

After generating the SSL cert on the server:

chmod 600 ./letsencrypt/acme.json

Run from the project root.

๐Ÿงน Other Docker Commands

Delete all containers and volumes:

docker-compose down -v

Free up memory:

docker system prune -a --volumes

โ„น๏ธ Note: DB is copied from local if it exists.


๐Ÿค– DISCORD BOT

DiscordBot for hosting a Dota 2 League.

โš™๏ธ How to Set Up the Discord Bot

Step 1: Create a Discord Bot

  1. Go to the Discord Developer Portal
  2. Click New Application โ†’ Give it a name โ†’ Create
  3. Go to the Bot tab โ†’ Click Add Bot โ†’ Confirm
  4. Click Reset Token โ†’ Copy the token

โœ… Enable in Bot Tab:

  • Presence Intent
  • Server Members Intent
  • Message Content Intent

Step 2: Invite the Bot to Your Server

  1. Go to OAuth2 > URL Generator
  2. Select bot under Scopes
  3. Add permissions (e.g., Administrator, Send/Manage Messages)
  4. Copy the generated URL โ†’ Open in browser โ†’ Select server โ†’ Authorize

๐Ÿ” (Optional) Website Integration

If using a frontend:

Update OAuth2 Redirect URLs in the Discord Developer Portal:

https://radekomsa.site/api/auth/callback/discord/callback/discord
https://radekomsa.site/api/auth/callback/discord

๐Ÿ”‘ Discord OAuth Settings

1. Generating AUTH_SECRET

npx auth secret

Add to .env.local:

AUTH_SECRET=your_generated_secret

2. Getting Discord Client Info

From the Discord Developer Portal:

AUTH_DISCORD_ID=your_discord_client_id
AUTH_DISCORD_SECRET=your_discord_client_secret

๐Ÿ“ข CHANNEL SETUP

How to Get Discord Channel IDs

  1. Enable Developer Mode in Discord:
    • User Settings โ†’ Advanced โ†’ Enable Developer Mode
  2. Right-click a channel โ†’ Copy ID โ†’ Paste into .env

๐Ÿ—ƒ๏ธ Database Setup

Initialize:

python3 discord_db.py

๐ŸŽญ Discord Role Management

  1. Create a role on Discord
  2. Assign it to yourself
  3. Set rolename in league_settings.yaml

๐Ÿ“ฆ .env File Permissions for HTTPS

mkdir -p letsencrypt
touch letsencrypt/acme.json
chmod 600 letsencrypt/acme.json

๐Ÿ‘‘ Add Admin to League

Paste full Steam profile URL into:

https://www.dota2.com/league/17791/admins

๐Ÿงพ Read DB on Ubuntu

sqlite3 league.db
sqlite> .tables
sqlite> .headers on
sqlite> .mode column
sqlite> SELECT * FROM MatchHistory;
sqlite> .exit

๐Ÿ“œ Read Python Logs

docker-compose logs -f python

About

dota-leaguev2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •