So I’m trying to create custom messages for Telegram and Messenger (optimally from a single template). It works perfectly for Telegram, but fails with Messenger. Currently, it looks like this:
domain.yml
utter_link:
- custom:
text: "[Click here]({link})"
parse_mode: markdown
actions.py
class ActionLink(Action):
def name(self) -> Text:
return "action_link"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
dispatcher.utter_message(template="utter_link", link='https://google.com/')
return []
I’ve tried the following but with no luck. I changed actions.py to:
class ActionLink(Action):
def name(self) -> Text:
return "action_link"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
custom = {} # format missing here
dispatcher.utter_message(json_message=custom)
return []
Any advice on how I could change it to work for both (possible more channels) from a single template?