Skip to content

A Discord bot to manage CS2 Match on DatHost servers.

Notifications You must be signed in to change notification settings

thboss/CS2-PUGs

Repository files navigation

CS2 PUGs Bot

A Discord bot to manage CS2 PUGs. Connects to DatHost API.

Test

If you wish to test the bot without any setup, feel free to invite it to your Discord server.

Setup

  1. Install PostgreSQL 9.5 or higher.

    sudo apt-get install postgresql
    
  2. Clone the project to your server

    git clone https://github.com/thboss/g5-discord-bot
    
  3. Install the necessary libraries.

    pip3 install -r requirements.txt
    
  4. Run the psql tool with sudo -u postgres psql and create a database by running the following commands:

    CREATE ROLE "g5" WITH LOGIN PASSWORD 'yourpassword';
    CREATE DATABASE "g5" OWNER g5;
    • Be sure to replace yourpassword with your own password.

    • Quit psql with \q

  5. Edit the configuration file

    cp config.json.template config.json && nano config.json
    
  6. Apply the database migrations

    python3 migrate.py up
    
  7. Finally, start the bot

    python3 run.py
    

Requirements

  • Python 3.8+
  • DatHost account.
  • You must enable server members intent and server message intent on your bot developers portal.
  • Required Permissions:
    • Manage Roles
    • Manage Channels
    • Manage Messages
    • Send Messages
    • Read Message/View Channels
    • Attach Files
    • Use Slash Commands
    • Connect
    • Move Members

How to play

  • Create lobby: Create a lobby using command /create-lobby (You can create unlimited number of lobbies as you need)
    • Note: This command requires Administrator permissions.
  • Link Steam: To participate in lobbies, link your Steam account with the command /link-steam. This will grant you the Linked role, indicating you’re ready to join lobbies.
    • You need to link your account only once, but you can reuse this command to change you linked steam.
  • Join Lobby: Simply, join the lobby voice channel, and bot will automatically add you to the queue.
    • Leave the lobby channel to remove from the queue.
  • Match Setup: Once the lobby is full, the bot will automatically handle the game setup and notify all players as well as create teams channels, ensuring each player is moved to their respective channel.

Thanks To

  1. Cameron Shinn for his initial implementation of csgo-league-bot.

About

A Discord bot to manage CS2 Match on DatHost servers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages