1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-03 00:53:12 +00:00

fix(cases.py): replace UserConverter with bot.get_user and bot.fetch_user to handle cases where user is not found in cache

This commit is contained in:
kzndotsh 2024-08-28 20:16:55 +00:00
parent 8f0c52bbfb
commit 21da371278

View file

@ -152,7 +152,9 @@ class Cases(ModerationCogBase):
await ctx.send("Case not found.", delete_after=30)
return
user = await commands.UserConverter().convert(ctx, str(case.case_user_id))
user = self.bot.get_user(case.case_user_id)
if user is None:
user = await self.bot.fetch_user(case.case_user_id)
await self._handle_case_response(ctx, case, "viewed", case.case_reason, user)