Fix some bugs and add command to list invite links

This commit is contained in:
Tulir Asokan
2022-03-28 15:49:08 +03:00
parent 8befb664b6
commit a3f4e25101
3 changed files with 106 additions and 18 deletions
+2 -1
View File
@@ -24,6 +24,7 @@ from telethon.tl.types import (
ChatPhoto,
ChatPhotoEmpty,
InputPeerPhotoFileLocation,
InputPeerUser,
PeerChannel,
PeerChat,
PeerUser,
@@ -414,7 +415,7 @@ class Puppet(DBPuppet, BasePuppet):
@staticmethod
def get_id_from_peer(peer: TypePeer | User | Channel) -> TelegramID:
if isinstance(peer, PeerUser):
if isinstance(peer, (PeerUser, InputPeerUser)):
return TelegramID(peer.user_id)
elif isinstance(peer, PeerChannel):
return TelegramID(peer.channel_id)