Skip to content

Mathematical-Olympiads-Discord-Server/modsbot-rewrite

Repository files navigation

Getting Started

The following are some instructions to help setting up a local version of modsbot. The instructions are made for linux (but should nevertheless be useful for other operating systems) and some of the commands may have errors which you may need to try googling.

  1. Clone this repository and enter the directory. Ideally you should use python3.9 (python3.11 definitely doesn't work but I don't know exactly which versions work).
  2. Setup a python venv, source it and install the requirements
    python3.9 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  3. Create a discord bot and keep the token safe, or just regenerate it in the next step. Follow this guide if you are unsure how to create a discord bot. You should also create a server for the bot and add it to it.
  4. Make sure the venv is activated and that the current directory is the root directory of the cloned repository. Then, run the setup script:
    python setup_modsbot.py
  5. Setup a google API service account
    1. Create a gmail account if you don't already have one.
    2. Go to https://console.cloud.google.com/ and agree to terms of service.
    3. At the top of the screen, click select a project and then click NEW PROJECT and give the project a suitable name like MODSBOT testing. You don't need to add an organisation. image of google cloud console website
    4. After waiting a few seconds, you should be able to click select a project at the top of the screen and then select the project we just created. Under Quick access, click APIs and services, and then click ENABLE APIS AND SERVICES on the next page image of google cloud console website image of google cloud console website
    5. In the search box, search for "drive" and hit enter. Select "Google Drive API" and then enable it. Repeat this also for the "Google Sheets API". image of google cloud console website
    6. Now click the Credentials button on the left of the screen image of google cloud console website
    7. Click CREATE CREDENTIALS and then Service account. The only required details in the first section is the service addount ID which can be anything. image of google cloud console website
    8. The other steps can be skipped. image of google cloud console website
    9. You should now be back on the Credentials page from earlier. Under the Service Accounts list, select the new entry. Then click KEYS at the top of the screen image of google cloud console website
    10. Now click ADDKEY then Create new key and select JSON for the key type. Click CREATE and then save the file into config/credentials.json in the directory where you cloned this repository. image of google cloud console website
    11. All done for this section!
  6. You should now be able to run the bot with python modsbot.py (just make sure you've activated the venv).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages