Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Can not send quick replies trough convo.ask() #1699

Closed
adantoscano opened this issue Jun 24, 2019 · 2 comments
Closed

Can not send quick replies trough convo.ask() #1699

adantoscano opened this issue Jun 24, 2019 · 2 comments

Comments

@adantoscano
Copy link
Contributor

Are you sure this is an issue with the Botkit core module?

Yes

What are you trying to achieve or the steps to reproduce?

I want to create a convo flow to get feedback with quick replies but I always get only the first letter of text field

  convo.ask(
    {
      text: '¿Es correcta la respuesta?',
      quick_replies: [
        {
          title: "Sí",
          payload: "feedback_ok"
        },
        {
          title: "No",
          payload: "feedback_ko"
        }
      ]
    },
    [
      {
        pattern: /sí|si/i,
        type: 'string',
        handler: async (response, convo, bot) => {
          return await bot.say("¿Puedo ayudar en algo más?");
        }
      },
      {
        pattern: /no/i,
        type: 'string',
        handler: async (response, convo, bot) => {
          return await convo.gotoThread("bad_response");
        }
      },
      {
        default: true,
        handler: async (response, convo, bot) => {
          await convo.say("No lo he entendido");
          // start over!
          return await convo.repeat();
        }
      }
    ],
    {}
  );

What was the result you received?

botkit:web OUTGOING > { type: 'message', text: '¿' }

What did you expect?

botkit:web OUTGOING > { text: '¿Es correcta la respuesta?', quick_replies: [ { title: "Sí", payload: "feedback_ok" }, { title: "No", payload: "feedback_ko" } ] }

Context:

  • Botkit version: 4.0.2
  • Messaging Platform: web
  • Node version: 10.15.0
  • Os: Linux
  • Any other relevant information: Botkit FTW!
@Naktibalda
Copy link
Contributor

Duplicate of #1679 and #1664

A temporary workaround: put quick_replies field inside channelData field:

convo.ask({
   text: ['What is your favorite color'],
   channelData: {
     quick_replies: [
        {...}   
     ] 
   }
}, [], 'key');

@adantoscano
Copy link
Contributor Author

Oki, sorry an thanks!

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

No branches or pull requests

2 participants