fix subcommand

This commit is contained in:
Riley Housden 2022-08-20 00:57:18 -04:00
parent e31f066fd2
commit 05424d7949
Signed by: InValidFire
GPG Key ID: 0D6208F6DF56B4D8
1 changed files with 9 additions and 2 deletions

View File

@ -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!"
)