[Warnings] Allow for 0 point warnings (#5178)

This commit is contained in:
Just-Jojo 2021-07-03 19:52:59 -04:00 committed by GitHub
parent 9d35df2048
commit ad6b8662b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,8 +395,8 @@ class Warnings(commands.Cog):
if (reason_type := registered_reasons.get(reason.lower())) is None:
msg = _("That is not a registered reason!")
if custom_allowed:
if points <= 0:
return await ctx.send(_("You cannot apply 0 or less points."))
if points < 0:
return await ctx.send(_("You cannot apply negative points."))
reason_type = {"description": reason, "points": points}
else:
# logic taken from `[p]permissions canrun`