@@ -1053,7 +1053,7 @@ async def logs(self, ctx, *, user: User = None):
1053
1053
thread = ctx .thread
1054
1054
if not thread :
1055
1055
raise commands .MissingRequiredArgument (SimpleNamespace (name = "member" ))
1056
- user = thread .recipient or await self .bot .fetch_user (thread .id )
1056
+ user = thread .recipient or await self .bot .get_or_fetch_user (thread .id )
1057
1057
1058
1058
default_avatar = "https://cdn.discordapp.com/embed/avatars/0.png"
1059
1059
icon_url = getattr (user , "avatar_url" , default_avatar )
@@ -1510,15 +1510,12 @@ async def blocked(self, ctx):
1510
1510
logger .debug ("No longer blocked, user %s." , id_ )
1511
1511
continue
1512
1512
1513
- user = self .bot .get_user (int (id_ ))
1514
- if user :
1515
- users .append ((user .mention , reason ))
1513
+ try :
1514
+ user = await self .bot .get_or_fetch_user (int (id_ ))
1515
+ except discord .NotFound :
1516
+ users .append ((id_ , reason ))
1516
1517
else :
1517
- try :
1518
- user = await self .bot .fetch_user (id_ )
1519
- users .append ((user .mention , reason ))
1520
- except discord .NotFound :
1521
- users .append ((id_ , reason ))
1518
+ users .append ((user .mention , reason ))
1522
1519
1523
1520
blocked_roles = list (self .bot .blocked_roles .items ())
1524
1521
for id_ , reason in blocked_roles :
@@ -1858,7 +1855,7 @@ async def repair(self, ctx):
1858
1855
user_id = match_user_id (message .embeds [0 ].footer .text , any_string = True )
1859
1856
other_recipients = match_other_recipients (ctx .channel .topic )
1860
1857
for n , uid in enumerate (other_recipients ):
1861
- other_recipients [n ] = self . bot . get_user ( uid ) or await self .bot .fetch_user (uid )
1858
+ other_recipients [n ] = await self .bot .get_or_fetch_user (uid )
1862
1859
1863
1860
if user_id != - 1 :
1864
1861
recipient = self .bot .get_user (user_id )
@@ -1911,7 +1908,7 @@ async def repair(self, ctx):
1911
1908
1912
1909
other_recipients = match_other_recipients (ctx .channel .topic )
1913
1910
for n , uid in enumerate (other_recipients ):
1914
- other_recipients [n ] = self . bot . get_user ( uid ) or await self .bot .fetch_user (uid )
1911
+ other_recipients [n ] = await self .bot .get_or_fetch_user (uid )
1915
1912
1916
1913
if recipient is None :
1917
1914
self .bot .threads .cache [user .id ] = thread = Thread (
0 commit comments