line-bot-api 1.0.0 → 1.1.0
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/README.md +4 -4
- data/lib/line/bot/api/version.rb +1 -1
- data/lib/line/bot/client.rb +25 -1
- data/line-bot-api.gemspec +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac17e583e3e7d618381475bac207da05c13d61bb
|
4
|
+
data.tar.gz: ba6468b9b1b35b43cd09223ad4c672bfaaaa257e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c2995896e031ef222f50ce07999aa167143d816b6af19ab5b0e741a94dfc2e98bff452c68cd87bbd05e97343a710b28c864f8e52ec382cef4a888e19639858
|
7
|
+
data.tar.gz: ac2f3c60778040cfa45b7ad3cdbdd6cbbc65ea817fdb456c124a628a62ca462fbcdc8a78d4b572b35a43ea23396df769cb58deb91db0641d7d6ee17e5714e494
|
data/README.md
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
|
6
6
|
Line::Bot::API - SDK of the LINE Messaging API for Ruby.
|
7
7
|
|
8
|
-
## About LINE Messaging API
|
8
|
+
## About the LINE Messaging API
|
9
9
|
|
10
|
-
|
10
|
+
See the official API reference documentation for more information.
|
11
11
|
|
12
12
|
https://devdocs.line.me/
|
13
13
|
|
14
14
|
## Synopsis
|
15
15
|
|
16
|
-
|
16
|
+
Usage:
|
17
17
|
|
18
18
|
```ruby
|
19
19
|
# app.rb
|
@@ -45,7 +45,7 @@ post '/callback' do
|
|
45
45
|
type: 'text',
|
46
46
|
text: event.message['text']
|
47
47
|
}
|
48
|
-
client.
|
48
|
+
client.reply_message(event['replyToken'], message)
|
49
49
|
when Line::Bot::Event::MessageType::Image, Line::Bot::Event::MessageType::Video
|
50
50
|
response = client.get_message_content(event.message['id'])
|
51
51
|
tf = Tempfile.open("content")
|
data/lib/line/bot/api/version.rb
CHANGED
data/lib/line/bot/client.rb
CHANGED
@@ -59,7 +59,7 @@ module Line
|
|
59
59
|
credentials.values.all?
|
60
60
|
end
|
61
61
|
|
62
|
-
# Push messages to line server and to
|
62
|
+
# Push messages to line server and to user.
|
63
63
|
#
|
64
64
|
# @param user_id [String] User's identifiers
|
65
65
|
# @param messages [Hash or Array]
|
@@ -105,6 +105,30 @@ module Line
|
|
105
105
|
request.post
|
106
106
|
end
|
107
107
|
|
108
|
+
# Multicast messages to line server and to users.
|
109
|
+
#
|
110
|
+
# @param to [Array or String]
|
111
|
+
# @param messages [Hash or Array]
|
112
|
+
#
|
113
|
+
# @return [Net::HTTPResponse]
|
114
|
+
def multicast(to, messages)
|
115
|
+
raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
|
116
|
+
|
117
|
+
to = [to] if to.is_a?(String)
|
118
|
+
messages = [messages] if messages.is_a?(Hash)
|
119
|
+
|
120
|
+
request = Request.new do |config|
|
121
|
+
config.httpclient = httpclient
|
122
|
+
config.endpoint = endpoint
|
123
|
+
config.endpoint_path = '/message/multicast'
|
124
|
+
config.credentials = credentials
|
125
|
+
config.to = to
|
126
|
+
config.messages = messages
|
127
|
+
end
|
128
|
+
|
129
|
+
request.post
|
130
|
+
end
|
131
|
+
|
108
132
|
def leave_group(group_id)
|
109
133
|
raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
|
110
134
|
|
data/line-bot-api.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["LINE Corporation"]
|
10
10
|
spec.email = ["hirohisa.kawasaki@gmail.com"]
|
11
11
|
|
12
|
-
spec.description = "Line::Bot::API - SDK of the LINE
|
13
|
-
spec.summary =
|
12
|
+
spec.description = "Line::Bot::API - SDK of the LINE Messaging API for Ruby"
|
13
|
+
spec.summary = "SDK of the LINE Messaging API"
|
14
14
|
spec.homepage = "https://github.com/line/line-bot-sdk-ruby"
|
15
15
|
spec.license = "Apache-2.0"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-bot-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LINE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '3.0'
|
83
|
-
description: Line::Bot::API - SDK of the LINE
|
83
|
+
description: Line::Bot::API - SDK of the LINE Messaging API for Ruby
|
84
84
|
email:
|
85
85
|
- hirohisa.kawasaki@gmail.com
|
86
86
|
executables: []
|
@@ -127,8 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.5.1
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
|
-
summary:
|
133
|
+
summary: SDK of the LINE Messaging API
|
134
134
|
test_files: []
|