From c9198d0a2f24e19a8ce7025039222fbeede53b30 Mon Sep 17 00:00:00 2001 From: Tom Coquereau Date: Fri, 12 Mar 2021 14:28:47 +0100 Subject: [PATCH] Add better data input management for m botframwork --- rasa/core/channels/botframework.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/rasa/core/channels/botframework.py b/rasa/core/channels/botframework.py index a592077ebd4e..e417e3fe1428 100644 --- a/rasa/core/channels/botframework.py +++ b/rasa/core/channels/botframework.py @@ -232,8 +232,18 @@ async def webhook(request: Request) -> HTTPResponse: postdata["serviceUrl"], ) + text = "" + if postdata.get("text"): + text = postdata.get("text") + else: + if postdata.get("value"): + raw_value = postdata.get("value") + if "value" in raw_value: + raw_value = raw_value["value"] + text = json.dumps(raw_value) + user_msg = UserMessage( - text=postdata.get("text", ""), + text=text, output_channel=out_channel, sender_id=postdata["from"]["id"], input_channel=self.name(),