Skip to content

A python slack client that plays sounds in response to "play blah.mp3" messages

License

Notifications You must be signed in to change notification settings

juliusarden/slack-sounds

 
 

Repository files navigation

slack-sounds

A client for Slack.com, that plays sound files on request e.g. play trololo.

This is designed to run on a box in your office hooked up to speakers. That way everyone in your slack channel can enjoy its magic.

Overview

This plugin implements the python-slackclient to listen to channels its in (or direct messages) and responds to requests to play sounds of the format:

play filename

Installation

Automatic w/ PyPI

$ brew install python-dev
$ pip install websocket
$ pip install slackclient

If you want youtube player
$ brew install youtube-dl

You'll also need an audio player that can handle the format

$ player path/to/file.mp3
e.g.
$ mpg123 sounds/laugh.mp3

I recommend mpg123 because it 'just works' with mp3s. Alternatives are aplay, paplay, mplayer, etc.

$ brew install mpg123

Usage

Note: You must obtain a token for the user/bot. You can find or generate these at the Slack API page. You also need to create the bot for that matter.

Put the token in a file called token.txt in the same directory as sounds.py

Run the bot:

$ python sounds.py

Chat with the bot directly, or post in a channel its a member of:

play rollout

Note: The default sounds were lifted directly from here: http://www.emoji-cheat-sheet.com/ (thanks campfire!)

About

A python slack client that plays sounds in response to "play blah.mp3" messages

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.3%
  • Shell 2.7%