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.
- 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).
- Setup a python venv, source it and install the requirements
python3.9 -m venv venv source venv/bin/activate pip install -r requirements.txt
- 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.
- 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
- Setup a google API service account
- Create a gmail account if you don't already have one.
- Go to https://console.cloud.google.com/ and agree to terms of service.
- At the top of the screen, click
select a project
and then clickNEW PROJECT
and give the project a suitable name likeMODSBOT testing
. You don't need to add an organisation. - 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, clickAPIs and services
, and then clickENABLE APIS AND SERVICES
on the next page - 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".
- Now click the
Credentials
button on the left of the screen - Click
CREATE CREDENTIALS
and thenService account
. The only required details in the first section is the service addount ID which can be anything. - The other steps can be skipped.
- You should now be back on the Credentials page from earlier. Under the
Service Accounts
list, select the new entry. Then clickKEYS
at the top of the screen - Now click
ADDKEY
thenCreate new key
and selectJSON
for the key type. ClickCREATE
and then save the file intoconfig/credentials.json
in the directory where you cloned this repository. - All done for this section!
- You should now be able to run the bot with
python modsbot.py
(just make sure you've activated the venv).