Skip to content

Commit

Permalink
Merge pull request #5181 from RasaHQ/twilio-images
Browse files Browse the repository at this point in the history
added twilio image support in output channel
  • Loading branch information
tmbo authored Feb 4, 2020
2 parents 80ab6e8 + e860e90 commit 9f74e94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/4682.enhancement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support to send images with the twilio output channel.
12 changes: 12 additions & 0 deletions rasa/core/channels/twilio.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ async def send_text_message(
message_data.update({"body": message_part})
await self._send_message(message_data)

async def send_image_url(
self, recipient_id: Text, image: Text, **kwargs: Any
) -> None:
"""Sends an image."""

message_data = {
"to": recipient_id,
"from_": self.twilio_number,
"media_url": [image],
}
await self._send_message(message_data)

async def send_custom_json(
self, recipient_id: Text, json_message: Dict[Text, Any], **kwargs: Any
) -> None:
Expand Down

0 comments on commit 9f74e94

Please sign in to comment.