From d6872b37abd9011cfd255337dfcd021c9103e424 Mon Sep 17 00:00:00 2001 From: Marco Loewe Date: Tue, 14 Nov 2023 11:02:14 +0100 Subject: [PATCH] Fixed error in cool command --- bot.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index f90e6d2..0c69e37 100644 --- a/bot.py +++ b/bot.py @@ -28,15 +28,16 @@ async def on_ready(): print('------') @tree.command(name = 'cool', description = 'Check how cool you are!', guild=discord.Object(id='745287426402156555')) -async def cool(ctx): +async def cool(ctx: discord.Interaction): cool_factor = round(random.uniform(0, 100), 2) - await ctx.response.send_message(f'{ctx.author} is {cool_factor}% cool!') + await ctx.response.send_message(f'{ctx.user} is {cool_factor}% cool!') @tree.command(name = 'update', description = 'Pulls the latest version from the repository', guild=discord.Object(id='745287426402156555')) @app_commands.checks.has_role(745295653651087381) -async def update(ctx): - subprocess.Popen('./update.sh') - print(f'Updating, see you on the other side') +async def update(ctx: discord.Interaction): + await ctx.response.send_message('Updating, see you on the other side') + subprocess.run('./update.sh') + await ctx.response.send_message('Done') @update.error async def update_error(ctx: discord.Interaction, error):