aboutsummaryrefslogtreecommitdiffstats
path: root/bot/converters.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/converters.py')
-rw-r--r--bot/converters.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/bot/converters.py b/bot/converters.py
index 962416238..f350e863e 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -568,12 +568,11 @@ class Infraction(Converter):
infractions = await ctx.bot.api_client.get("bot/infractions", params=params)
if not infractions:
- await ctx.send(
- ":x: Couldn't find most recent infraction; you have never given an infraction."
+ raise BadArgument(
+ "Couldn't find most recent infraction; you have never given an infraction."
)
- return None
-
- return infractions[0]
+ else:
+ return infractions[0]
else:
return ctx.bot.api_client.get(f"bot/infractions/{arg}")