README.md in lita-2.6.0 vs README.md in lita-2.7.0
- old
+ new
@@ -80,10 +80,11 @@
``` ruby
Lita.configure do |config|
config.robot.name = "Sir Bottington"
config.robot.mention_name = "bottington"
+ config.robot.alias = "/"
config.robot.adapter = :example_chat_service
config.adapter.username = "bottington"
config.adapter.password = "secret"
config.redis.host = "redis.example.com"
config.handlers.karma.cooldown = 300
@@ -94,10 +95,11 @@
The main config objects are:
* `robot` - General settings for Lita.
* `name` (String) - The display name the bot will use on the chat service. Default: `"Lita"`.
* `mention_name` (String) - The name the bot will look for in messages to determine if the message is being addressed to it. Usually this is the same as the display name, but in some cases it may not be. For example, in HipChat, display names are required to be a first and last name, such as "Lita Bot", whereas the mention system would use a name like "LitaBot". Default: `Lita.config.robot.name`.
+ * `alias` (String) - The alias the bot will look for in messages to determine if the message is being addressed to it. Useful if you want to use something shorter than the robot's name or mention name, such as a slash, to send it a command. No default.
* `adapter` (Symbol, String) - The adapter to load. Default: `:shell`.
* `log_level` (Symbol, String) - The severity level of log messages to output. Valid options are, in order of severity: `:debug`, `:info`, `:warn`, `:error`, and `:fatal`. For whichever level you choose, log messages of that severity and greater will be output. Default: `:info`.
* `admins` (Array<String>) - An array of string user IDs which tell Lita which users are considered administrators. Only these users will have access to Lita's `auth` command. Default: `nil`.
* `redis` - Options for the Redis connection. See the [Redis gem](https://github.com/redis/redis-rb) documentation.
* `http` - Settings related to Lita's built-in web server.
@@ -143,11 +145,11 @@
To generate a starting template for a new adapter gem, run `lita adapter NAME`, where NAME is the name of the new gem.
### Example
-Here is a bare bones example of an adapter for the fictious chat service, FancyChat.
+Here is a bare bones example of an adapter for the fictitious chat service, FancyChat.
``` ruby
module Lita
module Adapters
class FancyChat < Adapter
@@ -203,10 +205,10 @@
* `:help` (Hash<String>) - A map of example invocations of the route and descriptions of what they do. These values will be used to generate the listing for the built-in "help" handler. The robot's mention name will automatically be added to the front of the example if the route is a command. Default: `{}`.
Here is an example of a route declaration with all the options:
``` ruby
-route /^echo\s+(.+)/, to: :echo, command: true, restrict_to: [:testers, :committers], help => {
+route /^echo\s+(.+)/, :echo, command: true, restrict_to: [:testers, :committers], help => {
"echo FOO" => "Replies back with FOO."
}
```
Each method that is called by a route takes one argument, a `Lita::Response` object. This object has the following useful methods: