/mochamatch

Mocha Match Discord Matcher Bot

Primary LanguagePython

Mocha Match has been shutdown due to inactivity, feel free to borrow the code for your own use.

Mocha Match

Setup

  • install python 3.8.10 and poetry from https://python-poetry.org/docs/
  • run "poetry install"
  • add file "testdb.json" to data folder
  • create a .env file and add DISCORD_TOKEN, APPLICATION_ID, TEST_GUILD_ID, POSTHOG_API_KEY, and DB_LOCATION (i.e. data/testdb.json)
  • run "poetry run python main.py" to start

Testing

  • run "poetry run python -m pytest tests/"
    • add "-rP" to command to see print messages

Links

Permissions Needed

  • scopes: bot, application.commands
  • bot permissions: Read Messages/View Channels, Send Messages, Read Message History, Add Reactions, Use Slash Commands

Other

  • To install the discord package in poetry, run "poetry add git+https://github.com/Rapptz/discord.py"
  • To check DB on Render, "cd data" then "jq . db.json"
  • If on Mac and server doesn't run, change "app.run_task" address to "127.0.0.1"