Skip to content

Commit 8821c0f

Browse files
committed
add slash command documentation
1 parent 9be96ed commit 8821c0f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

bot/cogs/config.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
if TYPE_CHECKING:
4141
from cogs.tickets import Tickets
42+
4243
from rodhaj import Rodhaj
4344

4445

@@ -311,7 +312,7 @@ class ConfigOptionFlags(commands.FlagConverter):
311312
active: Optional[bool] = commands.flag(
312313
name="active",
313314
default=None,
314-
description="Whether to show current active options or not. Using None will show all options, regardless of active status or not",
315+
description="Whether to show current active options or not. Using None will show all options",
315316
)
316317

317318

@@ -792,15 +793,13 @@ async def config_options(
792793
@is_manager()
793794
@commands.guild_only()
794795
@config.command(name="help", aliases=["info"])
795-
@app_commands.describe(option="Configuration option to use for lookup")
796+
@app_commands.describe(key="Configuration key to use for lookup")
796797
async def config_help(
797-
self, ctx: GuildContext, option: Annotated[str, ConfigKeyConverter]
798+
self, ctx: GuildContext, key: Annotated[str, ConfigKeyConverter]
798799
) -> None:
799800
"""Shows help information for different configuration options"""
800801
# Because we are using the converter, all options are guaranteed to be correct
801-
embed = ConfigEntryEmbed(
802-
ConfigHelpEntry(key=option, **self.options_help[option])
803-
)
802+
embed = ConfigEntryEmbed(ConfigHelpEntry(key=key, **self.options_help[key]))
804803
await ctx.send(embed=embed)
805804

806805
@is_manager()
@@ -821,6 +820,10 @@ async def config_help_all(self, ctx: GuildContext):
821820
@is_manager()
822821
@commands.guild_only()
823822
@config.command(name="set-age")
823+
@app_commands.describe(
824+
type="Type of minimum age to set",
825+
duration="The duration that this minimum age should be. E.g. 2 days",
826+
)
824827
async def config_set_age(
825828
self,
826829
ctx: GuildContext,
@@ -830,7 +833,7 @@ async def config_set_age(
830833
FriendlyTimeResult, UserFriendlyTime(commands.clean_content, default="…")
831834
],
832835
) -> None:
833-
"""Sets an minium duration for age-related options
836+
"""Sets an minimum duration for age-related options
834837
835838
This command handles all age-related options. This means you can use this
836839
to set the minimum age required to use Rodhaj
@@ -851,6 +854,10 @@ async def config_set_age(
851854
@is_manager()
852855
@commands.guild_only()
853856
@config.command(name="set")
857+
@app_commands.describe(
858+
key="Configuration key to use for lookup",
859+
value="Value to set for configuration",
860+
)
854861
async def config_set(
855862
self,
856863
ctx: GuildContext,
@@ -879,6 +886,10 @@ async def config_set(
879886
@is_manager()
880887
@commands.guild_only()
881888
@config.command(name="toggle")
889+
@app_commands.describe(
890+
key="Configuration key to use for lookup",
891+
value="Boolean option to set the configuration",
892+
)
882893
async def config_toggle(
883894
self, ctx: GuildContext, key: Annotated[str, ConfigKeyConverter], *, value: bool
884895
) -> None:

0 commit comments

Comments
 (0)