facebook-messengerbotkit

Botkit is not sending Generic Template (Attachments) facebook messenger


I am trying to reply to the user with this message:

  bot.reply(message, {
                    "attachment":
                    {
                        "type": "template",
                        "payload": {
                            "template_type": "generic",
                            "sharable": true,
                            "elements": [
                                {
                                    "title": "MY title of bd",
                                    "image_url": "https://storage.googleapis.com/ssfkj.com/undefined",
                                    "subtitle": "undefined/undefinedundefinedn(undefined)",
                                    "default_action": { "type": "web_url", "url": "https://ssfkj.com/profile", "messenger_extensions": true, "webview_height_ratio": "tall", "fallback_url": "https://ssfkj.com/profile" }
                                    , "buttons": [{ "type": "payload", "payload": "DEL__PA_undefined", "title": "View more" }
                                    ]
                                }]
                        }
                    }
                });

But the bot is sending nothing. What is wrong in my code?


Solution

  • My problem was on this level :

    "buttons": [{ "type": "payload", "payload": "DEL__PA_undefined", "title": "View more" }]
    

    The

    type property

    should have the value

    postback

    not

    payload