Skip to content

Development

Ignacio Cuellar Tapia edited this page Oct 24, 2021 · 7 revisions

Requeriments

  • Python: To run the project.
  • Mysql: To store persistent data.

File composition

Main files

  • bot.py: Core and Discord commands.
  • model.py: Mysql model by SQLAlchemy.
  • osu.py: Osu api communication.
  • utils.py: Utils methods for everything.
  • .env: Environment variables.

Not that important

Setup

Setup database:

  1. Install MySql
  2. Create a New User with ALL PRIVILEGES.
  3. Create database
    • mysql -u [username] -p
    • CREATE DATABASE MultiOff;
    • USE MultiOff;
    • Use multioff.sql commands

Setup Discord bot:

  1. Creating a Bot Account
  2. Copy your TOKEN for .env
  3. Inviting Your Bot with Administrator permission.

Setup OSU permissions:

  1. Register an OAuth application on your account settings page.
  2. Copy your ID client and SECRET for .env

Setup Environment Variables (.env):

1.- Create a .env file at Root Directory

DISCORD_TOKEN=...
db_host=localhost
db_user=...
db_password=...
db_database=multioff
osu_id=...
osu_secret=...
DEBUG=True
delta_time=-3

Done :)