Pyrofork: fix some derps

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
wulan17 2023-10-25 17:56:05 +07:00
parent e4964e8470
commit 733defe650
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
2 changed files with 4 additions and 4 deletions

View file

@ -640,10 +640,10 @@ class Message(Object, Update):
service_type = enums.MessageServiceType.NEW_CHAT_PHOTO
elif isinstance(action, raw.types.MessageActionRequestedPeer):
if isinstance(action.peer, raw.types.PeerChannel):
channel_shared = int(f"-100{action.peer.channel_id}")
channel_shared = utils.get_channel_id(utils.get_raw_peer_id(action.peer))
service_type = enums.MessageServiceType.ChannelShared
elif isinstance(action.peer, raw.types.PeerChat):
channel_shared = int(f"-100{action.peer.chat_id}")
channel_shared = utils.get_channel_id(utils.get_raw_peer_id(action.peer))
service_type = enums.MessageServiceType.ChannelShared
elif isinstance(action.peer, raw.types.PeerUser):
user_shared = action.peer.user_id

View file

@ -199,8 +199,8 @@ class Story(Object, Update):
media_type = None
else:
media_type = None
if isinstance(peer, raw.types.PeerChannel):
sender_chat = await client.get_chat(peer.channel_id)
if isinstance(peer, raw.types.PeerChannel) or isinstance(peer, raw.types.InputPeerChannel):
sender_chat = await client.get_chat(utils.get_channel_id(peer.channel_id))
elif isinstance(peer, raw.types.InputPeerSelf):
from_user = client.me
else: