Mrox is a Slack bot that watches [Prox2 / Owl] confession activity and DMs the submitter when their confession's status changes (approved, approved for meta, denied, or unapproved).
Currently implemented in test.ts (the actively-developed version).
/mrox {id}— start tracking a confession by its numeric ID (or/mrox untrack {id}). Only the configured user can call it while the test guard is on.- App Home box — paste/type a confession ID and press Enter, no command needed. Tracked confessions are listed with Untrack buttons.
- Watches the confession logs channel for status updates like
Confession #40289 was approved. - DMs the submitter with the result:
- Approved → link to the post in
#confessions - Approved for meta → link in
#meta - Denied → includes the reason pulled from the log thread
- Unapproved → thread-nuked notice
- Approved → link to the post in
- Marks confessions resolved and purges them 2 days later.
- Easter egg for impossible states (a status update on an already-resolved confession).
-
Create the Slack app from
app_manifest.yaml(api.slack.com → Create New App → From manifest). -
Add tokens to
.env(see.env.example):SLACK_BOT_TOKEN(xoxb-*) — Bot User OAuth TokenSLACK_APP_TOKEN(xapp-*) — App-Level Token withconnections:write
-
Invite the bot to
#confessions,#meta, and the confession logs channel. -
Install the app, then run:
npm start
All channel IDs and toggles have sensible defaults in test.ts and can be
overridden with env vars (see .env.example):
| Variable | Default | Purpose |
|---|---|---|
CHANNEL_CONFESSIONS |
CNMU9L92Q |
#confessions |
CHANNEL_CONFESSION_LOGS |
C08R8LE6DDG |
logs / status channel |
CHANNEL_META |
C0188CY57PZ |
#meta |
OWL_BOT_ID |
B0C6JPG4W0G |
Prox2/Owl bot id |
WORKSPACE_DOMAIN |
hackclub.enterprise.slack.com |
permalink building |
RESTRICT_TO_USER |
true |
only ALLOWED_USER_ID may use /mrox |
ALLOWED_USER_ID |
U09KKMHLS15 |
the allowed user |
VERIFY_ID_IN_STATUS |
false |
require status to reference the id |
DEBUG |
false |
verbose logging |
To test without touching the real flow, override the CHANNEL_* variables to
point at throwaway channels.
confessions.json— tracked confessions (id,userId,resolved,date,postTs,status). Writes are atomic.
- Mrox cannot read other users' DMs with Prox2; Slack does not allow bots to
read DMs they aren't part of. Track via
/mrox {id}or the App Home box. - The bot only acts on status messages from the Owl bot (
OWL_BOT_ID) in the logs channel. - The bot needs
channels:historyand to be a member of the channels it scans.
rust/ is a port of test.ts (behaviour and file formats are listed in rust/PARITY.md). It reads and writes the
same confessions.json, config.yaml and .env, so either bot can take over from the other.
Run one bot at a time. Two Socket Mode connections split the events between them, so one bot would miss half of
them. The Rust unit is deploy/mrox-rust.service; it runs rust/target/release/mrox with the same user, working
directory and env file as mrox.service.
-
Build on the server (as
gaypeople;cargomust be on the PATH, or in~/.cargo/bin):cd ~/code/mrox/rust && cargo build --release
deploy/update.shdoes this itself wheneverrust/changes in a pull. -
Set
ALLOWED_USER_IDin.env. The Rust port has no built-in default: unset,/mroxrefuses everyone (the TypeScript default is not copied into the code).RESTRICT_TO_USER=falseopens it to everyone, as before. -
Install the unit and allow the update script to restart it:
sudo cp deploy/mrox-rust.service /etc/systemd/system/ && sudo systemctl daemon-reload echo 'gaypeople ALL=(root) NOPASSWD: /usr/bin/systemctl restart mrox-rust' | sudo tee -a /etc/sudoers.d/mrox
-
Switch over (stop the TypeScript bot first, then start the Rust one):
sudo systemctl stop mrox && sudo systemctl disable mrox sudo systemctl enable --now mrox-rust journalctl -u mrox-rust -f # expect "(test.ts) Bot is running..."
deploy/update.sh restarts mrox-rust while it is active, and mrox otherwise, so the daily update keeps working
on either side of the switch.
Rollback (state is in the shared files, so nothing is lost; pending rejections are stored in
confessions.json and resume on start):
sudo systemctl stop mrox-rust
sudo systemctl enable --now mrox