kamigo 0.22.0 → 0.26.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: 7504ce37ead69b89666a0379c4f2275b419a724878827a600bed5b3e0000f422
4
- data.tar.gz: 6237678b0d2d3076c21baa9d0820432398128e9e67b70b2a5b5c69bc0fea1431
3
+ metadata.gz: 05f1fd7d4e57f8931196756adfbad1f4cf9083d8b4f65538d0ecd05fd18dc700
4
+ data.tar.gz: c7f589be49fa51b5a2ae4da0f32e8622e90df52aae4be858c1cba1acb0961419
5
5
  SHA512:
6
- metadata.gz: f3ce218c29a5f58415cfd7fb058a48447367c9f50af6fddfc51c4ad4a77302a150f6dabc1896352ae0145e6d12963dedc34cb3777091597eef54a53dbea8e7ac
7
- data.tar.gz: 62da722699c65004db4fb92b235075cedcf7daad84c5adf5f2de1f6ef6b36bcff4aa698b1bfafda8cee1ff9c825b83ab9176502e682ebfeecaeb23a38a431fbc
6
+ metadata.gz: d13b48d19628617ed526a08cfa1e9b1aa44fef8b2bf88faea1b5f73f4f8e625eea7b39359162f84f23ca067d11bcb93ef7ba82d755d9224a002f497f7c668e00
7
+ data.tar.gz: a5a8c75b0451e725d8d06f95df25fd1b8a053bf0b934db430bbfa209ad2dc7a33e9c8da61919decd03a317684ad7d0f55e19388dc112dde1d40caa4694a18960
data/README.md CHANGED
@@ -92,7 +92,7 @@ window.addEventListener("liff_submit", function(event){
92
92
  https://你的網域/line
93
93
  ```
94
94
 
95
- 第一次開發 LINE Bot 的人可以服用此帖 [Webhook URL 設定 QA](/doc/06_setting.md#Webhook-URL-設定-QA)。
95
+ 第一次開發 LINE Bot 的人可以服用此帖 [Webhook URL 設定 QA](/doc/07_setting.md#Webhook-URL-設定-QA)。
96
96
 
97
97
  # 設定聊天機器人環境變數
98
98
  請在專案根目錄下新增一個 `.env` 檔並且填入以下內容:
@@ -110,7 +110,7 @@ LIFF_FULL=這裡填入你的 FULL_LIFF_URL
110
110
  - `COMPACT_LIFF_URL`、`TALL_LIFF_URL` 和 `FULL_LIFF_URL` 需要到 LINE 後台的 LIFF 分頁新增後,即可獲得一組 LIFF URL。
111
111
 
112
112
  Kamigo 預設的 LIFF Size 為 Compact,你也可以只新增 Compact LIFF URL。
113
- 詳細的 LIFF 設定說明可以服用此帖 [LIFF 設定 QA](/doc/06_setting.md#LIFF-設定-QA)。
113
+ 詳細的 LIFF 設定說明可以服用此帖 [LIFF 設定 QA](/doc/07_setting.md#LIFF-設定-QA)。
114
114
 
115
115
  至此串接完成。
116
116
 
@@ -137,11 +137,11 @@ Kamigo 預設使用基本的語意理解模型,會將使用者輸入視為在
137
137
 
138
138
  # 使用 kamigo 製作的聊天機器人
139
139
  - [kamigo demo](https://github.com/etrex/kamigo_demo)
140
- <p><img width="100" height="100" src="/doc/images/kamigo_demo_qrcode.png"></p>
140
+ <p><img width="100" height="100" src="/docs/images/kamigo_demo_qrcode.png"></p>
141
141
  - [健身紀錄機器人: Muscle-Man](https://github.com/louis70109/muscle_man)
142
142
  <p><img width="100" height="100" src="https://camo.githubusercontent.com/b8c51b15b20b159d356245277d079c04482acc01/68747470733a2f2f692e696d6775722e636f6d2f7534547675676e2e706e67"></p>
143
143
  - 守護寵物機器人
144
- <p><img width="100" height="100" src="/doc/images/pet_loved_qrcode.png"></p>
144
+ <p><img width="100" height="100" src="/docs/images/pet_loved_qrcode.png"></p>
145
145
 
146
146
  # 計畫
147
147
  - 提供多種語意理解模型串接
@@ -1,6 +1,6 @@
1
1
  require 'uri'
2
2
 
3
- class LineController < ApplicationController
3
+ class LineController < ActionController::Base
4
4
  protect_from_forgery with: :null_session
5
5
 
6
6
  def entry
@@ -11,4 +11,19 @@ Kamigo.setup do |config|
11
11
 
12
12
  # When line_default_message is nil, then Kamigo don't reply message.
13
13
  # config.line_default_message = nil
14
+
15
+ # Integrate with line login
16
+ # config.line_login_channel_id = ENV["LINE_LOGIN_CHANNEL_ID"]
17
+ # config.line_login_channel_secret = ENV["LINE_LOGIN_CHANNEL_SECRET"]
18
+ # config.line_login_redirect_uri = ENV["LINE_LOGIN_REDIRECT_URI"]
19
+
20
+ # Integrate with liff
21
+ # config.liff_url_compact = ENV["LIFF_COMPACT"]
22
+ # config.liff_url_tall = ENV["LIFF_TALL"]
23
+ # config.liff_url_full = ENV["LIFF_FULL"]
24
+
25
+ # Integrate with line messaging api
26
+ # config.line_message_api_channel_id = ENV["LINE_CHANNEL_ID"]
27
+ # config.line_message_api_channel_secret = ENV["LINE_CHANNEL_SECRET"]
28
+ # config.line_message_api_channel_token = ENV["LINE_CHANNEL_TOKEN"]
14
29
  end
@@ -1,3 +1,3 @@
1
1
  module Kamigo
2
- VERSION = '0.22.0'.freeze
2
+ VERSION = '0.26.0'.freeze
3
3
  end
data/lib/kamigo.rb CHANGED
@@ -26,6 +26,32 @@ module Kamigo
26
26
  mattr_accessor :line_event_processors
27
27
  @@line_event_processors = [EventProcessors::RailsRouterProcessor.new]
28
28
 
29
+ # env
30
+ mattr_writer :line_messaging_api_channel_id
31
+ mattr_writer :line_messaging_api_channel_secret
32
+ mattr_writer :line_messaging_api_channel_access_token
33
+
34
+ def self.line_message_api_channel_id
35
+ @@line_message_api_channel_id = ENV["LINE_CHANNEL_ID"]
36
+ end
37
+
38
+ def self.line_message_api_channel_secret
39
+ @@line_message_api_channel_secret = ENV["LINE_CHANNEL_SECRET"]
40
+ end
41
+
42
+ def self.line_message_api_channel_token
43
+ @@line_message_api_channel_token = ENV["LINE_CHANNEL_TOKEN"]
44
+ end
45
+
46
+ class << self
47
+ delegate :line_login_channel_id, :line_login_channel_id=, to: :Kamiliff
48
+ delegate :line_login_channel_secret, :line_login_channel_secret=, to: :Kamiliff
49
+ delegate :line_login_redirect_uri, :line_login_redirect_uri=, to: :Kamiliff
50
+ delegate :liff_url_compact, :liff_url_compact=, to: :Kamiliff
51
+ delegate :liff_url_tall, :liff_url_tall=, to: :Kamiliff
52
+ delegate :liff_url_full, :liff_url_full=, to: :Kamiliff
53
+ end
54
+
29
55
  def self.setup
30
56
  yield self
31
57
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamigo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2022-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,40 +30,40 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.25'
33
+ version: '0.33'
34
34
  - - ">="
35
35
  - !ruby/object:Gem::Version
36
- version: 0.25.0
36
+ version: 0.33.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - "~>"
42
42
  - !ruby/object:Gem::Version
43
- version: '0.25'
43
+ version: '0.33'
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 0.25.0
46
+ version: 0.33.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: kamiflex
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.11'
53
+ version: '0.17'
54
54
  - - ">="
55
55
  - !ruby/object:Gem::Version
56
- version: 0.11.0
56
+ version: 0.17.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '0.11'
63
+ version: '0.17'
64
64
  - - ">="
65
65
  - !ruby/object:Gem::Version
66
- version: 0.11.0
66
+ version: 0.17.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: line-bot-api
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.1.2
150
+ rubygems_version: 3.1.6
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: a chatbot framework based on rails