Fixed error in cool command

This commit is contained in:
Marco Loewe 2023-11-14 11:02:14 +01:00
parent 46a7221f1f
commit d6872b37ab

11
bot.py
View File

@ -28,15 +28,16 @@ async def on_ready():
print('------') print('------')
@tree.command(name = 'cool', description = 'Check how cool you are!', guild=discord.Object(id='745287426402156555')) @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) 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')) @tree.command(name = 'update', description = 'Pulls the latest version from the repository', guild=discord.Object(id='745287426402156555'))
@app_commands.checks.has_role(745295653651087381) @app_commands.checks.has_role(745295653651087381)
async def update(ctx): async def update(ctx: discord.Interaction):
subprocess.Popen('./update.sh') await ctx.response.send_message('Updating, see you on the other side')
print(f'Updating, see you on the other side') subprocess.run('./update.sh')
await ctx.response.send_message('Done')
@update.error @update.error
async def update_error(ctx: discord.Interaction, error): async def update_error(ctx: discord.Interaction, error):