Skip to content

Commit

Permalink
Merge pull request #5 from petitroto/feature/support-proactive-for-v1…
Browse files Browse the repository at this point in the history
…2_30_7

fix proactive-trigger to support v12.30.7
  • Loading branch information
petitroto authored Mar 13, 2023
2 parents 8c5ae1c + 2224fa1 commit af5d0d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## 動作環境

Botpress v12.16.3以上(v12.26.5まで動作確認済み
Botpress v12.16.3以上(v12.30.7まで動作確認済み

## 利用方法

Expand All @@ -20,7 +20,7 @@ Botpress v12.16.3以上(v12.26.5まで動作確認済み)

### shop.html
* イルカのアイコン画像のアトリビューションを追加。
* proactive-triggerイベントを送信するタイミングを「webchatOpened」イベントではなく「visit」イベントの時に変更。webchatOpenedのタイミングでは、新規ユーザーの場合にuserスペースへのデータの保存が正しく行えないことが分かったため。
* proactive-triggerイベントを送信するタイミングを「webchatOpened」イベントではなく「webchatReady」または「visit」イベントの時に変更。webchatOpenedのタイミングでは、新規ユーザーの場合にuserスペースへのデータの保存が正しく行えないことが分かったため。

### makeChatlog.js
* 会話履歴を取得する方法を、WebChatモジュールのREST APIから、Botpress SDKを使う形に変更。
Expand Down
Binary file modified ruka-chap7.tgz
Binary file not shown.
3 changes: 2 additions & 1 deletion ruka-chap7/media/shop.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ <h4 id="prd_stock">In Stock</h4>

// プロアクティブ化
window.addEventListener('message', function (event) {
if (event.data.payload && event.data.payload.type === 'visit') { // v12.26に対応した書き方
if (event.data.payload && event.data.payload.type === 'visit' || // v12.26に対応した書き方
event.data.name === 'webchatReady') { // v12.30.7に対応した書き方
window.botpressWebChat.sendEvent({
type: 'proactive-trigger',
channel: 'web',
Expand Down

0 comments on commit af5d0d0

Please sign in to comment.