A self reporting bot for the movement model
/report
- creates a private message to the user with a link the reporting form/join
- Join a guild where this command is run/update
- Update a profile for a given community/add_onboarding_contributions
- Ask user whether they have completed the initial contributions
- Clone this repository
- Create a virtual environment (
python3.9 -m venv ./.venv
) - Activate the virtual environment (
source ./.venv/bin/activate
) - Install dependencies via pip (
pip install -r requirements-dev.txt
) - Setup environment variables as required in ./.env (see env.sample) for the values which need populating
- In a separate directory, clone the Govrn monorepo, and follow the the setup instructions there.
Requires the following VS Code extensions to be installed:
- Docker
- Remote – Containers
- click
Open a Remote Window
button in lower left corner - click
Reopen in Container
- click
From Dockerfile
- Open
Run and Debug
- Select
Python:Bot
and click Run Button - Stop when done testing bot
- Open
Testing
- Click the Run or Debug Button
- In the lower left, select
Reopen Folder Locally
- Open Folder w/o Dev Container and check in code
- Install redis server + redis-cli
- Run
sudo service redis-server start
- Run
redis-cli
- In the cli, run
monitor
- In your .env file, set the redis url to your local instance
REDIS_URL=redis://localhost
- Create a new folder
- add a
bot
folder with these files:- init.py
- main.py
- commands.py
Docker: Add Docker files to Workspace
- Application Platform:
Python: General
- App's Entry Point:
bot/__main__.py
- Include optional Docker Compose files:
no
- Application Platform:
Remote-Containers: Open Folder in Container
- select parent folder and click Open
From Dockerfile
- Add extensions to Dev Container for development
Python
- Open Terminal and run the following in the Dev Container
python bot/__main__.py
ctrl
-c
to stop bot
Run and Debug
Add Configuration...
Python
Python File
- Set
name
toPython: Bot
- Set
program
tobot/
MIT © Govrn