Skip to content

Commit 485ab5a

Browse files
authored
Remove user fetching from blocked command (#3242)
We already have all the information we need to mention a user (their id) and fetching the information from discord will lead to rate limiting and extremely poor performance on large block lists for no gain.
1 parent c8b2522 commit 485ab5a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cogs/modmail.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,13 +1665,7 @@ async def blocked(self, ctx):
16651665
self.bot.blocked_users.pop(str(id_))
16661666
logger.debug("No longer blocked, user %s.", id_)
16671667
continue
1668-
1669-
try:
1670-
user = await self.bot.get_or_fetch_user(int(id_))
1671-
except discord.NotFound:
1672-
users.append((id_, reason))
1673-
else:
1674-
users.append((user.mention, reason))
1668+
users.append((f"<@{id_}>", reason))
16751669

16761670
blocked_roles = list(self.bot.blocked_roles.items())
16771671
for id_, reason in blocked_roles:

0 commit comments

Comments
 (0)