Skip to content

VeeZG/CSGO-PUGs-Bot

 
 

Repository files navigation

HitCount Maintenance GitHub release PRs Welcome Open Source Love svg3

CS:GO PUGs Bot

A Discord bot to manage CS:GO PUGs. Connects to G5API.

Author

cameronshinn - Developer / Maintainer

Setup

  1. First you must have a bot instance to run this script on. Follow Discord's tutorial here on how to set one up. Be sure to invite it to a server before launch the bot.

    • The required permissions is administrator.
    • Enable the "server members intent" for your bot, as shown here.
  2. Install libpq-dev (Linux only?). This is needed to install the psycopg2 Python package.

    • Linux command is sudo apt-get install libpq-dev.
  3. Run pip3 install -r requirements.txt in the repository's root directory to get the necessary libraries.

  4. Install PostgreSQL 9.5 or higher.

    • Linux command is sudo apt-get install postgresql.
    • Windows users can download here.
  5. Run the psql tool with sudo -u postgres psql and create a database by running the following commands:

    CREATE ROLE PUGs WITH LOGIN PASSWORD 'yourpassword';
    CREATE DATABASE PUGs OWNER PUGs;

    Be sure to replace 'yourpassword' with your own desired password.

    Quit psql with \q

  6. Create an environment file named .env with in the repository's root directory. Fill this template with the requisite information you've gathered...

    DISCORD_BOT_TOKEN= #Bot token from the Discord developer portal
    DISCORD_BOT_LANGUAGE=en # Bot language (key from translations.json), E.g. "en"
    
    G5API_URL= # URL where the web panel is hosted
    
    POSTGRESQL_USER= # "PUGs" (if you used the same username)
    POSTGRESQL_PASSWORD= # The DB password you set
    POSTGRESQL_DB= # "PUGs" (if you used the same DB name)
    POSTGRESQL_HOST= # The IP address of the DB server (127.0.0.1 if running on the same system as the bot)
  7. Apply the database migrations by running python3 migrate.py up.

  8. Run the launcher Python script by running, python3 launcher.py.

Contributions

Code Style

This project adheres to the PEP8 style guide with 120 character line limits.

Branches

Create a branch if you're working on an issue with the issue number and name like so: 100_Title-Separated-By-Dashes.

Commit Messages

Phrase commits in the present tense, e.g. Fix bug instead of Fixed bug.

About

Discord bot to manage CS:GO PUGs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%