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

I only get one whatsapp answer via dialogflow instead of multiple replies #2

Open
gabrielbruschi opened this issue Sep 16, 2019 · 0 comments

Comments

@gabrielbruschi
Copy link

How do I get multiple 'text answers' in whatsApp? When I add more than one 'text response' in intents they work normally in the dialogFlow console.

But when I repeat the same question on whatsapp I get only one answer box instead of 3, for example, that I had created.

I tried this, but the messages just dont come to my bot on wpp.

def fetch_reply(query, session_id):
    response = detect_intent_from_text(query, session_id)
    return response.fulfillment_messages

And my new route look something like this:

@app.route("/sms", methods=['POST'])
def sms_reply():
    """Respond to incoming calls with a simple text message."""
    # Fetch the message
    msg = request.form.get('Body')
    phone_no = request.form.get('From')
    replies = fetch_reply(msg, phone_no)

    # Create reply
    resp = MessagingResponse()
    for reply in replies:
        resp.message(reply.text)
    return str(resp)
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

1 participant