1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dialogflowでリンクボタンを表示したい

Last updated at Posted at 2021-12-27

はじめに

Dialogflowとは、Googleが提供しているチャットボットサービスです。
あらかじめ管理画面から質問とそれに対する回答を登録しておいて、Google側が出力してくれたコードを貼り付けるだけで、webサイトに簡単にチャット機能が追加できます!
すばらしい!!!

ですが、返事でwebサイトのURLを表示するにはどうしたらいいの?というところにつまずいたので、書いておきます。

リンクボタンを回答で表示しよう

画面左にある「Intents」から「CREATE INTENT」ボタンをクリックします。
CREATE_INTENT.png

「Training phrases」に質問を入力してください。
Training phrases.png

「Responses」で回答を登録していきます。
もとからある「Text Response」は削除してください。
「ADD RESPONSES」をクリックして、「Custom Payload」をクリックしてください。
Responses.png

以下、リンクボタンの例になります。

{
  "richContent": [
    [
      {
        "type": "button",
        "icon": {
          "type": "chevron_right",
          "color": "#FF9800"
        },
        "text": "こちらを参照してください",
        "link": "https://www.google.com/"
      }
    ]
  ]
}

実際に動作を確認してみよう

画面左にある「Integrations」のWeb Demoからできた気がする...
けど、記憶を失いました。。

スクリーンショット 2021-12-27 10.53.18.png

余談

Dialogflowの導入としては、この記事がわかりやすくておすすめです。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?