A discord bot that adds interactive commands and economy to a server.
As the admin of a server, you can create, stop, end customized polls that users can bet.
Create an achievement store with roles that users can buy with earned points.
Docker
python 3.9.4
oranaconda
- Create a file called
.env
in the root directory. - Add the following key value pairs:
DISCORD_TOKEN={discord_token}
. The discord token created in the discord dev portal.DISCORD_GUILD={discord_guild}
. The discord guild name.DB_USERNAME={db_username}
. The username to create when the db instance gets created.DB_PASSWORD={db_password}
. The password to create when the db instance gets created.DB_HOST={db_host}
. The db host, ideally 127.0.0.1 or localhost since it will be running in the same instance as the bot.DB_PORT={db_port}
. The db port, ideally 27017 since it is MongoDB's default port.
If anaconda
is installed:
- Run
conda env create -f environment.yml
in the root directory. This will install the required libraries and set up the environment. - Run
source activate poynt
to activate the virtual environment.
If python 3.9.4
is installed:
NOTE: python
command can be python3
or python3.9
depending on machine.
- Run
python -m pip install virtualenv
to install virtualenv library. - Run
python -m venv {env_name}
where{env_name}
is the name of the environment. - Run
source activate {env_name}/bin/activate
to activate the virtual environment. - Run
pip -r install requirements.txt
to install the required libraries.
- Run
docker-compose build
to download an image of MongoDB and setup the settings. - Run
mkdir db
or create a directory calleddb
so the docker container can hook it as a volume. This will be the directory where the db stores the files.
After following through the setup part, run the following:
- Run
docker-compose up -d
to start the container containing the MongoDB instance. - Run
python bot.py
to start the discord bot. - Once the following is running, the following message should appear to the console:
{discord_guild} has connected to Discord!
- Now add the discord bot application to a server, using the authorization url.
- Type
$help
to learn about the commands and play with the bot.