bobot 1.0.52 → 1.0.53
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bobot/configuration.rb +44 -18
- data/lib/bobot/version.rb +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: 9abca691c0b2cccaa74e39426221e12d320ff0d4
|
4
|
+
data.tar.gz: 16f6c8684ae068e0ec36306cf4125061a4fd7fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e6bb306d99fc08db6436822c9b29396e5ecf4031b59e62f35da3bc5af71fb9a426138faccc338dcbed38b0c695345c7b9b1ad75a813976d62fb70590c54cb6
|
7
|
+
data.tar.gz: bb9bf2d9500c16da7c4dc5a6233bb467b3564263028d24882a85b8104c3273f4ad315aac1bd6ab85a12a2c717ebcc4072a13bcced26d5d8d6424e003a30f2bc1
|
data/lib/bobot/configuration.rb
CHANGED
@@ -138,11 +138,17 @@ module Bobot
|
|
138
138
|
greeting_texts << { locale: locale_long, text: greeting_text }
|
139
139
|
end
|
140
140
|
end
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
141
|
+
if greeting_texts.present?
|
142
|
+
Bobot::Profile.set(
|
143
|
+
body: { greeting: greeting_texts },
|
144
|
+
query: { access_token: Bobot.page_access_token },
|
145
|
+
)
|
146
|
+
else
|
147
|
+
Bobot::Profile.unset(
|
148
|
+
body: { fields: ["greeting"] },
|
149
|
+
query: { access_token: Bobot.page_access_token },
|
150
|
+
)
|
151
|
+
end
|
146
152
|
end
|
147
153
|
|
148
154
|
## == Set bot whitelist domains (only displayed on first time) ==
|
@@ -151,10 +157,17 @@ module Bobot
|
|
151
157
|
def set_whitelist_domains!
|
152
158
|
raise Bobot::InvalidParameter.new(:access_token) unless Bobot.page_access_token.present?
|
153
159
|
raise Bobot::InvalidParameter.new(:domains) unless Bobot.domains.present?
|
154
|
-
Bobot
|
155
|
-
|
156
|
-
|
157
|
-
|
160
|
+
if Bobot.domains.present?
|
161
|
+
Bobot::Profile.set(
|
162
|
+
body: { whitelisted_domains: Bobot.domains },
|
163
|
+
query: { access_token: Bobot.page_access_token },
|
164
|
+
)
|
165
|
+
else
|
166
|
+
Bobot::Profile.unset(
|
167
|
+
body: { fields: ["whitelisted_domains"] },
|
168
|
+
query: { access_token: Bobot.page_access_token },
|
169
|
+
)
|
170
|
+
end
|
158
171
|
end
|
159
172
|
|
160
173
|
## == You can define the action to trigger when new humans click on ==
|
@@ -162,10 +175,17 @@ module Bobot
|
|
162
175
|
## == messaging_postbacks field when setting up your webhook. ==
|
163
176
|
def set_get_started_button!
|
164
177
|
raise Bobot::InvalidParameter.new(:access_token) unless Bobot.page_access_token.present?
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
178
|
+
if I18n.exists?('bobot.config.get_started.payload')
|
179
|
+
Bobot::Profile.set(
|
180
|
+
body: { get_started: { payload: I18n.t('bobot.config.get_started.payload') } },
|
181
|
+
query: { access_token: Bobot.page_access_token },
|
182
|
+
)
|
183
|
+
else
|
184
|
+
Bobot::Profile.unset(
|
185
|
+
body: { fields: ["persistent_menu", "get_started"] },
|
186
|
+
query: { access_token: Bobot.page_access_token },
|
187
|
+
)
|
188
|
+
end
|
169
189
|
end
|
170
190
|
|
171
191
|
## == You can show a persistent menu to humans. ==
|
@@ -196,11 +216,17 @@ module Bobot
|
|
196
216
|
}
|
197
217
|
end
|
198
218
|
end
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
219
|
+
if persistent_menus.present?
|
220
|
+
Bobot::Profile.set(
|
221
|
+
body: { persistent_menu: persistent_menus },
|
222
|
+
query: { access_token: Bobot.page_access_token },
|
223
|
+
)
|
224
|
+
else
|
225
|
+
Bobot::Profile.unset(
|
226
|
+
body: { fields: ["persistent_menu"] },
|
227
|
+
query: { access_token: Bobot.page_access_token },
|
228
|
+
)
|
229
|
+
end
|
204
230
|
end
|
205
231
|
end
|
206
232
|
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: 1.0.
|
4
|
+
version: 1.0.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Navid EMAD
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|