Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lita-tox/README.md

81 lines
2.5 KiB
Markdown
Raw Normal View History

2015-07-25 03:34:17 -04:00
Lita::Adapters::Tox
===================
[![Gem Version](https://badge.fury.io/rb/lita-tox.svg)](http://badge.fury.io/rb/lita-tox)
[![Build Status](https://travis-ci.org/braiden-vasco/lita-tox.svg)](https://travis-ci.org/braiden-vasco/lita-tox)
[![Coverage Status](https://coveralls.io/repos/braiden-vasco/lita-tox/badge.svg)](https://coveralls.io/r/braiden-vasco/lita-tox)
2015-09-13 16:12:41 -04:00
[Tox](https://tox.chat) adapter for the [Lita](http://lita.io) chat bot.
2015-09-13 16:18:55 -04:00
**WARNING**
Still in development. Read the README carefully.
2015-09-13 16:12:41 -04:00
TODO
----
Current development version have some limitations
which should be fixed in first release:
2015-09-13 17:52:27 -04:00
* [\[issue #16\]](https://github.com/braiden-vasco/lita-tox/issues/16)
**libtoxcore** is not included in the gem. It should be compiled manually
2015-09-13 17:55:03 -04:00
to build the gem native extension successfully. Follow the instructions in
[that file](https://github.com/irungentoo/toxcore/blob/2ab3b14731061cc04d3ccc50a35093c11d018298/INSTALL.md)
2015-09-13 16:12:41 -04:00
2015-09-13 17:52:27 -04:00
* [\[issue #17\]](https://github.com/braiden-vasco/lita-tox/issues/17)
JRuby is not supported. Only C extension for Tox is implemented
2015-09-13 16:12:41 -04:00
2015-09-13 17:52:27 -04:00
* [\[issue #18\]](https://github.com/braiden-vasco/lita-tox/issues/18)
Message length is limited to value of `TOX_MAX_MESSAGE_LENGTH`
2015-09-13 16:12:41 -04:00
(see [source code of **libtoxcore**](https://github.com/irungentoo/toxcore/blob/2ab3b14731061cc04d3ccc50a35093c11d018298/toxcore/tox.h#L252-L255))
* Adapter has incomplete API for Lita. Only basic methods are implemented
2015-09-13 16:29:40 -04:00
Usage
-----
At first, see the documentation for Lita: http://docs.lita.io/
### Installation
**libtoxcore** should be compiled manually at your computer or server.
2015-09-13 17:55:03 -04:00
Follow the instructions in
2015-09-13 16:29:40 -04:00
[that file](https://github.com/irungentoo/toxcore/blob/2ab3b14731061cc04d3ccc50a35093c11d018298/INSTALL.md)
When **libtoxcore** is installed, add **lita-tox**
to your Lita instance's Gemfile:
```ruby
2015-09-14 11:26:52 -04:00
gem 'lita-tox', '~> 0.2.0'
2015-09-13 16:29:40 -04:00
```
### Configuration
2015-09-15 14:31:01 -04:00
`config.robot.name` will be used as Tox user name
Mentions in Tox usually use user name, Tox clients usually allow mentioning
by writing first letters of user name and pressing `<Tab>`, so don't use
`config.robot.mention_name`
#### Optional attributes
- `savedata_filename` (String) - Path to file where Tox state will be stored (if provided)
2015-09-15 14:31:01 -04:00
- `status` (String) - Tox user status
2015-09-13 16:29:40 -04:00
#### Example
This is an example `lita_config.rb` file:
```ruby
Lita.configure do |config|
2015-09-15 14:31:01 -04:00
config.robot.name = 'Lita chat bot'
2015-09-13 16:29:40 -04:00
config.robot.adapter = :tox
config.savedata_filename = 'savedata'
2015-09-15 14:31:01 -04:00
config.status = "Send me \"#{config.robot.name}: help\""
2015-09-13 16:29:40 -04:00
end
```