From 91e57c6555febab041e5d78a0803ba6f6a442e10 Mon Sep 17 00:00:00 2001 From: alwayscompiling Date: Wed, 7 Dec 2022 21:52:36 -0500 Subject: [PATCH] Standardize autocomplete function names. --- cogs/commands/delete.py | 10 +++++----- cogs/commands/refresh.py | 2 +- cogs/commands/set.py | 2 +- cogs/commands/update.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cogs/commands/delete.py b/cogs/commands/delete.py index a96a6ed..0634180 100644 --- a/cogs/commands/delete.py +++ b/cogs/commands/delete.py @@ -27,7 +27,7 @@ class DeleteCog(commands.Cog, name="Table Management"): def __init__(self) -> None: """ - Default constructor for DeleteCog class. Sets internal bot variable. + Default constructor for DeleteCog class. """ @nextcord.slash_command(default_member_permissions=nextcord.Permissions(administrator=True)) @@ -201,7 +201,7 @@ class DeleteCog(commands.Cog, name="Table Management"): @from_category.on_autocomplete("group_id") @from_group.on_autocomplete("group_id") - async def autocomplete_group(self, interaction: nextcord.Interaction, group_id: str): + async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str): """ Autocomplete function for table names. @@ -212,7 +212,7 @@ class DeleteCog(commands.Cog, name="Table Management"): await interaction.response.send_autocomplete(autofill_groups(interaction.guild_id, group_id)) @from_category.on_autocomplete("category_id") - async def autocomplete_category(self, interaction: nextcord.Interaction, category_id: str, group_id: str): + async def category_autocomplete(self, interaction: nextcord.Interaction, category_id: str, group_id: str): """ Autocomplete function for category names. @@ -227,7 +227,7 @@ class DeleteCog(commands.Cog, name="Table Management"): @from_category.on_autocomplete("user_name") @from_group.on_autocomplete("user_name") - async def autocomplete_user( + async def user_autocomplete( self, interaction: nextcord.Interaction, user_name: str, group_id: str, category_id: Optional[str] = None ): """ @@ -247,7 +247,7 @@ class DeleteCog(commands.Cog, name="Table Management"): ) @users.on_autocomplete("user_name") - async def username_autofill(self, interaction: nextcord.Interaction, username: str): + async def all_users_autocomplete(self, interaction: nextcord.Interaction, username: str): """ Sends response from autofill_users_in_guild back to update_username for autocompletion of old_username. diff --git a/cogs/commands/refresh.py b/cogs/commands/refresh.py index 62ea32b..c0ddb12 100644 --- a/cogs/commands/refresh.py +++ b/cogs/commands/refresh.py @@ -101,7 +101,7 @@ class RefreshCog(commands.Cog, name="Refresh Cog"): await interaction.send(f"Posted all groups in {interaction.guild.name}'s highscores.", ephemeral=True) @group.on_autocomplete("group_id") - async def refresh_table_autofill(self, interaction: nextcord.Interaction, group_id: str): + async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str): """ Collects list of table names and compares to input table name for autocomplete assistance. diff --git a/cogs/commands/set.py b/cogs/commands/set.py index 7f65318..bca49c1 100644 --- a/cogs/commands/set.py +++ b/cogs/commands/set.py @@ -193,7 +193,7 @@ class SetCog(commands.Cog, name="Set command."): @group_output_channel.on_autocomplete("group_id") @category_pad_length.on_autocomplete("group_id") @username_length.on_autocomplete("group_id") - async def group_id_autocomplete(self, interaction: nextcord.Interaction, group_id: str): + async def group_autocomplete(self, interaction: nextcord.Interaction, group_id: str): """ Sends results from autofill_groups back to group_output_channel for autocompletion of group_id. diff --git a/cogs/commands/update.py b/cogs/commands/update.py index b1531d0..201de09 100644 --- a/cogs/commands/update.py +++ b/cogs/commands/update.py @@ -73,7 +73,7 @@ class UpdateCog(commands.Cog, name="Update commands."): await interaction.send("Request sent to admins for verification.", ephemeral=True) @username.on_autocomplete("old_username") - async def username_autofill(self, interaction: nextcord.Interaction, username: str): + async def all_users_autocomplete(self, interaction: nextcord.Interaction, username: str): """ Sends response from autofill_users_in_guild back to update_username for autocompletion of old_username.