telegram-bot-ruby 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6275009e6d9d48cb1baa1eb7f4708ca5e15367c4
4
- data.tar.gz: 8068393666fa87920092009459eaefd08602225d
3
+ metadata.gz: 42f3aaa643f89d7ac2534a93a9867567706c3412
4
+ data.tar.gz: c1e130a68c7e98375a0c536ebe8a62f16bdc5990
5
5
  SHA512:
6
- metadata.gz: c32c1cfa04b6b71cba29598c8973c0692ed0448e56896930bd1bb57e9ca5b66b57a524dc3aa40e082524e0db968aa9cf7220f622977b6cb9f1c9ce853c3ee0c6
7
- data.tar.gz: 1b51d368865b665dda6d057e9f5d675c5a389b5bdb28f8bc0bce070ccf7eba29838829a3559b0f5a5c9e2c1bc0b62eaa8c196e4c081d44a3862f34af14a24baa
6
+ metadata.gz: 6a030e8417d75db739206e74cafae2502d0cfe97b5dd584ec9880d391fea050a0dd4e9102374fdba347d8a1c6ac88772bbf517857740132562f620e8cfa4cce2
7
+ data.tar.gz: 5a226a421b69610e6d691ea0aeeb91a7c455ddf0ff82f70d518625b18c12ff4f7730953bc6bfd448bd40ca740ddd85183af67e7699de8a4d3abcead5d800bf87
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # telegram-bot
1
+ # telegram-bot-ruby
2
2
 
3
3
  Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
4
4
 
@@ -7,7 +7,7 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
7
7
  Add following line to your Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'telegram-bot', github: 'atipugin/telegram-bot'
10
+ gem 'telegram-bot-ruby'
11
11
  ```
12
12
 
13
13
  And then execute:
@@ -16,14 +16,22 @@ And then execute:
16
16
  $ bundle
17
17
  ```
18
18
 
19
+ Or install it system-wide:
20
+
21
+ ```shell
22
+ $ gem install telegram-bot-ruby
23
+ ```
24
+
19
25
  ## Usage
20
26
 
21
27
  First things first, you need to [obtain a token](https://core.telegram.org/bots#botfather) for your bot. Then create your Telegram bot like this:
22
28
 
23
29
  ```ruby
30
+ require 'telegram/bot'
31
+
24
32
  token = 'YOUR_TELEGRAM_BOT_API_TOKEN'
25
33
 
26
- Telegram::Bot::Runner.run(token) do |bot|
34
+ Telegram::Bot::Client.run(token) do |bot|
27
35
  bot.listen do |message|
28
36
  case message.text
29
37
  when /^hello/
@@ -33,6 +41,10 @@ Telegram::Bot::Runner.run(token) do |bot|
33
41
  end
34
42
  ```
35
43
 
44
+ Note that `bot.api` object implements [Telegram Bot API methods](https://core.telegram.org/bots/api#available-methods) as is. So you can invoke any method inside the block without any problems.
45
+
46
+ Same thing about `message` object - it implements [Message](https://core.telegram.org/bots/api#message) spec, so you always know what to expect from it.
47
+
36
48
  ## Contributing
37
49
 
38
50
  1. Fork it
data/lib/telegram/bot.rb CHANGED
@@ -4,5 +4,5 @@ require 'virtus'
4
4
 
5
5
  require 'telegram/bot/api'
6
6
  require 'telegram/bot/types'
7
- require 'telegram/bot/runner'
7
+ require 'telegram/bot/client'
8
8
  require 'telegram/bot/version'
@@ -1,6 +1,6 @@
1
1
  module Telegram
2
2
  module Bot
3
- class Runner
3
+ class Client
4
4
  attr_reader :api, :offset
5
5
 
6
6
  def self.run(*args, &block)
@@ -1,5 +1,5 @@
1
1
  module Telegram
2
2
  module Bot
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: telegram-bot-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tipugin
@@ -125,7 +125,7 @@ files:
125
125
  - bin/setup
126
126
  - lib/telegram/bot.rb
127
127
  - lib/telegram/bot/api.rb
128
- - lib/telegram/bot/runner.rb
128
+ - lib/telegram/bot/client.rb
129
129
  - lib/telegram/bot/types.rb
130
130
  - lib/telegram/bot/types/audio.rb
131
131
  - lib/telegram/bot/types/base.rb
@@ -140,7 +140,7 @@ files:
140
140
  - lib/telegram/bot/types/user.rb
141
141
  - lib/telegram/bot/types/video.rb
142
142
  - lib/telegram/bot/version.rb
143
- - telegram-bot.gemspec
143
+ - telegram-bot-ruby.gemspec
144
144
  homepage: https://github.com/atipugin/telegram-bot
145
145
  licenses: []
146
146
  metadata: {}