Blog post -
Meet Flower, the Flowdock bot
Flowdock is also the group chat service of choice here at the R&D dept. To make it more fun and/or usable, we made this bot.
Flower, the Flowdock bot was written in Ruby, and made to be easy to extend with your own commands.
How do I use it?
- Sign up for Flowdock if you haven't already
- Create a new Flowdock user account for your Flower bot. Give it a nickname, for example "Bot", or "Steve".
- Download the source code from Github
- Copy and rename
config.yml.example
toconfig.yml
, and fill it with your settings rake run
- Mention your Bot in the chat to command it
Writing my own commands
You should write your own commands to make Flower fun and/or useful for your team.
This is easy. Simply create a class like this in lib/commands that inherits Flower::Command:
MyCommand.respond
will be invoked when a message prefix matches what you respond_to
. Arguments passed are:
- command - The matched command
- message - The entire message
- sender - A hash with sender user id/nick info:
{:id => 123, :nick => "Jonas"}
- flower - The Flower instance, that can
say
orpaste
something. Both methods can take the option{:mention => sender[:id]}
to highlight a message to that user in the chat.
A few commands can be found in our separate command repository at Github: https://github.com/mynewsdesk/Flower-Commands
The really fun and useful commands still remains to be written, but Flower provides us with a nice API.
So what do you think? What commands should be implemented next? Is anyone out there using Flowdock?
Categories
- flower
- flowdock