bobot 4.11.0 → 4.13.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/lib/bobot/commander.rb +1 -0
- data/lib/bobot/error_parser.rb +1 -1
- data/lib/bobot/event.rb +1 -0
- data/lib/bobot/events/pass_thread_control.rb +15 -0
- data/lib/bobot/graph_facebook.rb +6 -3
- data/lib/bobot/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c644ff98cc478e07c3d43a6b13a58751a4f2d3567a87e630650142a1cb431e5d
|
4
|
+
data.tar.gz: de9c6c661ea05bc4a1569b07decee9ead20a8f6b0b87c6834d7fef679db6c4f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aaac5e7aae79265063939f3741b4999a71fba1484fdc68b426c0dfd277930b3d964df40af6f5caa358edad49fbc78f96eaee0dcd40748588cc12d4ddfba75da9
|
7
|
+
data.tar.gz: 8d5471016a06120b0d4ccf1fdfc1ef2483075c761b7f121e221e54973c41f9109b7abe91b702ab434337ece4fbef508d693d5c353253398930c2e826bd1defcf
|
data/lib/bobot/commander.rb
CHANGED
data/lib/bobot/error_parser.rb
CHANGED
@@ -36,7 +36,7 @@ module Bobot
|
|
36
36
|
#
|
37
37
|
# Returns nil if no errors were found, otherwises raises appropriately
|
38
38
|
def raise_errors_from(response, extras = {})
|
39
|
-
return false
|
39
|
+
return false if response.nil? || !response.key?('error')
|
40
40
|
|
41
41
|
error = response['error']
|
42
42
|
|
data/lib/bobot/event.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
module Bobot
|
2
|
+
module Event
|
3
|
+
class PassThreadControl
|
4
|
+
include Bobot::Event::Common
|
5
|
+
|
6
|
+
def new_owner_app_id
|
7
|
+
@messaging['pass_thread_control']['new_owner_app_id']
|
8
|
+
end
|
9
|
+
|
10
|
+
def metadata
|
11
|
+
@messaging['pass_thread_control']['metadata']
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/bobot/graph_facebook.rb
CHANGED
@@ -15,7 +15,8 @@ module Bobot
|
|
15
15
|
headers: GRAPH_HEADERS,
|
16
16
|
ssl_verifypeer: false,
|
17
17
|
)
|
18
|
-
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
18
|
+
json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
|
19
|
+
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
|
19
20
|
unless Rails.env.production?
|
20
21
|
Rails.logger.debug "[GET] >> #{url}"
|
21
22
|
Rails.logger.debug "[GET] << #{json}"
|
@@ -35,7 +36,8 @@ module Bobot
|
|
35
36
|
headers: GRAPH_HEADERS,
|
36
37
|
ssl_verifypeer: false,
|
37
38
|
)
|
38
|
-
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
39
|
+
json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
|
40
|
+
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
|
39
41
|
unless Rails.env.production?
|
40
42
|
Rails.logger.debug "[POST] >> #{url}"
|
41
43
|
Rails.logger.debug "[POST] << #{json}"
|
@@ -55,7 +57,8 @@ module Bobot
|
|
55
57
|
headers: GRAPH_HEADERS,
|
56
58
|
ssl_verifypeer: false,
|
57
59
|
)
|
58
|
-
json = ActiveSupport::JSON.decode(response.send(:body) || '{}')
|
60
|
+
json = (ActiveSupport::JSON.decode(response.send(:body) || '{}') rescue ::JSON::ParserError nil)
|
61
|
+
Bobot::ErrorParser.raise_errors_from_html(response, graph_body) if json.nil?
|
59
62
|
unless Rails.env.production?
|
60
63
|
Rails.logger.debug "[DELETE] >> #{url}"
|
61
64
|
Rails.logger.debug "[DELETE] << #{json}"
|
data/lib/bobot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bobot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Navid EMAD
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/bobot/events/message_echo.rb
|
92
92
|
- lib/bobot/events/message_request.rb
|
93
93
|
- lib/bobot/events/optin.rb
|
94
|
+
- lib/bobot/events/pass_thread_control.rb
|
94
95
|
- lib/bobot/events/policy_enforcement.rb
|
95
96
|
- lib/bobot/events/postback.rb
|
96
97
|
- lib/bobot/events/read.rb
|
@@ -195,8 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
196
|
- !ruby/object:Gem::Version
|
196
197
|
version: '0'
|
197
198
|
requirements: []
|
198
|
-
|
199
|
-
rubygems_version: 2.7.8
|
199
|
+
rubygems_version: 3.0.1
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: Facebook Messenger Bot
|