Exception in Facebook send message


I have implemented a bot. It is working good with console channel.

I tried to add Messenger channel. RASA core gots the message, but unable to send answer. Main problem is the exception, but the message is a bit strange, because i dont have any custom code: “Make sure to fix the exception in your custom code”

2018-08-23 10:17:26 INFO     rasa_core.channels.facebook - Sending message: Hey! How are you?
2018-08-23 10:17:26 ERROR    rasa_core.processor - Encountered an exception while running action 'utter_greet'. Bot will continue, but the actions events are lost. Make sure to fix the exception in your custom code.
2018-08-23 10:17:26 ERROR    rasa_core.processor - send() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\processor.py", line 311, in _run_action
    events = action.run(dispatcher, tracker, self.domain)
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\actions\action.py", line 72, in run
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\dispatcher.py", line 159, in utter_template
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\dispatcher.py", line 68, in utter_response
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\dispatcher.py", line 85, in utter_message
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\channels\facebook.py", line 136, in send_text_message
    self.send(recipient_id, elements.Text(text=message))
  File "D:\ujja\tools\Python36\lib\site-packages\rasa_core\channels\facebook.py", line 128, in send
TypeError: send() takes 3 positional arguments but 4 were given

what version are you running?

$ pip list | grep rasa

  • rasa-addons 0.3.2
  • rasa-core 0.10.4
  • rasa-demo 1.0
  • rasa-nlu 0.13.1

My Python knowledge is some days old, but i suppose

facebook.py", line 128: self.messenger_client.send(element.to_dict(), {“sender”: {“id”: recipient_id}}, ‘RESPONSE’) 'element.to_dict() ’ is somehow splitted to 2 variables.

Which version of fb messenger do you have installed? It should be fbmessenger==5.2.0. If this is what you have installed and the problem is still persisting, please create an issue on Rasa Core

That was the problem, thank you!