make branch commands ephemeral

This commit is contained in:
Riley Housden 2022-08-20 01:00:11 -04:00
parent 05424d7949
commit 33a1103f94
Signed by: InValidFire
GPG key ID: 0D6208F6DF56B4D8

View file

@ -109,14 +109,15 @@ async def update(ctx: lightbulb.Context) -> None:
@plugin.command @plugin.command
@lightbulb.add_checks(lightbulb.owner_only) @lightbulb.add_checks(lightbulb.owner_only)
@lightbulb.command("branch", "get or set the working branch the bot uses.", ephemeral=True) @lightbulb.command("branch", "get or set the working branch the bot uses.")
@lightbulb.implements(lightbulb.SlashCommandGroup) @lightbulb.implements(lightbulb.SlashCommandGroup)
async def branch(ctx: lightbulb.Context) -> None: async def branch(ctx: lightbulb.Context) -> None:
pass pass # SlashCommandGroup body code isn't run
@branch.child @branch.child
@lightbulb.command("get", "get the current branch") @lightbulb.add_checks(lightbulb.owner_only)
@lightbulb.command("get", "get the current branch", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand) @lightbulb.implements(lightbulb.SlashSubCommand)
async def branch_get(ctx: lightbulb.Context) -> None: async def branch_get(ctx: lightbulb.Context) -> None:
output = await create_subprocess("git", "rev-parse", "--symbolic-full-name", "--abbrev-ref", "HEAD") output = await create_subprocess("git", "rev-parse", "--symbolic-full-name", "--abbrev-ref", "HEAD")
@ -126,8 +127,9 @@ async def branch_get(ctx: lightbulb.Context) -> None:
@branch.child @branch.child
@lightbulb.add_checks(lightbulb.owner_only)
@lightbulb.option("name", "name of the branch", type=str, required=True) @lightbulb.option("name", "name of the branch", type=str, required=True)
@lightbulb.command("switch", "switch branches") @lightbulb.command("switch", "switch branches", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand) @lightbulb.implements(lightbulb.SlashSubCommand)
async def branch_switch(ctx: lightbulb.Context) -> None: async def branch_switch(ctx: lightbulb.Context) -> None:
embed = hikari.Embed(title="Restarting", embed = hikari.Embed(title="Restarting",