README.md in telepost-0.2.2 vs README.md in telepost-0.2.3
- old
+ new
@@ -7,27 +7,40 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/21aec58faee3866bdfbb/maintainability)](https://codeclimate.com/github/yegor256/telepost/maintainability)
[![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/telepost/master/frames)
Telepost is a simple gateway to Telegram, which can post messages and respond to primitive requests.
-First, install it:
+First, get your token from [@BotFather](https://t.me/BotFather).
+Then, install it:
+
```bash
$ gem install telepost
```
Then, use it like this:
```ruby
require 'telepost'
-require 'logger'
tp = Telepost.new('..token..')
Thread.start do
tp.run do |chat, msg|
tp.post(chat: chat, 'Thanks for talking to me!')
end
end
tp.post(chat: 12345, 'How are you?', 'How are you doing?')
+```
+
+All lines you provide to the `post()` method will be concatenated
+with a space between them.
+
+Or you can pre-configure it to talk to certain list of chats.
+Your bot has to be an admin of the channel, in order to post there.
+Here is how you "spam":
+
+```ruby
+tp = Telepost.new('..token..', chats: ['my_channel'])
+tp.spam('How are you?')
```
That's it.
# How to contribute