bobot 4.8.0 → 4.9.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bcdcfe9c793c901a6e5a93db7f21076bc2e878c9b5b4e953c5ea7e7d8cc28fc
4
- data.tar.gz: '013236480a0426eb37567665fa8e4fde64824908e567d5932aa0056884ccd8ce'
3
+ metadata.gz: 2244287b3fa8e6d2e733f52d0a17b77e35212992d317bbc1ce604a3a1acd77f6
4
+ data.tar.gz: be3fbff646eec7ce45e9679a7b3daa28ec427e3af237a458e75dce577a656f86
5
5
  SHA512:
6
- metadata.gz: af170c826e5e8fe936fb49979e3b091de59089dfa35a3bae102f538d3a8fe1abd184c27ce738f0f850d32e92424bb72d6e40cf6b2430f0ff38276adf4229b1eb
7
- data.tar.gz: 03c676d71f1e547dd314378de74b01a3ee0ad255e125bb5d1049007454ea203f28af7a26e473a49fcb84cb5003b9f0b77fd8022011e81c89260253c7dc1883da
6
+ metadata.gz: 1d10996b8dcdda72a19e3ae0b7e65fbcbf5db2d2e99d12c95d50b7768dbe91f5f0147638ae366afbace21d9f86f456dc27bb9a91153dba7fa6a10ec83f3bdd4c
7
+ data.tar.gz: 94a6d4e3093fdc49b01b5a8343d35e78d1c144c25a882dbda9387487c36be401cd5f6753b8a8404bc8ccc4ea0f2b2f8538f40d935b4cee168e3b544ed5076d75
data/lib/bobot/page.rb CHANGED
@@ -326,7 +326,7 @@ module Bobot
326
326
  I18n.available_locales.each do |locale|
327
327
  greeting_text = I18n.t("bobot.#{slug}.config.greeting_text", locale: locale, default: nil)
328
328
  next unless greeting_text.present?
329
- facebook_locales = I18n.t("bobot.#{slug}.config.facebook_locales", locale: locale, default: nil)
329
+ facebook_locales = I18n.t("bobot.#{slug}.config.facebook_locales", locale: locale, default: [])
330
330
  facebook_locales.to_a.each do |locale_long|
331
331
  greeting_texts << { locale: locale_long, text: greeting_text }
332
332
  end
@@ -428,8 +428,8 @@ module Bobot
428
428
  # Default text
429
429
  if language.nil?
430
430
  short_slug = slug.gsub(/_\w+$/, "")
431
- persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: I18n.default_locale, default: nil)
432
- persistent_menu = I18n.t("bobot.#{short_slug}.config.persistent_menu", locale: I18n.default_locale, default: nil) if persistent_menu.nil?
431
+ persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: I18n.default_locale, default: {})
432
+ persistent_menu = I18n.t("bobot.#{short_slug}.config.persistent_menu", locale: I18n.default_locale, default: {}) unless persistent_menu.present?
433
433
  if persistent_menu.present?
434
434
  persistent_menus << {
435
435
  locale: 'default',
@@ -441,8 +441,8 @@ module Bobot
441
441
  I18n.available_locales.each do |locale|
442
442
  persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: locale, default: nil)
443
443
  persistent_menu = I18n.t("bobot.#{short_slug}.config.persistent_menu", locale: locale, default: nil) if persistent_menu.nil?
444
- facebook_locales = I18n.t("bobot.#{slug}.config.facebook_locales", locale: locale, default: nil)
445
- facebook_locales = I18n.t("bobot.#{short_slug}.config.facebook_locales", locale: locale, default: nil) if facebook_locales.nil?
444
+ facebook_locales = I18n.t("bobot.#{slug}.config.facebook_locales", locale: locale, default: [])
445
+ facebook_locales = I18n.t("bobot.#{short_slug}.config.facebook_locales", locale: locale, default: []) unless facebook_locales.present?
446
446
  next unless persistent_menu.present?
447
447
  facebook_locales.to_a.each do |locale_long|
448
448
  persistent_menus << {
@@ -454,8 +454,8 @@ module Bobot
454
454
  end
455
455
  else
456
456
  short_slug = slug.gsub(/_#{language}$/, "")
457
- persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: language, default: nil)
458
- persistent_menu = I18n.t("bobot.#{short_slug}.config.persistent_menu", locale: language, default: nil) if persistent_menu.nil?
457
+ persistent_menu = I18n.t("bobot.#{slug}.config.persistent_menu", locale: language, default: {})
458
+ persistent_menu = I18n.t("bobot.#{short_slug}.config.persistent_menu", locale: language, default: {}) unless persistent_menu.present?
459
459
  if persistent_menu.present?
460
460
  persistent_menus << {
461
461
  locale: 'default',
data/lib/bobot/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Bobot
2
2
  class Version
3
3
  MAJOR = 4
4
- MINOR = 8
4
+ MINOR = 9
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
@@ -0,0 +1,14 @@
1
+ ETHON: Libcurl initialized
2
+ [GET] >> https://graph.facebook.com/v3.2/4801958000
3
+ [GET] << {"error"=>{"message"=>"Invalid OAuth access token.", "type"=>"OAuthException", "code"=>190, "fbtrace_id"=>"Hlssg2aiVlN"}}
4
+ [GET] >> https://graph.facebook.com/v3.2/7444140200
5
+ [GET] << {"first_name"=>"Foo", "last_name"=>"Bar"}
6
+ [ActiveJob] Enqueued Bobot::CommanderJob (Job ID: ab2730f9-4cd5-4780-850d-b93ed90bc4cb) to Test(default) with arguments: {"sender"=>{"id"=>"2"}, "recipient"=>{"id"=>"3"}, "timestamp"=>1457764197627, "message"=>{"mid"=>"mid.1457764197618:41d102a3e1ae206a38", "seq"=>73, "text"=>"Hello, bot!"}}
7
+ [DELETE] >> https://graph.facebook.com/v3.2/me/messenger_profile
8
+ [DELETE] << {"result"=>"Successfully deleted Get Started button"}
9
+ [DELETE] >> https://graph.facebook.com/v3.2/me/messenger_profile
10
+ [DELETE] << {"error"=>{"message"=>"Invalid OAuth access token.", "type"=>"OAuthException", "code"=>190, "fbtrace_id"=>"Hlssg2aiVlN"}}
11
+ [POST] >> https://graph.facebook.com/v3.2/me/messenger_profile
12
+ [POST] << {"result"=>"Successfully added Get Started button"}
13
+ [POST] >> https://graph.facebook.com/v3.2/me/messenger_profile
14
+ [POST] << {"error"=>{"message"=>"Invalid OAuth access token.", "type"=>"OAuthException", "code"=>190, "fbtrace_id"=>"Hlssg2aiVlN"}}
@@ -0,0 +1,15 @@
1
+ # message received or quick replies
2
+ Bobot::Commander.on :message do |message|
3
+ end
4
+
5
+ # get started and click on any buttons
6
+ Bobot::Commander.on :postback do |postback|
7
+ end
8
+
9
+ # referral by m.me/XXX?ref=
10
+ Bobot::Commander.on :referral do |referral|
11
+ end
12
+
13
+ # referral by param ref into send to messenger plugin
14
+ Bobot::Commander.on :optin do |optin|
15
+ end
@@ -0,0 +1,43 @@
1
+ bobot_config = Rails.application.config_for(:bobot).with_indifferent_access
2
+ if bobot_config.present?
3
+ Bobot.configure do |config|
4
+ config.app_id = bobot_config[:app_id]
5
+ config.app_secret = bobot_config[:app_secret]
6
+ config.verify_token = bobot_config[:verify_token]
7
+ config.skip_code = bobot_config[:skip_code]
8
+ config.domains = bobot_config[:domains]
9
+ config.async = bobot_config[:async]
10
+ config.commander_queue_name = bobot_config[:commander_queue_name]
11
+ config.url_for_chat_extension = bobot_config[:url_for_chat_extension]
12
+ config.size_for_chat_extension = bobot_config[:size_for_chat_extension]
13
+ config.share_button_for_chat_extension = bobot_config[:share_button_for_chat_extension]
14
+ config.in_test_for_chat_extension = bobot_config[:in_test_for_chat_extension]
15
+ bobot_config[:pages].each do |page|
16
+ next if page[:slug].nil? || page[:page_id].nil? || page[:page_access_token].nil? || page[:get_started_payload].nil?
17
+
18
+ config.pages << Bobot::Page.new(
19
+ slug: page[:slug],
20
+ language: page[:language],
21
+ page_id: page[:page_id],
22
+ page_access_token: page[:page_access_token],
23
+ get_started_payload: page[:get_started_payload],
24
+ )
25
+ end
26
+ end
27
+ unless Rails.env.production?
28
+ bot_files = Dir[Rails.root.join("app", "bobot", "**", "*.rb")]
29
+ bot_reloader = ActiveSupport::FileUpdateChecker.new(bot_files) do
30
+ bot_files.each { |file| require_dependency file }
31
+ end
32
+ ActiveSupport::Reloader.to_prepare do
33
+ bot_reloader.execute_if_updated
34
+ end
35
+ bot_files.each { |file| require_dependency file }
36
+ end
37
+ if defined?(Rails::Server)
38
+ Rails.application.config.after_initialize do
39
+ Rails.application.config.paths.add File.join("app", "bobot"), glob: File.join("**", "*.rb")
40
+ Rails.application.config.autoload_paths += Dir[Rails.root.join("app", "bobot", "*")]
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,29 @@
1
+ en:
2
+ bobot:
3
+ facebook_1:
4
+ config:
5
+ facebook_locales:
6
+ - "en_US"
7
+ - "en_UD"
8
+ - "en_GB"
9
+ greeting_text: "Bobot is an intelligent robot."
10
+ persistent_menu:
11
+ composer_input_disabled: false
12
+ call_to_actions:
13
+ - type: "nested"
14
+ title: "My Account"
15
+ call_to_actions:
16
+ - type: "postback"
17
+ title: "What is a chatbot?"
18
+ payload: "WHAT_IS_A_CHATBOT"
19
+ - type: "postback"
20
+ title: "History"
21
+ payload: "HISTORY_PAYLOAD"
22
+ - type: "postback"
23
+ title: "Contact Info"
24
+ payload: "CONTACT_INFO_PAYLOAD"
25
+ - type: "web_url"
26
+ title: "Get some help"
27
+ url: "https://github.com/navidemad/bobot"
28
+ webview_height_ratio: "full"
29
+ what_is_a_chatbot: "A chatbot is a computer program which conducts a conversation via auditory or textual methods."
@@ -0,0 +1,28 @@
1
+ fr:
2
+ bobot:
3
+ facebook_1:
4
+ config:
5
+ facebook_locales:
6
+ - "fr_FR"
7
+ - "fr_CA"
8
+ greeting_text: 'Bobot est un robot intelligent.'
9
+ persistent_menu:
10
+ composer_input_disabled: false
11
+ call_to_actions:
12
+ - type: "nested"
13
+ title: "Mon compte"
14
+ call_to_actions:
15
+ - type: "postback"
16
+ title: "C'est quoi un chatbot ?"
17
+ payload: "WHAT_IS_A_CHATBOT"
18
+ - type: "postback"
19
+ title: "Historique"
20
+ payload: "HISTORY_PAYLOAD"
21
+ - type: "postback"
22
+ title: "Contact Info"
23
+ payload: "CONTACT_INFO_PAYLOAD"
24
+ - type: "web_url"
25
+ title: "Obtenir de l'aide"
26
+ url: "https://github.com/navidemad/bobot"
27
+ webview_height_ratio: "full"
28
+ what_is_a_chatbot: "Un chatbot est un programme qui tente de converser avec une personne durant quelques minutes ou plus en lui donnant l'impression de converser elle-même avec une personne."
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.8.0
4
+ version: 4.9.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-22 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -163,7 +163,12 @@ files:
163
163
  - spec/dummy/config/routes.rb
164
164
  - spec/dummy/config/secrets.yml
165
165
  - spec/dummy/config/spring.rb
166
+ - spec/dummy/log/test.log
166
167
  - spec/dummy/public/favicon.ico
168
+ - spec/dummy/tmp/generator/app/bobot/workflow.rb
169
+ - spec/dummy/tmp/generator/config/initializers/bobot.rb
170
+ - spec/dummy/tmp/generator/config/locales/bobot.en.yml
171
+ - spec/dummy/tmp/generator/config/locales/bobot.fr.yml
167
172
  - spec/examples.txt
168
173
  - spec/helpers/graph_api_helpers.rb
169
174
  - spec/jobs/bobot/commander_job_spec.rb
@@ -190,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
195
  - !ruby/object:Gem::Version
191
196
  version: '0'
192
197
  requirements: []
193
- rubyforge_project:
194
- rubygems_version: 2.7.6
198
+ rubygems_version: 3.0.1
195
199
  signing_key:
196
200
  specification_version: 4
197
201
  summary: Facebook Messenger Bot
@@ -235,6 +239,11 @@ test_files:
235
239
  - spec/dummy/config.ru
236
240
  - spec/dummy/Rakefile
237
241
  - spec/dummy/public/favicon.ico
242
+ - spec/dummy/log/test.log
243
+ - spec/dummy/tmp/generator/app/bobot/workflow.rb
244
+ - spec/dummy/tmp/generator/config/locales/bobot.en.yml
245
+ - spec/dummy/tmp/generator/config/locales/bobot.fr.yml
246
+ - spec/dummy/tmp/generator/config/initializers/bobot.rb
238
247
  - spec/examples.txt
239
248
  - spec/bobot/install_generator_spec.rb
240
249
  - spec/bobot/bobot_spec.rb