aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Mark <[email protected]>2019-12-11 22:50:44 -0800
committerGravatar GitHub <[email protected]>2019-12-11 22:50:44 -0800
commit38129d632648da21726a8158b76676695fd0b512 (patch)
tree975e26837ff663b0c7edea936e108af72551f52f
parentClean: support specifying a channel different than the context's (diff)
Clean: allow amount argument to be skipped
This make the channel specifiable without the amount. Co-Authored-By: scragly <[email protected]>
-rw-r--r--bot/cogs/clean.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/cogs/clean.py b/bot/cogs/clean.py
index 312c7926d..ed1962565 100644
--- a/bot/cogs/clean.py
+++ b/bot/cogs/clean.py
@@ -180,25 +180,25 @@ class Clean(Cog):
@clean_group.command(name="user", aliases=["users"])
@with_role(*MODERATION_ROLES)
- async def clean_user(self, ctx: Context, user: User, amount: int = 10, channel: TextChannel = None) -> None:
+ async def clean_user(self, ctx: Context, user: User, amount: Optional[int] = 10, channel: TextChannel = None) -> None:
"""Delete messages posted by the provided user, stop cleaning after traversing `amount` messages."""
await self._clean_messages(amount, ctx, user=user, channel=channel)
@clean_group.command(name="all", aliases=["everything"])
@with_role(*MODERATION_ROLES)
- async def clean_all(self, ctx: Context, amount: int = 10, channel: TextChannel = None) -> None:
+ async def clean_all(self, ctx: Context, amount: Optional[int] = 10, channel: TextChannel = None) -> None:
"""Delete all messages, regardless of poster, stop cleaning after traversing `amount` messages."""
await self._clean_messages(amount, ctx, channel=channel)
@clean_group.command(name="bots", aliases=["bot"])
@with_role(*MODERATION_ROLES)
- async def clean_bots(self, ctx: Context, amount: int = 10, channel: TextChannel = None) -> None:
+ async def clean_bots(self, ctx: Context, amount: Optional[int] = 10, channel: TextChannel = None) -> None:
"""Delete all messages posted by a bot, stop cleaning after traversing `amount` messages."""
await self._clean_messages(amount, ctx, bots_only=True, channel=channel)
@clean_group.command(name="regex", aliases=["word", "expression"])
@with_role(*MODERATION_ROLES)
- async def clean_regex(self, ctx: Context, regex: str, amount: int = 10, channel: TextChannel = None) -> None:
+ async def clean_regex(self, ctx: Context, regex: str, amount: Optional[int] = 10, channel: TextChannel = None) -> None:
"""Delete all messages that match a certain regex, stop cleaning after traversing `amount` messages."""
await self._clean_messages(amount, ctx, regex=regex, channel=channel)