README.md in boty-0.1.2 vs README.md in boty-0.2.0

- old
+ new

@@ -1,7 +1,8 @@ # Boty [<img src="https://travis-ci.org/ricardovaleriano/boty.svg?branch=master" />](https://travis-ci.org/ricardovaleriano/boty) +[<img src="http://img.shields.io/badge/yard-docs-blue.svg" />](http://www.rubydoc.info/github/ricardovaleriano/boty) `Boty` is a utilitary to create bots (at this time, specificaly Slack bots). A bot in the context of this gem is an ordinary ruby application that knows how to connect and receive messages in a Slack company room. `Boty` will give you a @@ -289,11 +290,11 @@ Before we start to study the "script" way of configuring `command` and `listener` binds, let's see how we can use ruby regexps to capture message parameters. -##### Regexes - a pattern that allow capture parameters within a message<a name="regexes" /> +#### Regexes - a pattern that allow capture parameters within a message<a name="regexes" /> What is a bot if it can't annoy people when we want it to? So let's teach our bot to send private messages to people in the Slack room. Let's create an `im` _command_ that will be capable of extract the person to @@ -313,9 +314,32 @@ The regex matched portions will be passed as parameter to the block given to _command_. And this is it! :tada: + +##### Commands, Listenners and aliases + +Both *commands* and *listeners* can be aliased, which means that the same +`Action` can be triggered by different regexes: + +```ruby +command /hi/i, /hello/i do + say "Ohay #{user.name}! Hello there." +end +``` + + valeriano 12:04 PM + @jeeba: hi + + jeeba BOT 12:04 PM + Ohay valeriano! Hello there. + + valeriano 12:05 PM + @jeeba: hello + + jeeba BOT 12:05 PM + Ohay valeriano! Hello there. ### Adding custom scripts<a name="custom_scripts" /> Now you already know what are [listeners](#listeners) and [commands](#command). It's time to know another way to create those "binders",