Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Commit

Permalink
fix: fix custom key in output channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Cote-Boucher committed Jul 1, 2020
1 parent 29ed2fe commit 63ab95f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion rasa_addons/core/channels/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ def _message(
"quick_replies": quick_replies,
"buttons": buttons,
"attachment": attachment,
"custom": custom,
"metadata": metadata,
}

if custom: obj.update(custom)

# filter out any values that are `None`
return utils.remove_none_values(obj)

Expand Down
10 changes: 5 additions & 5 deletions rasa_addons/core/channels/webchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ async def send_custom_json(
) -> None:
"""Sends custom json to the output"""

json_message.setdefault("room", recipient_id)

await self.sio.emit(
self.bot_message_evt, **json_message, metadata=kwargs.get("metadata", {})
)
message = {
**json_message,
"metadata": kwargs.get("metadata", {}),
}
await self._send_message(recipient_id, message)

async def send_attachment(
self, recipient_id: Text, attachment: Dict[Text, Any], **kwargs: Any
Expand Down

0 comments on commit 63ab95f

Please sign in to comment.