SaveRestrictedContentBot
SaveRestrictedContentBot copied to clipboard
Error
This only happens to me with new channels created
Failed to save: https://t.me/c/2213281111/72
Error: Peer id invalid: -1002213281111
same here ... but it is not only a problem of this bot, other bots have this problem too
Fix, add this to pyroplug.py:
# Fix: Error: Peer id invalid
import pyrogram.utils as utils
def get_peer_type(peer_id: int) -> str:
print('get_peer_type call')
peer_id_str = str(peer_id)
if not peer_id_str.startswith("-"):
return "user"
elif peer_id_str.startswith("-100"):
return "channel"
else:
return "chat"
utils.get_peer_type = get_peer_type
Please add pull requests
Two answer peer id invalid And fix version post
Thanks 😊
Fix, add this to pyroplug.py:
# Fix: Error: Peer id invalid import pyrogram.utils as utils def get_peer_type(peer_id: int) -> str: print('get_peer_type call') peer_id_str = str(peer_id) if not peer_id_str.startswith("-"): return "user" elif peer_id_str.startswith("-100"): return "channel" else: return "chat" utils.get_peer_type = get_peer_type
better solution (no garantee -> works for me):
use this pyrogram version: https://github.com/timgahmen/pyrogram/archive/refs/tags/v2.0.106+ID_Fix).zip
updated requirements.txt https://github.com/vasusen-code/SaveRestrictedContentBot/pull/167
En que parte agrego eso arriba abajo en que lao
Muy buena tu solución me funcionó