Skip to content

Commit

Permalink
[WarnSystem] Patch call_warn for the ban_days argument
Browse files Browse the repository at this point in the history
  • Loading branch information
laggron42 committed Nov 25, 2021
1 parent 60f0d22 commit 6844d62
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions warnsystem/warnsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def __init__(self, bot):
__author__ = ["retke (El Laggron)"]

# helpers
async def call_warn(self, ctx, level, member, reason=None, time=None):
async def call_warn(self, ctx, level, member, reason=None, time=None, ban_days=None):
"""No need to repeat, let's do what's common to all 5 warnings."""
reason = await self.api.format_reason(ctx.guild, reason)
if reason and len(reason) > 2000: # embed limits
Expand All @@ -243,7 +243,15 @@ async def call_warn(self, ctx, level, member, reason=None, time=None):
)
return
try:
fail = await self.api.warn(ctx.guild, [member], ctx.author, level, reason, time)
fail = await self.api.warn(
guild=ctx.guild,
members=[member],
author=ctx.author,
level=level,
reason=reason,
time=time,
ban_days=ban_days,
)
if fail:
raise fail[0]
except errors.MissingPermissions as e:
Expand Down

0 comments on commit 6844d62

Please sign in to comment.