Hi dear sir
I just get an error from telegram channel, any idea? thanks
Traceback (most recent call last):
File “/opt/venv/lib/python3.7/site-packages/sanic/app.py”, line 973, in handle_request
response = await response
File “/opt/venv/lib/python3.7/site-packages/rasa/core/channels/telegram.py”, line 218, in message
if self._is_user_message(msg):
File “/opt/venv/lib/python3.7/site-packages/rasa/core/channels/telegram.py”, line 177, in _is_user_message
return message.text is not None
AttributeError: ‘NoneType’ object has no attribute ‘text’
File "/opt/venv/lib/python3.7/site-packages/rasa/core/channels/telegram.py",
msg = update.message <-- msg could be None here !!
if self._is_user_message(msg):
text = msg.text.replace("/bot", "")
elif self._is_location(msg):
text = '{{"lng":{0}, "lat":{1}}}'.format(
msg.location.longitude, msg.location.latitude
)
else:
return response.text("success")
According to telegram bot api, the update.message is option, which means msg could be None, in this case will trigger the exception.
And telegram will resend the message repeatly.
So, I suggest that, here should check the if update.message == None then just return response.text(“success”)