To be able to use this bot you need to do the following:
-
Create a new application in the Discord Developer Portal.
-
Create a bot for the application created previously. When doing so you need to make a note of the
Token
as this will be needed later. -
Use OAuth2 in the application with the
bot
scope. Copy the URL and paste it into your web browser. This will ask you to log the bot into a specific server. If the server isn't in the list then you will need to be granted permissions. -
Create a
.env
file based on .env.example.cp .env.example .env
-
In the
.env
file you should set a value ofBOT_TOKEN
to theToken
which you received when you created the bot in the Discord Developer Portal. -
Run the bot, this can be done in one of 2 ways:
This assumes that you have Docker already installed on your machine.
Build and run the Docker container in detached mode.
docker build -t discord-bot .
docker run -it --rm -d --name discord-bot discord-bot
If you want to stop the Docker container.
docker stop discord-bot
You can run the bot natively. This requires you to have Python 3 and Pip installed on your machine:
sudo apt install python3 python3-pip
Install the Python dependencies.
pip install -r requirements.txt
Then execute the Python script.
python3 bot.py