Discord bot written in python using discord.py library, used in a private server.
Docker hub link: here
Container can be run using provided docker-compose-template.yaml. Simply download this file into a machine or copy paste its content to a yaml file on machine. Change fields depending on template.
version: "3.9"
services:
Chi-chan:
image: seker212/discord_bot
environment:
# Set this a discord token generated on discord page
- TOKEN=0
volumes:
# Where audio files from .sound commands should be placed
- ./audio:/app/audio
# Where settings folder should be placed
- ./settings:/app/settings
# Where logs will be stored
- ./logs:/app/logs
Execute this command while in foler with docker-compose.yaml and the container should be up and running.
docker-compose up -d
- Pull image from docker hub
docker pull seker212/discord_bot
- Run the image using
docker run --rm -d -e "TOKEN=<discord app client secret here>" --name <name> seker212/discord_bot:latest
If neccesary docker container can be run with a folder sharded with operating system by to run command parameter
-v <os path>:/app/audio
docker build -t seker212/discord_bot:latest .
- Clone repository from github
git clone https://github.com/seker212/Discord_bot.git
- Create and run virtual enviroment
python3 -m venv env
#Linux version
source env/bin/activate
#Windows version
env\Scripts\activate
- Install neccesary packages
python -m pip install -r requirements.txt
To run your virtual enviroment must be enabled and folder settings/
should contain a file named token.txt
with the discord secret token. Also file settings.json
should be in the same folder with the values specified below.
{
"log_channel_id": <int: channel id on which logs will be printed>,
"timezone": <string: any valid timezone e.g "Europe/Warsaw">
}
To run after creating necessary files use this command
python start_bot.py
Token can be also a enviroment variable or passed directly in command
python start_bot.py <discord token here>