A Slack bot which plays sounds from the filesystem upon certain triggers. Install and configure it on a RaspberryPi, connect some speakers and have fun.
python ^3.6
- Install the package:
$ pip install --user --upgrade audio-slackbot
- Set up the Slack bot:
- Create a new Slack bot in your workspace settings
- Export the API token to your environment:
$ export SLACK_API_TOKEN="xoxb-2349..."
- Invite the bot to some Slack channels in your workspace
- Create a configuration file:
# sounds.yaml
---
triggers:
- word: "trololol"
sound: "/home/pi/sounds/trololol.wav"
- Start the bot:
$ audio_slackbot --config /home/pi/sounds.yaml
Now, when any message in any channel the bot is present contains "trololol" it will try to play the sound file "/home/pi/sounds/trololol.wav".
On macOS you need to install PyObjC
and AppKit
as well:
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig"
pip install --user PyObjC AppKit