Code Monkey home page Code Monkey logo

porobot's Introduction

web:

  1. cd web
  2. run yarn start

Running:

  1. Ping stanley for env variables;
  2. Create .env file on root directory with following:
RIOT_API_KEY={APIKEY}
DISCORD_TOKEN={TOKEN}
  1. Install required pip library: pip3 install -r requirements.txt
  2. Run npx nodemon --exec python3 bot.py
  3. IF ^ fails, python3 bot-main.py
  4. We use black as auto formatter.
  • Install black; pip3 install black
  • Set Python โ€บ Formatting: Provider in vscode setting to be black.
  • If you have prettier setup, you have to override it:
    • Open language specific setting in vscode for python(CMD + SHIFT + P)
    • Add this line in
    [python]:{
       ...
        "editor.defaultFormatter": "ms-python.python"
    }
    
  • This will set up auto formatting upon saving a file.
  1. To disable pylint on pre-push and enable on pre-commit, please run following command:
pre-commit uninstall --hook-type pre-push
pre-commit install --hook-type pre-commit

After above command, if .git/hooks/pre-commit file has been created, then your pre-commit should work as expected.

  1. To call the bot with the desired prefix locally,
  • Add LOCAL_BOT_PREFIX= "" to .env with desired prefix between the double quotes
  1. Install Postgresql server 9.6.2 or up brew install postgresql and start it brew services start postgresql Initialize development and test databases as described below: Use following command to bootstrap dev databases
$ psql postgres
postgres=# CREATE USER admin_bot WITH SUPERUSER PASSWORD 'test';
postgres=# CREATE DATABASE bot_dev OWNER admin_bot;
  1. DB Migration and setup: Base ORM and DB engine; SQLAlchemy and psycopg2
  • Install both SQLAlchemy, psycopg2 if you haven't from step 3.

  • Add DB_URL='postgresql://admin_bot:test@localhost/bot_dev' into .env file

  • Migrations

    • Uses https://alembic.sqlalchemy.org/

    • Install alembic if not installed yet from step 3
      pip3 install alembic

    • For first time, after install, run
      alembic upgrade head

    • To genearte new migration;
      alembic revision -m "create account table"
      This will create new migration file under /alembic/versions. Fill in the file.

    • To apply migration;
      alembic upgrade head

    • Make sure you update the models reference in db/models/ to represent newly added schema

    • To revert one migration;
      alembic downgrade -1

    • To revert all migration;
      alembic downgrade base

Packages:

Pydash https://pydash.readthedocs.io/en/latest/index.html

riotwatcher https://riot-watcher.readthedocs.io/en/latest/

porobot's People

Contributors

dhmoon91 avatar jung1411 avatar jjaykim avatar hellofive avatar smoondh avatar

Watchers

James Cloos avatar  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.