UrekD / Telegram-To-Discord

Mirror all messages from Telegram channels to Discord via a webhook also translate any message that is not in English.
51 stars 12 forks source link

event.message.sender.username is not None: #14

Closed jimmycapizzi closed 1 year ago

jimmycapizzi commented 1 year ago
Unhandled exception on handler
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/telethon/client/updates.py", line 497, in _dispatch_update
    await callback(event)
  File "//main.py", line 72, in handler
    if event.message.sender.username is not None:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'username'

This happens when I run in in a venv and also in a docker image.... I am on debian sid

Thank you

UrekD commented 1 year ago

Hello,

It looks like the sender has no username could be chat related since I'm not sure how everything works. If it's not something you wish to have just use the second condition.

UrekD commented 1 year ago

Closing due to inactivity...