telegram_bot_ruby 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +7 -13
- data/lib/telegram_bot/version.rb +1 -1
- data/telegram_bot_ruby.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bb9b0f59bc8bfb6f12dad74e1ac411b9c8779b4
|
4
|
+
data.tar.gz: 5983a8a1acbb103e17f7ceb2f4e17c7157efdf9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2baa92312177181aa1b91d5056fe60c730ac486aa24ec63581e4863460b39545b4fedb2aeab4c1415510c35912d9a7b9d9126421fa70f350aefb43817b0e887d
|
7
|
+
data.tar.gz: 3b93fb3997d370af5ce6c7d33b9aef530cb54f607713a49a63f2b2a69a3b33c54ce8dcc0beec0a16141a0b54bfd7b9d4103969c85f8ffea0448a26ab87b22103
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
# TelegramBotRuby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
utilizing telegram bots api in ruby
|
7
|
-
([telegram api doc](https://core.telegram.org/bots/api))
|
3
|
+
[telegram api doc](https://core.telegram.org/bots/api)
|
8
4
|
|
9
5
|
|
10
6
|
## Installation
|
@@ -32,12 +28,13 @@ $ gem install telegram_bot_ruby
|
|
32
28
|
### Set up client
|
33
29
|
|
34
30
|
```ruby
|
35
|
-
require '
|
31
|
+
require 'telegram_bot'
|
36
32
|
|
37
33
|
bot = TelegramBot.new(token: <token>)
|
38
|
-
|
34
|
+
|
35
|
+
bot.listen(method: :webhook, url: '/meow/meow') # not implemented yet
|
39
36
|
# or
|
40
|
-
bot.listen(method: :poll, interval:
|
37
|
+
bot.listen(method: :poll, interval: 1)
|
41
38
|
```
|
42
39
|
|
43
40
|
### Set up update listeners
|
@@ -56,12 +53,9 @@ bot.on_text 'ping' do # plain 'ping'
|
|
56
53
|
end
|
57
54
|
|
58
55
|
# with block: false, message will keep passing through other listeners
|
59
|
-
bot.on_text /(\d+)\+(\d+)\=\?/, block: false do
|
56
|
+
bot.on_text /(\d+)\+(\d+)\=\?/, block: false do |n1, n2|
|
60
57
|
send_chat_action :typing
|
61
|
-
send_message (
|
62
|
-
forward_message 2333
|
63
|
-
send_chat_action :upload_photo
|
64
|
-
send_photo <IO obj implements read>
|
58
|
+
send_message (n1.to_i + n2.to_i).to_s
|
65
59
|
end
|
66
60
|
|
67
61
|
# a simple history logger
|
data/lib/telegram_bot/version.rb
CHANGED
data/telegram_bot_ruby.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/shouya/telegram-bot"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.required_ruby_version = '2.0.0'
|
16
|
+
spec.required_ruby_version = '> 2.0.0'
|
17
17
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
18
|
# delete this section to allow pushing this gem to any host.
|
19
19
|
|
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.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shou Ya
|
@@ -117,7 +117,7 @@ require_paths:
|
|
117
117
|
- lib
|
118
118
|
required_ruby_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- -
|
120
|
+
- - ">"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 2.0.0
|
123
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|