-
Create a bot with the Discord Developer Portal (https://docs.pycord.dev/en/master/discord.html)
1a. Make sure the bot is able to timeout other users and setup commands
-
Create a file called
config.json
and add the following:
{
"token" : "TOKEN HERE"
}
- In main.py, edit these globa variables to your liking:
MCPREP_GUILD_ID = 737871405349339232 # Server ID
IDLE_MINER_CHANNEL_ID = 746745594458144809 # Channel you want to exclude
STAFF_CHAT_ID = 741151005688987769 # Channel you want to send reports to
Now you must choose between 2 routes
- If you have Docker installed, just run the following:
docker build -t mcprep-helpful-horse-docker .
docker run -d --restart unless-stopped --name mcprep-helpful-horse mcprep-helpful-horse-docker
- Install Pycord:
# NOTE: Python 3.8 and above is needed
# Mac and linux
python3 -m pip install -U py-cord
# Windows
py -3 -m pip install -U py-cord
- Run main.py:
python3 main.py
6 (OPTIONAL). Using systemd to run the bot (Requires a Linux distro with systemd as the init system):
Run:
sudo nano /etc/systemd/system/mcprep-helpful-horse.service
And add these contents:
[Unit]
Description=MCprep_Helpful_Horse
After=network-online.target
[Service]
Type=simple
WorkingDirectory=DIRECTORY_WITH_MAIN_PY
ExecStart=PATH_TO_PYTHON PATH_TO_MAIN_PY
Restart=on-failure
User=USER_TO_EXECUTE_SERVICE_FILE_ON
RestartSec=10s
[Install]
WantedBy=multi-user.target
Then you can run these commands:
sudo systemctl daemon-reload
sudo systemctl enable mcprep-helpful-horse.service # Makes the service file start on boot
sudo systemctl start mcprep-helpful-horse.service # starts service file
sudo systemctl status mcprep-helpful-horse.service # shows the status of the service file