Google Dialogflow Quick Replies formatting issues in Telegram

两盒软妹~` 提交于 2020-01-16 08:42:53

问题


I had create a chatbot using Dialogflow and integrated it with Facebook Messenger & Telegram. I noticed that for the Quick Replies in Telegram (Link 1) appears differently in FB Messenger (Link 2). Is there any way to make it nicer and more presentable in Telegram?

Telegram

Facebook Messenger

This is my Quick Replies settings in Dialogflow.

Dialogflow


回答1:


in DialogFlow you can indeed (as Marc pointed out) use a Custom Payload for Telegram, here it is an example:

{
  "telegram": {
    "text": "What would you like help with?",
    "reply_markup": {
      "inline_keyboard": [
        [
          {
            "text": "Daily News",
            "callback_data": "news"
          }
        ],
        [
          {
            "text": "New Features",
            "callback_data": "features"
          }
        ]
      ]
    }
  }
}

The quick replies appear a buttons you can click (notice the actual response is sent but not displayed within the chat).

All the best!

Beppe




回答2:


SHORT ANSWER:

That is NOT possible.

DETAILED ANSWER:

Each Channel (Facebook Messenger, Telegram etc.) has its own UI components and its own styling. Those can't be changed as they are rendered/controlled by the channel it self.

What Dialogflow doing is giving you the ability to show these UI components in each channel without making you handle the different implementation needed for each channel.

Dialogflow also gives you the ability to send Custom Payloads where you can send a custom JSON (that should be compatible with the channel you are connected to) That can be used if the channel for example has a UI component that is not yet supported by Dialogflow.

If the channel gives you an option to change a property in the UI components you are using, you could do that using Custom JSON, But still you are always limited to how each channel renders the UI components and what features they provide us



来源:https://stackoverflow.com/questions/59557877/google-dialogflow-quick-replies-formatting-issues-in-telegram

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!