This repo hosts my moderation bot for the HASD zulip community as well as any other utility bot I create..
The code that I wrote (not the zulip app template files) can be found here
This video is a super easy way to see the bot in action; I highly recommend you just watch this.
03.07.2025_13.56.44_REC.mp4
If you insist and want to try it out yourself, please visit https://hasd.zulipchat.com/join/a6amkfo3hlv4cqqr3kvpl55w/ and create an account. Please don't mess anything up and stay in the bot chat topic under mod chat. Mention the bot with @**HASD** to get started.
And if, for whatever reason, you want to run the bot yourself on your own hardware, you will need your own zulip organization, and just follow the development steps below and throw the run-bot command as a background task.
-
Clone the Git repo:
git clone https://github.com/aamirazad/zulip-bot.git -
Make sure you edit the moderation.py's global variables to work with your org.
-
Run:
python3 ./tools/provisionMake sure you have pip.
This sets up a virtual Python environment in
zulip-api-py, where-venv;-venv is your default version of Python. If you would like to specify a different Python version, runnon> python3 ./tools/provision -pn> -
If that succeeds, it will end with printing the following command:
source zulip-api-py3-venv/bin/activateYou can run this command to enter the virtual environment. You'll want to run this in each new shell before running commands from
python-zulip-api. -
Once you've entered the virtualenv, you should see something like this on the terminal:
(zulip-api-py3-venv) user@pc ~/python-zulip-api $You should now be able to run any commands/tests/etc. in this virtual environment..
-
Run the bot
zulip-run-bot moderation --config-file ./zuliprc
Throw this in screen or make a systemd file to run the bot in the background.
All the features of the bot was written by hand. Although my code worked, it was a bit hard to read, so I had AI clean it up. No functionality was added, and the commit can be found here.