Add /branch command #1
1 changed files with 9 additions and 2 deletions
|
@ -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!"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue