A script to help you sync an HelloAsso membership to a Discord server role.
- Python 3, tested against 3.9 and + only
- A Discord server
- A bot on that server, with permissions to add and remove roles to members
- An HelloAsso page
- A membership form on HelloAsso, with a custom field for a Discord username
- A persistent storage for the save file generated by the script
In a Python environment with the dependencies listed in requirements.txt
, and
configuration in a config.yml
file in the working directory, run python main.py
regularly.
Example:
python -m venv
.venv\bin\activate
pip install -r requirements.txt
python main.py
The following procedure can be orchestrated to run regularly, using something such as systemd Timers, a cron job, a CI pipeline, or the likes.
When you run the script, a save.json
file will be generated or updated. This
file most importantly tracks Discord IDs, so if a member change their Discord
username, it will still be properly tracked by the script. Aside from that, the
script should work fine without the ability to save, but it is not the
scenario it was designed for.
- Discord's API call to get the members of a Discord server returns chunks of 1000 users. Currently, no support for getting an higher members count than this is implemented in this script.
MIT.