Fix parsing of pinned stories in case of channel

This commit is contained in:
KurimuzonAkuma 2023-11-08 11:24:13 +03:00
parent be19422153
commit a5a44b8310

View File

@ -192,8 +192,12 @@ class Story(Object, Update):
r = await client.invoke(raw.functions.users.GetUsers(id=[raw.types.InputPeerSelf()])) r = await client.invoke(raw.functions.users.GetUsers(id=[raw.types.InputPeerSelf()]))
peer_id = r[0].id peer_id = r[0].id
users.update({i.id: i for i in r}) users.update({i.id: i for i in r})
elif isinstance(peer, (raw.types.InputPeerUser, raw.types.InputPeerChannel)): elif isinstance(peer, raw.types.InputPeerUser):
peer_id = utils.get_input_peer_id(peer) peer_id = utils.get_input_peer_id(peer)
elif isinstance(peer, raw.types.InputPeerChannel):
peer_id = utils.get_input_peer_id(peer)
r = await client.invoke(raw.functions.channels.GetChannels(id=[peer]))
chats.update({peer_id: r.chats[0]})
else: else:
peer_id = utils.get_raw_peer_id(peer) peer_id = utils.get_raw_peer_id(peer)