A discord bot written in python used within a linux environment (game server control, server control)
Based on the excellent guide at https://realpython.com/how-to-make-a-discord-bot-python/
- Python 3.6+
- .env file with DISCORD_TOKEN="xyxyxy"
- Ubuntu 18.04+ as OS (or any Linux distro)
DISCORD_TOKEN="xyxyxy"
DISCORD_GUILD="ababab"
DISCORD_PREFIX="!"
Install dependencies with pip. On ubuntu do:
sudo apt install python3-pip
pip3 install -r requirements.txt
Use different prefixes if you run multiple bots in one guild/server. Register the bot's separately and use their tokens.
In order to start the bot while the system starts, copy as sudo the systemd file discordbot.service into /etc/systemd/system. Adjust the ExecStart and User. Afterwards run:
sudo systemctl enable discordbot
sudo systemctl start discordbot
or reboot instead of sytemctl start.