README.md in tgbot-0.1.0 vs README.md in tgbot-0.1.1

- old
+ new

@@ -1,42 +1,21 @@ # `Tgbot` +[![Gem Version](https://badge.fury.io/rb/tgbot.svg)](https://badge.fury.io/rb/tgbot) + A tiny but easy-to-use wrapper of [Telegram Bot API](https://core.telegram.org/bots/api). -It's still under experiment, not ready for use. +## Install -## `future.rb` + gem install tgbot -```ruby -# `Tgbot.run' will start a loop until `Interrupt (Ctrl+C)' occured -Tgbot.run TOKEN, proxy: 'https://127.0.0.1:1080' do |bot| - bot.start do # once - bot.ok "this is @#{bot.first_name}, sir." - end - bot.get 'drive' do # if message['drive'] - bot.send_photo garage.pop rescue bot.retry(1) { |x| bot.sorry "Failed #{x} times." } - end # totally retry ^ times - bot.on /\-md([.^]+)\Z/m do |matched| - phantomjs 'md.js', matched - bot.send_photo 'cp.jpg' rescue bot.sorry - end - bot.finish do # rescue Interrupt - bot.ok 'byebye.' - end - bot.before_update do |update| - # do something before handling every [update] - end - bot.after_update do |update| - # do something after handling every [update] - end -end -``` +## Usage -## Further future +See [example.rb](example.rb). -Features often needed by bots. +## Todo -- database -- session -- access control -- dynamically add functions -- +- improve DSL + +## Contribute + +PRs/issues are welcome.