Skip to content

Commit

Permalink
Add better data input management for m botframwork
Browse files Browse the repository at this point in the history
  • Loading branch information
thaume committed Mar 12, 2021
1 parent 2aade32 commit c9198d0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion rasa/core/channels/botframework.py
Expand Up @@ -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(),
Expand Down

0 comments on commit c9198d0

Please sign in to comment.