So... install python3 if you haven't. 🙃
So... Run:
pip3 install -r requirements.txtHow to do that is described here: writebots.com. It's the most important page: Discord Developer Panel.
The generated token save in token.txt file in the root directory (next to main.py).
For example by:
python3 main.pyIt's also described here: writebots.com.
To get the help message send by discord:
.help
or
.help <name of command>
(. is the default bot prefix)
Good luck!
.test :regional_indicator_a: :regional_indicator_b: :regional_indicator_c: :regional_indicator_d: :regional_indicator_e: :regional_indicator_f:
One of the way to run bot in the background of the OS. (It's written by Ubuntu 20.04 user.)
- Clone the repo in to
/vardirectory. - Create
wwwuser with correct permissions to read and execute existing files and create files infilesandconfigdirectories. - Create a service config file
/etc/systemd/system/discordbot.service, with that content:
[Unit]
Description=Discord BOT service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=www
WorkingDirectory=/var/Collector_bot
ExecStart=python3 /var/Collector_bot/main.py
SyslogIdentifier=DiscorBOT
[Install]
WantedBy=multi-user.target
- Run commands:
sudo systemctl enable discordbot.service
sudo systemctl start discordbot.service
sudo systemctl status discordbot.service- And if you want to stop the bot:
sudo systemctl stop discordbot.service