1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 20:23:12 +00:00

Fix restart command outputs

The restart command no longer tries to output the script's echo commands wait ctx.respond() because this isn't possible when the bot is restarting.
This commit is contained in:
wlinator 2023-06-19 11:33:41 -04:00
parent 7636d9d6f9
commit 49245784a3

View file

@ -26,12 +26,12 @@ class Basic(commands.Cog):
)
@commands.check(universal.owner_check)
async def restart(self, ctx):
try:
output = subprocess.check_output(["/bin/bash", "racu_update.sh"])
except subprocess.CalledProcessError as e:
output = f"ERROR!!!\n{e.output.decode()}"
await ctx.respond(content="Restarting..", ephemeral=True)
await ctx.respond(f"Script executed:\n```\n{output}\n```", ephemeral=True)
try:
print(subprocess.check_output(["/bin/bash", "racu_update.sh"]))
except subprocess.CalledProcessError as e:
print(f"Error executing the script: {e.output.decode()}")
@commands.slash_command(
name="intro",