diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eeac963fa3ed..078f3d961c0a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -21,6 +21,8 @@ Removed Fixed ----- +- fixed bug that occurred when sending ``elements:`` through a channel that doesn't support them + [1.2.5] - 2019-08-26 ^^^^^^^^^^^^^^^^^^^^ diff --git a/rasa/core/channels/channel.py b/rasa/core/channels/channel.py index c10ff1884377..483b94e23ec5 100644 --- a/rasa/core/channels/channel.py +++ b/rasa/core/channels/channel.py @@ -244,12 +244,15 @@ async def send_elements( Default implementation will just post the elements as a string.""" + # we can't pass the empty "buttons" key of the message through to send_text_with_buttons() + kwargs.pop("buttons", None) + for element in elements: element_msg = "{title} : {subtitle}".format( title=element.get("title", ""), subtitle=element.get("subtitle", "") ) await self.send_text_with_buttons( - recipient_id, element_msg, element.get("buttons", [], **kwargs) + recipient_id, element_msg, element.get("buttons", []), **kwargs ) async def send_custom_json(