codex.bot icon indicating copy to clipboard operation
codex.bot copied to clipboard

Channel post. AttributeError: 'NoneType' object has no attribute 'username'

Open n0str opened this issue 3 years ago • 0 comments

When sending message in channel, there are only update_id and channel_post params. No user.

web_protocol.py     :393         log_exception() 	 Error handling request 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/home/app/codexbot/lib/server.py", line 16, in wrapper
    result = await function(self, {
  File "/home/app/codexbot/services/telegram/telegram.py", line 55, in telegram_callback
    await self.send_message_to_app(update)
  File "/home/app/codexbot/services/telegram/telegram.py", line 65, in send_message_to_app
    if update.message.user.username:
AttributeError: 'NoneType' object has no attribute 'username'

n0str avatar Aug 04 '22 06:08 n0str