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

(cherry picked from commit ad6b8662b2)

Co-authored-by: Just-Jojo <62262765+Just-Jojo@users.noreply.github.com>

Co-authored-by: Just-Jojo <62262765+Just-Jojo@users.noreply.github.com>
This commit is contained in:
Red-GitHubBot
2021-09-08 20:13:24 +02:00
committed by GitHub
parent e8ece55501
commit 05a25b1f03

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`