Open mumbaigirl opened 8 months ago
@thatcuteseller did you managed to solve this bug? Ive got the same issue.
@thatcuteseller did you managed to solve this bug? Ive got the same issue.
@Matilii No , I had to stop the server to prevent it from sending WhatsApp messages, I have raised an issue ,the author @maharanasarkar will look into it.
@Matilii By the way , are you able to connect telegram.py with RASA, on a live server not using ngrok?
@maharanasarkar kuthe aahe tumhi?
@thatcuteseller
yes i was able to host the Rasa bot and then use the whatsapp connector. Without using ngrok on the hosted server
Hello everyone, a little late but I think I figured out why this behavior is happening.
Following this stackoverflow problem:
The connector is not returning a 200 ok code to WhatsApp but is returning a 204 code
You can see this in this fragment of code in the whatsapp.py:
`@whatsapp_webhook.route("/webhook", methods=["POST"]) async def message(request: Request) -> HTTPResponse: sender = self.client.get_mobile(request.json)
text = self.get_message(request.json)
logger.debug(text)
out_channel = self.get_output_channel()
if sender is not None and message is not None:
metadata = self.get_metadata(request)
try:
await on_new_message(
UserMessage(
text,
out_channel,
sender,
input_channel=self.name(),
metadata=metadata,
)
)
except Exception as e:
logger.error(f"Exception when trying to handle message.{e}")
logger.debug(e, exc_info=True)
if self.debug_mode:
raise
else:
logger.debug("Invalid message")
return response.text("", status=204) # You should change this to 200`
I hope this could help someone in the future
The Rasa WhatsApp connector is currently experiencing a bug where it sends messages automatically without the user initiating a conversation.
Steps to Reproduce:
Keep the Rasa server running.
rasa run --m models --enable-api --cors '*' --debug
Wait for a period of time without any user interaction. Users receive messages from the Rasa WhatsApp connector without initiating a conversation.Below is the NGINX configuration