usernein / pyromod

A monkeypatcher add-on for Pyrogram
https://pyromod.pauxis.dev/
GNU Lesser General Public License v3.0
223 stars 70 forks source link

Suggestion: if i write username instead of chat_id it could convert it to chat_id #15

Closed Eikosa closed 10 months ago

Eikosa commented 1 year ago

if i write username instead of chat_id it should convert it to chat_id

client.get_chat(chat_id) will work i think

usernein commented 10 months ago

I appreciate the suggestion!

Instead of calling get_chat, i think it's better to save the specified usernames on the listener and simply compare chat.username when listener is processing messages. This way we avoid extra calls to the API

It's planned for pyrogram v3.1!

usernein commented 10 months ago

Implemented in pyromod v3.1.0!!