A Slack bot for anonymously reporting broken machines and tools at Stockholm Makerspace. Users scan a QR code, fill in a report, and the bot posts it anonymously to the relevant room channel. Two-way anonymous communication is supported via thread replies.
- User scans a QR code → opens the bot's DM in Slack
- Bot immediately prompts the user with a "Report broken equipment" button (via the
app_home_openedevent) - User clicks the button → a modal opens with:
- A dropdown to select which room the broken thing is in
- A text field to describe the problem
- An optional image upload (up to 3 files)
- Bot posts the report anonymously to the selected room's Slack channel (with an "Image in thread 🧵" note if images were attached)
- Thread replies are relayed: anyone replying in the public thread gets their message forwarded privately to the anonymous reporter (with a mention so they get notified)
- Reporter can reply back in their DM thread, and the bot relays it anonymously to the public thread
- Go to api.slack.com/apps → Create New App → From scratch
- Name it something like
Broken Equipment Bot
Under OAuth & Permissions → Bot Token Scopes, add:
chat:write— post and delete messageschannels:join— auto-join configured channelschannels:read— list workspace channels (for setup wizard)channels:history— receive public channel messagesgroups:history— receive private channel messagesim:history— read DM messagesim:write— send DMsfiles:read— read uploaded filesfiles:write— upload files to channelsusers:read— get user display names for relay
- Go to Settings → Socket Mode → toggle Enable Socket Mode
- Create an App-Level Token with scope
connections:write— save this asSLACK_APP_TOKEN
Under Event Subscriptions → Subscribe to bot events, add:
app_home_opened— triggers the report prompt when a user opens the botmessage.im— DM messagesmessage.channels— public channel messages (for thread replies)message.groups— private channel messages (for thread replies)app_mention— mentions of the bot
- Under Interactivity & Shortcuts, toggle Interactivity on (Socket Mode handles the URL automatically)
- Under App Home → Show Tabs, enable the Messages Tab and check "Allow users to send Slash commands and messages from the messages tab"
- Go to Install App → Install to Workspace
- Copy the Bot User OAuth Token (
xoxb-...) — save asSLACK_BOT_TOKEN
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtcp .env.example .envrcEdit .envrc with your Slack tokens.
Run the interactive setup wizard to select which Slack channels map to rooms:
python3 setup.pyThe wizard connects to your workspace, lists all channels, and lets you pick which ones to use. Room configuration is saved to rooms.yaml. You can re-run it anytime to add or remove rooms.
Or edit rooms.yaml directly:
rooms:
- name: "Electronics Room"
channel_id: "C017ZQEHK7Z"
- name: "Woodworking Room"
channel_id: "C0123456789"Note
You have to restart the bot after changing the rooms.yaml file.
python3 app.py- Collect feedback/ideas
- Store the collection of all reported things
- Let people view and vote on what they think is important