From 05424d7949091e340ab2374e1556a4b269599745 Mon Sep 17 00:00:00 2001 From: Riley Housden Date: Sat, 20 Aug 2022 00:57:18 -0400 Subject: [PATCH] fix subcommand --- ext/system.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ext/system.py b/ext/system.py index 5932f6c..5fd354b 100644 --- a/ext/system.py +++ b/ext/system.py @@ -112,6 +112,13 @@ async def update(ctx: lightbulb.Context) -> None: @lightbulb.command("branch", "get or set the working branch the bot uses.", ephemeral=True) @lightbulb.implements(lightbulb.SlashCommandGroup) async def branch(ctx: lightbulb.Context) -> None: + pass + + +@branch.child +@lightbulb.command("get", "get the current branch") +@lightbulb.implements(lightbulb.SlashSubCommand) +async def branch_get(ctx: lightbulb.Context) -> None: output = await create_subprocess("git", "rev-parse", "--symbolic-full-name", "--abbrev-ref", "HEAD") embed = hikari.Embed(title="Current Branch", description=f"Currently on branch '{output}'") @@ -121,8 +128,8 @@ async def branch(ctx: lightbulb.Context) -> None: @branch.child @lightbulb.option("name", "name of the branch", type=str, required=True) @lightbulb.command("switch", "switch branches") -@lightbulb.implements(lightbulb.SlashSubGroup) -async def switch(ctx: lightbulb.Context) -> None: +@lightbulb.implements(lightbulb.SlashSubCommand) +async def branch_switch(ctx: lightbulb.Context) -> None: embed = hikari.Embed(title="Restarting", description="Restarting to switch branches!" )