Nekmo / telegram-upload

Upload and download files from Telegram up to 4 GiB using your account
MIT License
1.09k stars 237 forks source link

fix: enable entity from existing entities list #171

Closed adripo closed 1 year ago

adripo commented 2 years ago

fix #163 #118

As explained in the note here: https://docs.telethon.dev/en/stable/concepts/entities.html?highlight=client.get_dialogs()#entities

To “encounter” an ID, you would have to “find it” like you would in the normal app. If the peer is in your dialogs, you would need to client.get_dialogs(). If the peer is someone in a group, you would similarly client.get_participants(group).

Nekmo commented 1 year ago

I have reviewed the code and the use of await self.get_dialogs() is unnecessary. The code doesn't follow the Python style rules. You should never use except without defining an exception. It is also preferable to validate numbers without using exceptions.

The bug has been fixed in the issue #118. I hope to be able to review the pull request next time sooner... thank you very much for your pull request as well.

adripo commented 1 year ago

@Nekmo thanks for the feedback, very appreciated. As you have seen this PR was opened almost a year ago and I'm happy that it was fixed in the meantime.