From 791e75cb2beeca45a6edf52b65f7e299e03b5eaf Mon Sep 17 00:00:00 2001 From: SamlonDev Date: Sat, 14 Jun 2025 18:54:02 +0200 Subject: code-style issues --- cogs/math.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cogs/math.py') diff --git a/cogs/math.py b/cogs/math.py index df2be4a..53340f2 100644 --- a/cogs/math.py +++ b/cogs/math.py @@ -1,23 +1,25 @@ -from discord.ext import commands -import discord -from discord import (ApplicationContext) import subprocess +from discord import (ApplicationContext) +from discord.ext import commands + + class Math(commands.Cog): def __init__(self, bot): self.bot = bot - + @commands.slash_command( name="math", description="wrug szyskih matfisuf" ) - async def math(self, ctx:ApplicationContext, equation:str): + async def math(self, ctx: ApplicationContext, equation: str): try: - math=subprocess.check_output(f"qalc -e {equation}", shell=True) + math = subprocess.check_output(f"qalc -e {equation}", shell=True) await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}") except Exception as e: await ctx.respond(e, ephemeral=True) print(e) + def setup(bot): - bot.add_cog(Math(bot)) \ No newline at end of file + bot.add_cog(Math(bot)) -- cgit v1.2.3