Fix usage in [p]filter's commands, make commands consistent (#4599)

* Make *words a required argument.

* Also make delete consistant, and name not positional
This commit is contained in:
bobloy 2021-01-20 18:23:16 -05:00 committed by GitHub
parent 0358055cce
commit 41e980c517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,7 +183,7 @@ class Filter(commands.Cog):
except discord.Forbidden: except discord.Forbidden:
await ctx.send(_("I can't send direct messages to you.")) await ctx.send(_("I can't send direct messages to you."))
@_filter_channel.command("add") @_filter_channel.command(name="add", require_var_positional=True)
async def filter_channel_add(self, ctx: commands.Context, *words: str): async def filter_channel_add(self, ctx: commands.Context, *words: str):
"""Add words to the filter. """Add words to the filter.
@ -205,7 +205,7 @@ class Filter(commands.Cog):
else: else:
await ctx.send(_("Words already in the filter.")) await ctx.send(_("Words already in the filter."))
@_filter_channel.command("remove") @_filter_channel.command(name="delete", aliases=["remove", "del"], require_var_positional=True)
async def filter_channel_remove(self, ctx: commands.Context, *words: str): async def filter_channel_remove(self, ctx: commands.Context, *words: str):
"""Remove words from the filter. """Remove words from the filter.
@ -227,7 +227,7 @@ class Filter(commands.Cog):
else: else:
await ctx.send(_("Those words weren't in the filter.")) await ctx.send(_("Those words weren't in the filter."))
@_filter.command(name="add") @_filter.command(name="add", require_var_positional=True)
async def filter_add(self, ctx: commands.Context, *words: str): async def filter_add(self, ctx: commands.Context, *words: str):
"""Add words to the filter. """Add words to the filter.
@ -249,7 +249,7 @@ class Filter(commands.Cog):
else: else:
await ctx.send(_("Those words were already in the filter.")) await ctx.send(_("Those words were already in the filter."))
@_filter.command(name="delete", aliases=["remove", "del"]) @_filter.command(name="delete", aliases=["remove", "del"], require_var_positional=True)
async def filter_remove(self, ctx: commands.Context, *words: str): async def filter_remove(self, ctx: commands.Context, *words: str):
"""Remove words from the filter. """Remove words from the filter.