File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -73,13 +73,23 @@ async def resolve_peer(
73
73
try :
74
74
return await self .storage .get_peer_by_username (peer_id )
75
75
except KeyError :
76
- await self .invoke (
76
+ r = await self .invoke (
77
77
raw .functions .contacts .ResolveUsername (
78
78
username = peer_id
79
79
)
80
80
)
81
81
82
- return await self .storage .get_peer_by_username (peer_id )
82
+ return await self .storage .get_peer_by_id (
83
+ getattr (
84
+ r .peer ,
85
+ "user_id" ,
86
+ getattr (
87
+ r .peer ,
88
+ "channel_id" ,
89
+ peer_id
90
+ )
91
+ )
92
+ )
83
93
else :
84
94
try :
85
95
return await self .storage .get_peer_by_phone_number (peer_id )
Original file line number Diff line number Diff line change @@ -64,6 +64,8 @@ async def get_users(
64
64
)
65
65
66
66
users = types .List ()
67
+ if not r :
68
+ return users
67
69
68
70
for i in r :
69
71
users .append (types .User ._parse (self , i ))
You can’t perform that action at this time.
0 commit comments