Add /branch command #1

Merged
InValidFire merged 12 commits from test into main 2022-08-20 16:07:54 +00:00
Showing only changes of commit 05424d7949 - Show all commits

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