Skip to content

zacleids/discord-bot-py

Repository files navigation

discord-bot-py

Running discord-bot and/or web backend

In order to run the discord bot or web backend, you need a .env file with the DISCORD_TOKEN filled out. You can copy the .env.example file to .env and add your bot token that has access to a discord server of your choice.

Once the DISCORD_TOKEN has been added, you can run the bot, web backend, or both:

  • To run the Discord bot only:
    python run.py --bot
  • To run the Flask web backend only:
    python run.py --web
  • To run both the Discord bot and web backend together:
    python run.py --bot --web

Development Setup

This project uses pre-commit hooks for formatting and linting. To set up:

pip install pre-commit
pre-commit install

This will automatically run checks before you commit. You can run all hooks manually with:

pre-commit run --all-files

Testing

To run the test suite:

ENV=TEST pytest

Linting & Code Style

To check code style and linting manually, run:

flake8 .
black --check .
isort --check-only .
  • flake8 checks for general linting issues. (flake8)
  • black --check checks code formatting (auto-format with black .). (black)
  • isort --check-only checks import order (auto-fix with isort .). (isort)

Links used:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages