Skip to content

Latest commit

 

History

History
executable file
·
81 lines (54 loc) · 2.07 KB

README.md

File metadata and controls

executable file
·
81 lines (54 loc) · 2.07 KB

ib.py

IB.ai, but in Python

Running the bot

To run this project, you need to have Docker and Python >=3.11 installed.

  1. Clone this repository
git clone https://github.com/ib-ai/ib.py.git

and navigate to the root directory.

cd ib.py
  1. Copy the config.example.json, rename to config.json, and replace the relevant values. The token and application_id of your application can be found inside your Discord developer portal. Example config.json:
{
  "token": "a long string of random characters",
  "prefix": "&",
  "description": "Discord bot for the r/IBO server. Join here: discord.gg/ibo",
  "application_id": 18-19 digit number, 
  "db_host": "localhost",
  "db_user": "postgres",
  "db_name": "postgres",
  "db_password": "password"
}

If you want to inject the config at runtime using environment variables, you need not replace the values in config.json.

  1. Run the docker container.
docker-compose -f docker-compose.postgres.yml up --build

Contributing

Please read the CONTRIBUTING.md file to find out more about contributing towards the project.

Development

We use PDM to manage dependencies for this project and Ruff to handle linting and code formatting.

1. Clone this repository

git clone https://github.com/ib-ai/ib.py.git

and navigate to the root directory.

cd ib.py

3. Create virtual environment and install dependencies

(requires either virtualenv, venv, or conda to be installed)

pdm install

4. Using the virtual environment

Either activate virtual environment if you are running commands in the terminal

Or

Choose .venv\Scripts\python.exe as the interpreter in your IDE.