@@ -1042,7 +1042,7 @@ async def logs(self, ctx, *, user: User = None):
1042
1042
thread = ctx .thread
1043
1043
if not thread :
1044
1044
raise commands .MissingRequiredArgument (SimpleNamespace (name = "member" ))
1045
- user = thread .recipient or await self .bot . fetch_user ( thread .id )
1045
+ user = thread .recipient or await get_or_fetch_user ( self .bot , thread .id )
1046
1046
1047
1047
default_avatar = "https://cdn.discordapp.com/embed/avatars/0.png"
1048
1048
icon_url = getattr (user , "avatar_url" , default_avatar )
@@ -1492,15 +1492,12 @@ async def blocked(self, ctx):
1492
1492
logger .debug ("No longer blocked, user %s." , id_ )
1493
1493
continue
1494
1494
1495
- user = self .bot .get_user (int (id_ ))
1496
- if user :
1497
- users .append ((user .mention , reason ))
1495
+ try :
1496
+ user = await get_or_fetch_user (self .bot , id = int (id_ ))
1497
+ except discord .NotFound :
1498
+ users .append ((id_ , reason ))
1498
1499
else :
1499
- try :
1500
- user = await self .bot .fetch_user (id_ )
1501
- users .append ((user .mention , reason ))
1502
- except discord .NotFound :
1503
- users .append ((id_ , reason ))
1500
+ users .append ((user .mention , reason ))
1504
1501
1505
1502
blocked_roles = list (self .bot .blocked_roles .items ())
1506
1503
for id_ , reason in blocked_roles :
@@ -1840,7 +1837,7 @@ async def repair(self, ctx):
1840
1837
user_id = match_user_id (message .embeds [0 ].footer .text )
1841
1838
other_recipients = match_other_recipients (ctx .channel .topic )
1842
1839
for n , uid in enumerate (other_recipients ):
1843
- other_recipients [n ] = self . bot . get_user ( uid ) or await self .bot . fetch_user ( uid )
1840
+ other_recipients [n ] = await get_or_fetch_user ( self .bot , id = uid )
1844
1841
1845
1842
if user_id != - 1 :
1846
1843
recipient = self .bot .get_user (user_id )
@@ -1893,7 +1890,7 @@ async def repair(self, ctx):
1893
1890
1894
1891
other_recipients = match_other_recipients (ctx .channel .topic )
1895
1892
for n , uid in enumerate (other_recipients ):
1896
- other_recipients [n ] = self . bot . get_user ( uid ) or await self .bot . fetch_user ( uid )
1893
+ other_recipients [n ] = await get_or_fetch_user ( self .bot , id = uid )
1897
1894
1898
1895
if recipient is None :
1899
1896
self .bot .threads .cache [user .id ] = thread = Thread (
0 commit comments