[Mod] Default days in [p]ban command are now configurable (#2930)

* Initial Commit

* Added changelog

* Update redbot/cogs/mod/settings.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/cogs/mod/settings.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/cogs/mod/settings.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* Update redbot/cogs/mod/settings.py

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* Rename 2930.enhance.rst.txt to 2930.enhance.rst

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Ianardo DiCaprio
2020-01-23 19:37:11 +00:00
committed by jack1142
parent 40c0d8d83b
commit 1755334124
4 changed files with 37 additions and 8 deletions

View File

@@ -218,15 +218,17 @@ class KickBanMixin(MixinMeta):
self,
ctx: commands.Context,
user: discord.Member,
days: Optional[int] = 0,
days: Optional[int] = None,
*,
reason: str = None,
):
"""Ban a user from this server and optionally delete days of messages.
If days is not a number, it's treated as the first word of the reason.
Minimum 0 days, maximum 7. Defaults to 0."""
Minimum 0 days, maximum 7. If not specified, defaultdays setting will be used instead."""
guild = ctx.guild
if days is None:
days = await self.settings.guild(guild).default_days()
result = await self.ban_user(
user=user, ctx=ctx, days=days, reason=reason, create_modlog_case=True
)