This repository has been archived by the owner on Oct 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
Install – Self Hosting
Patrix87 edited this page Jan 17, 2022
·
27 revisions
- Download source code from https://github.com/DiscordGSM/DiscordGSM/releases and extract it.
- Install Python dependencies: From the bot folder us the cmd:
pip install -r requirements.txt
- Install Node dependencies: From the bot folder us the cmd:
npm install -g gamedig
- Rename
servers_template.json
toservers.json
and configure it - Rename
dot_env
to.env
and configure it - Edit both files with your configurations, details about the config files are in this wiki.
- Run the bot with command
python bot.py
- Connect as root.
- Create a user called discordgsm and switch to that user:
adduser discordgsm
su discordgsm
- Install Python 3.10:
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get update
apt-get install python3.10
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
2.1 Select Python version 3.10:
update-alternatives --config python3
2.2 Confirm the version:
python3 -V
2.3 Install pip:
apt-get install python3-pip
- Install NodeJS 17:
sudo apt -y update && sudo apt -y upgrade
curl -sL https://deb.nodesource.com/setup_17.x | sudo bash -
sudo apt-get install -y nodejs
node -v
- Download source code from https://github.com/DiscordGSM/DiscordGSM/releases:
git clone https://github.com/DiscordGSM/DiscordGSM.git
- Install Python dependencies:
python3 -m pip install -r requirements.txt
- Install Node dependencies as root:
exit
npm install -g gamedig
su discordgsm
- Rename
servers_template.json
toservers.json
and configure it - Rename
dot_env
to.env
and configure it - Edit both files with your configurations, details about the config files are in this wiki.
- Run the bot with command
python bot.py
orpython3 bot.py
on linux. - 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
The bot will output it's invite link to the console on startup.
https://discord.com/api/oauth2/authorize?client_id={clientid}&permissions=93184&scope=bot
Wiki of DiscordGSM | Discord: https://discord.gg/Cg4Au9T