aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/cogs/moderation/management.py6
-rw-r--r--bot/converters.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index 37bdb1934..20ff25ba1 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -9,7 +9,7 @@ from discord.ext import commands
from discord.ext.commands import Context
from bot import constants
-from bot.converters import InfractionSearchQuery, string
+from bot.converters import InfractionSearchQuery, allowed_strings
from bot.pagination import LinePaginator
from bot.utils import time
from bot.utils.checks import in_channel_check, with_role_check
@@ -51,8 +51,8 @@ class ModManagement(commands.Cog):
async def infraction_edit(
self,
ctx: Context,
- infraction_id: t.Union[int, string("l", "last", "recent")],
- duration: t.Union[utils.Expiry, string("p", "permanent"), None],
+ infraction_id: t.Union[int, allowed_strings("l", "last", "recent")],
+ duration: t.Union[utils.Expiry, allowed_strings("p", "permanent"), None],
*,
reason: str = None
) -> None:
diff --git a/bot/converters.py b/bot/converters.py
index 2cfc42903..8d2ab7eb8 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -15,11 +15,11 @@ from discord.ext.commands import BadArgument, Context, Converter
log = logging.getLogger(__name__)
-def string(*values, preserve_case: bool = False) -> t.Callable[[str], str]:
+def allowed_strings(*values, preserve_case: bool = False) -> t.Callable[[str], str]:
"""
Return a converter which only allows arguments equal to one of the given values.
- Unless preserve_case is True, the argument is converter to lowercase. All values are then
+ Unless preserve_case is True, the argument is converted to lowercase. All values are then
expected to have already been given in lowercase too.
"""
def converter(arg: str) -> str: