mongo storage to reduce PeerIdInvalid errors
Currently, all peer data are stored in the memory. Hence it is cleared in every restart. So better to save them in the database and fetch them when needed. With that, we can reduce PeerIdInvalid errors and increase user happiness :)
https://github.com/pyrogram/pyrogram/blob/master/pyrogram/storage/storage.py
🤧 what are you gonna do about Auth key duplication error?
will it be hard to handle?
not really, all it will need is new authentication method, something like, it extracts auth_key, dc_id, user_id and other stuffs from given pyro session key and update that in Mongo Storage. If new authentication method is implement correctly you can move all env to a collection in database. Maybe play around with this Mongo Storage Base
bash setup kinda thing. 🤒
NIce. it's very good.
PeerIdInvalid can also be reduce by using (link to profile) mention and extract user id from mention instead of using user id directly
Before I was also confused about this but after testing it's working and not won't raise PeerIdInvalid