Code Monkey home page Code Monkey logo

ib.py's Introduction

ib.py

IB.ai, but in Python

Running the bot

  1. Clone this repository:

By https:

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

By ssh:

git clone [email protected]:ib-ai/ib.py.git

Go into the cloned directory by entering:

cd ib.py

You are currently on the main branch, however you should be on the rewrite branch.

Switch to the rewrite branch:

git switch rewrite
  1. To run this project, you need to have Docker and Python 3.11 installed. Click on either of those links to get Docker or Python respectively.

  2. Install all requirements by creating a virtual environment and installing dependencies:

python -m venv venv
source venv/bin/activate

pip install -r requirements.txt
  1. Head to the Discord Developer portal and create a new bot application. Invite the new bot to the server by clicking the URL Generator tab under the OAuth2 tab. Paste this url into a web window and accept the bot's invite.

  2. Rename the config.example.json to config.json, and replace the relevant values. The token and application_id of your application can be found inside your Discord developer portal.

Here is an example of a config.json file (not including the token and application_id, since that is for your eyes only):

{
  "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. Open the docker application on your machine. Run the docker container in the ib.py directory with the following command:
docker-compose -f docker-compose.postgres.yml up --build
  1. Run the bot.py file in order to connect your bot to the server:
python bot.py

Contributing

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

ib.py's People

Contributors

nathanealv avatar ryan9771 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.