mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: fix peer_id saved as raw id in usernames table
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
375d165a9c
commit
1d0ad21328
1 changed files with 2 additions and 2 deletions
|
|
@ -576,7 +576,7 @@ class Client(Methods):
|
||||||
)
|
)
|
||||||
if peer.usernames is not None and len(peer.usernames) > 1:
|
if peer.usernames is not None and len(peer.usernames) > 1:
|
||||||
for uname in peer.usernames:
|
for uname in peer.usernames:
|
||||||
usernames.append((peer.id, uname.username.lower()))
|
usernames.append((peer_id, uname.username.lower()))
|
||||||
phone_number = peer.phone
|
phone_number = peer.phone
|
||||||
peer_type = "bot" if peer.bot else "user"
|
peer_type = "bot" if peer.bot else "user"
|
||||||
elif isinstance(peer, (raw.types.Chat, raw.types.ChatForbidden)):
|
elif isinstance(peer, (raw.types.Chat, raw.types.ChatForbidden)):
|
||||||
|
|
@ -593,7 +593,7 @@ class Client(Methods):
|
||||||
)
|
)
|
||||||
if peer.usernames is not None and len(peer.usernames) > 1:
|
if peer.usernames is not None and len(peer.usernames) > 1:
|
||||||
for uname in peer.usernames:
|
for uname in peer.usernames:
|
||||||
usernames.append((peer.id, uname.username.lower()))
|
usernames.append((peer_id, uname.username.lower()))
|
||||||
peer_type = "channel" if peer.broadcast else "supergroup"
|
peer_type = "channel" if peer.broadcast else "supergroup"
|
||||||
elif isinstance(peer, raw.types.ChannelForbidden):
|
elif isinstance(peer, raw.types.ChannelForbidden):
|
||||||
peer_id = utils.get_channel_id(peer.id)
|
peer_id = utils.get_channel_id(peer.id)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue