Skip to content

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

@n0str

Description

@n0str

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions