feat(client): added get() method in PeersIndex

This commit is contained in:
teidesu 2022-05-11 13:17:23 +03:00
parent 3b15c66fc3
commit 0a217108ba

View file

@ -45,4 +45,15 @@ export class PeersIndex {
return r
}
get(peer: tl.TypePeer): tl.TypeUser | tl.TypeChat {
switch (peer._) {
case 'peerUser':
return this.user(peer.userId)
case 'peerChat':
return this.chat(peer.chatId)
case 'peerChannel':
return this.chat(peer.channelId)
}
}
}