Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Install – Self Hosting

Patrix87 edited this page Jan 19, 2022 · 27 revisions

Prerequisites

Setup Windows

  1. Download source code from https://github.com/DiscordGSM/DiscordGSM/releases and extract it.
  2. Install Python dependencies: From the bot folder us the cmd: pip install -r requirements.txt
  3. Install Node dependencies: From the bot folder us the cmd: npm install -g gamedig
  4. Rename servers_template.json to servers.json and configure it
  5. Rename dot_env to .env and configure it
  6. Edit both files with your configurations, details about the config files are in this wiki.
  7. Run the bot with command python bot.py

Setup Linux (Ubuntu 20.04 is recommended)

  1. Connect as root.
  2. Update Linux and cleanup previous node.
apt update -y && apt upgrade -y && apt dist-upgrade -y
apt remove --purge nodejs npm
apt clean
apt autoclean
apt install -f
apt autoremove
  1. Install Python3-Pip and NodeJS 17 and gamedig:
apt install software-properties-common -y
curl -sL https://deb.nodesource.com/setup_17.x | bash -
apt install -y nodejs
node -v
npm install gamedig -g
apt install python3-pip -y
  1. Create a user called discordgsm and switch to that user:
adduser discordgsm
su - discordgsm
  1. Download source code from https://github.com/DiscordGSM/DiscordGSM/releases:
git clone https://github.com/DiscordGSM/DiscordGSM.git
cd DiscordGSM
  1. Install Python dependencies:
python3 -m pip install -r requirements.txt
  1. Rename servers_template.json to servers.json and configure it
  2. Rename dot_env to .env and configure it
  3. Edit both files with your configurations, details about the config files are in this wiki.
  4. Run the bot with command python bot.py or python3 bot.py on linux to test it.

Type exit to logout of the discordgsm user session to return to root

  1. Create a service to run the bot automatically on boot and auto-restart it.
nano /etc/systemd/system/discordgsm.service

11.1 Paste the following content and save:

[Unit]
Description=DiscordGSM
After=network.service

[Service]
Type=simple
WorkingDirectory=/home/discordgsm/DiscordGSM
ExecStart=sh /home/discordgsm/DiscordGSM/bot.sh
User=discordgsm
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

11.2 Reload the service daemon:

systemctl daemon-reload

11.3 Enable your service:

systemctl enable discordgsm.service

11.4 Start your service:

systemctl start discordgsm.service

11.5 Check that it works:

systemctl status discordgsm.service

11.6 Monitor your service with:

journalctl -u discordgsm.service -f

Invite DiscordGSM to your server

The bot will output it's invite link to the console on manual startup.

https://discord.com/api/oauth2/authorize?client_id={clientid}&permissions=93184&scope=bot