bobot 4.3.1 → 4.4.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 +5 -5
- data/lib/bobot/error_parser.rb +3 -3
- data/lib/bobot/page.rb +4 -1
- data/lib/bobot/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: c9b92e699eaefe160dc8d2c3d7b23b844d2ebd7e072d4ae873d4da4bab78bca8
|
|
4
|
+
data.tar.gz: 95efd7bcb4a083023ceba6a84de7a3f0f3caa247d8eeeb1b275bacb7256a9a3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 79916ffce958a82de15e0f68fa75ffe6178ef25089a310165b266928f886e48c1ffff5b2d1139a04c1bcc17e04ff22597793a1d4c56930bca2659fc0c96e81f3
|
|
7
|
+
data.tar.gz: 1c726c938099bc0a352d8e28f107ef8662aa7b92d4841218be5ee44b53135ba8e9cce08f0b78f342a499a1835215af4f63c9e00b25cdface164b71904eb7eb22
|
data/lib/bobot/error_parser.rb
CHANGED
|
@@ -66,15 +66,15 @@ module Bobot
|
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
def internal_error?(error_code)
|
|
69
|
-
INTERNAL_ERROR_CODES.
|
|
69
|
+
INTERNAL_ERROR_CODES.key?(error_code)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
72
|
def access_token_error?(error_code)
|
|
73
|
-
ACCESS_TOKEN_ERROR_CODES.
|
|
73
|
+
ACCESS_TOKEN_ERROR_CODES.key?(error_code)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
def account_linking_error?(error_code)
|
|
77
|
-
ACCOUNT_LINKING_ERROR_CODES.
|
|
77
|
+
ACCOUNT_LINKING_ERROR_CODES.key?(error_code)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def limit_error?(error_code, error_subcode)
|
data/lib/bobot/page.rb
CHANGED
|
@@ -481,13 +481,16 @@ module Bobot
|
|
|
481
481
|
end
|
|
482
482
|
|
|
483
483
|
## == Subcribe your bot to your page ==
|
|
484
|
-
def subscribe_to_facebook_page!
|
|
484
|
+
def subscribe_to_facebook_page!(subscription_fields: [])
|
|
485
485
|
raise Bobot::FieldFormat.new("page_id is required") unless page_id.present?
|
|
486
486
|
raise Bobot::FieldFormat.new("access_token is required") unless page_access_token.present?
|
|
487
|
+
raise Bobot::FieldFormat.new("subscription_fields is required") if subscription_fields.nil?
|
|
488
|
+
raise Bobot::FieldFormat.new("subscription_fields has to be an array") unless subscription_fields.is_a?(Array)
|
|
487
489
|
Bobot::Subscription.set(
|
|
488
490
|
query: {
|
|
489
491
|
page_id: page_id,
|
|
490
492
|
access_token: page_access_token,
|
|
493
|
+
subscription_fields: subscription_fields,
|
|
491
494
|
},
|
|
492
495
|
)
|
|
493
496
|
end
|
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.4.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: 2018-
|
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: i18n
|
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
193
193
|
version: '0'
|
|
194
194
|
requirements: []
|
|
195
195
|
rubyforge_project:
|
|
196
|
-
rubygems_version: 2.
|
|
196
|
+
rubygems_version: 2.7.6
|
|
197
197
|
signing_key:
|
|
198
198
|
specification_version: 4
|
|
199
199
|
summary: Facebook Messenger Bot
|