Forked from csgo-queue-bot
- A Discord bot that allows setting up CS:GO PUGs and play with friends with easy setup matches and super smooth.
- Authentication player's Discord account with their Steam throght WEB API.
- Multiple queues per guild.
- Multiple matches at time.
- Multiple Servers.
- Multiple maps (Bo1, Bo2, Bo3...).
- Join/Leave the queue based on lobby voice channel.
- Queue ready up system.
- Random/Ranked/Volunteer picking captains methods..
- Random/teambalance/captains picking teams methods.
- Random/Vote/Veto picking map methods.
- Add/Remove maps pool.
- Auto create teams channels.
- Auto delete teams channels on match end.
- Force end matches.
- Rank system.
- Translations file.
-
Python3.6+
-
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.
- The required permissions is
-
Setup and get an API token for the CS:GO League web API along with the host base URL.
-
Install libpq-dev (Linux only?). This is needed to install the psycopg2 Python package.
- Linux command is
sudo apt-get install libpq-dev
.
- Linux command is
-
Run
pip3 install -r requirements.txt
in the repository's root directory to get the necessary libraries. -
Install PostgreSQL 9.5 or higher.
- Linux command is
sudo apt-get install postgresql
. - Windows users can download here.
- Linux command is
-
Run the psql tool with
sudo -u postgres psql
and create a database by running the following commands:CREATE ROLE csgoleague WITH LOGIN PASSWORD 'yourpassword'; CREATE DATABASE csgoleague OWNER csgoleague;
Be sure to replace
'yourpassword'
with your own desired password.Quit psql with
\q
-
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_LEAGUE_LANGUAGE= # Bot language (key from translations.json), E.g. "en" CSGO_LEAGUE_API_KEY= # API from the CS:GO League web backend .env file CSGO_LEAGUE_API_URL= # URL where the web panel is hosted POSTGRESQL_USER= # "csgoleague" (if you used the same username) POSTGRESQL_PASSWORD= # The DB password you set POSTGRESQL_DB= # "csgoleague" (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) POSTGRESQL_PORT=5432
-
Apply the database migrations by running
python3 migrate.py up
. -
Run the launcher Python script by running,
python3 launcher.py
.
-
Type
q!create <name>
to create new PUG and the bot will automatically create these channels:- name_queue : view queue progress.
- name_commands : bot commands are restrict in this channel.
- name_lobby : players must join this channel to add to the queue
- name_prelobby : move unreadied players to this channel
-
Type
q!link
in the commands channel and you will get DM has a link. -
Open that link and log in with Steam to connect your account to League system.
-
Once linked, type
q!check
in the commands channel to get the verified role. -
Join Lobby voice channel and wait fills up the queue.
-
Bot automatically create teams channels and move players into.
-
Once match over, Bot remove teams channels.
-
How to add new maps to the map pool?
- Empty the database by running
python3 migrate.py down
. - Add map icon (.png) to
assets/maps/icons/
and rename it likeDust II-de_dust
. - Apply the new database migrations by running
python3 migrate.py up
.
- Empty the database by running
-
You can rename roles and channels that bot has created it.
q!create <name>
- Create a PUG with the given name
q!delete
- Delete the current PUG
q!forcelink <mention> <SteamId64>
- Force link a player on the backend
q!unlink <mention>
- Delete the mentioned on the backend
q!spectators {+|-} <mention> <mention> ...
- View/Add/Remove matches spectators
q!removespect <mention>
- Remove the mentioned user from the spectators
q!empty
- Empty the queue
q!cap <number>
- Set the capacity of the queue to the specified value
q!teams <random|autobalance|captains>
- Set the team creation method
q!captains <rank|random|volunteer>
- Set the captain selection method
q!maps <random|vote|captains>
- Set the map selection method
q!mpool {+|-}<map name>
- Add/Remove maps to default map pool
q!end <match id>
- Force end live match
q!link
- Link a player on the backend
q!check
- Check if the player has been linked his account and grant him role to access join the lobby voice channel
q!stats
- View your stats
q!leaders
- View the top players in the server