Manipal-OSF / bot

A community discord bot, used in the OSF server.
MIT License
5 stars 4 forks source link
discord disnake python

OSF Bot

A community bot, used in the Manipal OSF server.


Contribute

If you want to contribute, report a problem, add or suggest a new fix or feature, you can open a new issue. The issue should be accepted and discussed before starting to work on the feature. See Dev Installation to know how to start working on said feature.


Discord Setup

To get a token, go to Discord Developer Portal. Create an application and add a bot.

Dev Installation

  1. Clone the repository:
    • Traditional way: https://github.com/Manipal-OSF/OSF-bot.git or git@github.com:Manipal-OSF/OSF-bot.git.

Then navigate to the directory cd OSF-bot/

  1. Create a new branch by git checkout -b <name of new local branch> main or git switch -c <name of new local branch> main. Make sure the new branch name is related to the feature or the fix you have in mind.

  2. Create a .env file with following contents:

    BOT_TOKEN = <Your token> # See Discord Setup above
  3. Install poetry: pip install -U poetry and run the following:

    # This will install the development and project dependencies.
    poetry install
    
    # This will install the pre-commit hooks.
    poetry run task precommit
    
    # Optionally: run pre-commit hooks to initialize them.
    # You can start working on the feature after this.
    poetry run task lint
    
    # Run the bot
    poetry run task bot
    
  4. Lint and format your code properly using poetry run task lint, and push changes git push -u origin <name of new remote branch>

Commands to Remember

poetry run task precommit - Installs the pre-commit git hook

poetry run task format - Formats the project with black

poetry run task lint- Runs pre-commit across the project, formatting and linting files.

poetry run task bot - Runs the discord bot.