mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrofork: Refactor Story.sender_chat
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
bb9abd880e
commit
454f155845
1 changed files with 7 additions and 1 deletions
|
|
@ -212,7 +212,13 @@ class Story(Object, Update):
|
|||
else:
|
||||
media_type = None
|
||||
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))
|
||||
chat_id = utils.get_channel_id(peer.channel_id)
|
||||
chat = await client.invoke(
|
||||
raw.functions.channels.GetChannels(
|
||||
id=[await client.resolve_peer(chat_id)]
|
||||
)
|
||||
)
|
||||
sender_chat = types.Chat._parse_chat(client, chat.chats[0])
|
||||
elif isinstance(peer, raw.types.InputPeerSelf):
|
||||
from_user = client.me
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue