A lightweight python discord-bot for automatic assignment and updating of roles based on donations from DonationAlerts in real time. Say no to patreon/boosty!
pylerts listens to the donation stream from your DonationAlerts account via WebSocket connection. As soon as a donation is received, the bot searches for the sender on your Discord server and applies the role assignment rules defined in the configuration file.
- Real-time! Connection via the official WebSocket widget from DonationAlerts ensures instant reaction.
- Flexible rule system! Ability to bind role assignment to donation amount and currency.
- Multiple role support! One rule can give a user multiple Discord roles at once.
- Tier system! Automatic removal of old roles when a user reaches a higher level (e.g., replacing tier 1 with tier 2 on a large donation).
Here are the planned features for the upcoming releases of pylerts:
- Cumulative Donation System (CDS)
- Add a lightweight SQLite database to track and sum up donations over time, allowing users to unlock roles progressively
- Discord embeds and public logs
- Send beautiful public thank-you cards to a dedicated channel and set up admin logs to track role grant events
- Dockerization
- Provide a
Dockerfileanddocker-compose.ymlto enable one-command deployment on any Linux VPS/server
- Provide a
- Python 3.11 or higher (uses the built-in
tomlliblibrary for reading configuration). - Discord bot token with Server Members Intent enabled in the Discord developer panel.
- DonationAlerts widget token (You can find it here.).
- Optional: make a directory for pylerts.
mkdir pylerts
cd pylerts- Clone the repository.
git clone https://github.com/zito1337/pylerts.git- After cloning, navigate to the
pylertsdirectory.
cd pylerts- Install the required dependencies manually or use the provided
requirements.txtfile.
pip install -r requirements.txt- Run the bot and wait until it initializes!
python -m src.pylerts_main- same shit as windows...
- Optional: make a directory for pylerts.
mkdir pylerts
cd pylerts- Clone the repository.
git clone https://github.com/zito1337/pylerts.git- After cloning, navigate to the
pylertsdirectory.
cd pylerts- Since Arch Linux blocks global
pipinstallations, set up and activate a Python virtual environment:
python -m venv venv
source venv/bin/activate- Install the required dependencies inside the virtual environment using the provided
requirements.txtfile.
pip install -r requirements.txt- Run the bot and wait until it initializes!
python -m src.pylerts_main- System packages: Git, Python, and Pip (
git,python3,py3-pip). Install them on Alpine via:apk add git python3 py3-pip
- aaand... pretty same shit as windows
- Optional: make a directory for pylerts.
mkdir pylerts
cd pylerts- Clone the repository.
git clone https://github.com/zito1337/pylerts.git- After cloning, navigate to the
pylertsdirectory.
cd pylerts- Since Alpine Linux (from v3.19+) blocks global
pipinstallations, set up and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate- Install the required dependencies inside the virtual environment using the provided
requirements.txtfile.
pip install -r requirements.txt- Run the bot and wait until it initializes!
python3 -m src.pylerts_main- System packages: Git, Python 3.11, and Pip (
git,python3,py311-pip). Install them on FreeBSD via:orsudo pkg install git python3 py311-pip
su - pkg install git python3 py311-pip
- same shit as windows again...
- Optional: make a directory for pylerts.
mkdir pylerts
cd pylerts- Clone the repository.
git clone https://github.com/zito1337/pylerts.git- After cloning, navigate to the
pylertsdirectory.
cd pylerts- To avoid conflicts with system packages managed by
pkg, set up and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate- Install the required dependencies inside the virtual environment using the provided
requirements.txtfile.
pip install -r requirements.txt- Run the bot and wait until it initializes!
python3 -m src.pylerts_main
