Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom payload for platforms like Telegram, Facebook, Slack #17

Open
crispywong opened this issue Mar 29, 2019 · 2 comments
Open

Custom payload for platforms like Telegram, Facebook, Slack #17

crispywong opened this issue Mar 29, 2019 · 2 comments

Comments

@crispywong
Copy link

Hi,

I would like to ask how to custom payload for carousel, image in other platforms like Facebook, Telegram and etc.

Information

DialogFlow API version: V2 API
Node version: v8.10.0
body-parser version: ^1.18.3
express: ^4.16.4

This is code snippet to return carousel response to Telegram and Google. It worked in google assistant but failed to display carousel list in Telegram. Only text "Category list" was displayed in Telegram.

return res.json({
          payload: {
            google: {
              expectUserResponse: true,
              systemIntent: {
                intent: "actions.intent.OPTION",
                data: {
                  "@type":
                    "type.googleapis.com/google.actions.v2.OptionValueSpec",
                  carouselSelect: {
                    items: [
                      {
                        optionInfo: {
                          key: "car",
                          synonyms: ["automobile", "vehicle"]
                        },
                        description: "A four wheel vehicle",
                        title: "Car"
                      },
                      {
                        optionInfo: {
                          key: "plane",
                          synonyms: ["aeroplane", "jet"]
                        },
                        description: "A flying machine",
                        title: "Plane"
                      }
                    ]
                  }
                }
              },
              richResponse: {
                items: [
                  {
                    simpleResponse: {
                      textToSpeech: "Category List"
                    }
                  }
                ]
              }
            },
            telegram: {
              text: "Category list",
              expectUserResponse: true,
              systemIntent: {
                intent: "actions.intent.OPTION",
                data: {
                  "@type":
                    "type.googleapis.com/google.actions.v2.OptionValueSpec",
                  carouselSelect: {
                    items: [
                      {
                        optionInfo: {
                          key: "car",
                          synonyms: ["automobile", "vehicle"]
                        },
                        description: "A four wheel vehicle",
                        title: "Car"
                      },
                      {
                        optionInfo: {
                          key: "plane",
                          synonyms: ["aeroplane", "jet"]
                        },
                        description: "A flying machine",
                        title: "Plane"
                      }
                    ]
                  }
                }
              }
            }
          },
          outputContexts: []
        });

Is there any mistake in the payload for Telegram?
Could anyone provide guidance on this?

Thanks in advanced.

Thank you.

Regards.

@hcharley
Copy link

hcharley commented Aug 8, 2019

Hi, I also have this question.

@nguyendn
Copy link

nguyendn commented Jan 20, 2021

Same here, I tried the payload below on Slack but only fulfillmentText works

          "fulfillmentText": "This is a text response",
          "source": "local",
          "payload": {
            "slack": {
              "text": "This is a text response for Slack."
            }
          }
 }

Screen Shot 2021-01-20 at 2 09 56 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants