aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/math_cog.py
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2025-10-05 17:06:53 +0200
committersalmonik <raisersoft@proton.me>2025-10-05 17:06:53 +0200
commit150d8f1a3f258c5f4cb2798682691dd6d58f184e (patch)
tree519bc585d97cd6dda81db0141c05d52d3c839864 /cogs/math_cog.py
parentfixed file overwrite (diff)
downloadsenator-sperma-150d8f1a3f258c5f4cb2798682691dd6d58f184e.tar.gz
senator-sperma-150d8f1a3f258c5f4cb2798682691dd6d58f184e.zip
normalized naming scheme for math.py
Diffstat (limited to 'cogs/math_cog.py')
-rw-r--r--cogs/math_cog.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/cogs/math_cog.py b/cogs/math_cog.py
deleted file mode 100644
index 8a2644c..0000000
--- a/cogs/math_cog.py
+++ /dev/null
@@ -1,29 +0,0 @@
1import logging
2import subprocess
3
4from discord import ApplicationContext
5from discord.ext import commands
6
7logger = logging.getLogger(__name__)
8
9
10class Math(commands.Cog):
11 def __init__(self, bot):
12 self.bot = bot
13
14 @commands.slash_command(
15 name="math",
16 description="wrug szyskih matfisuf"
17 )
18 async def math(self, ctx: ApplicationContext, equation: str):
19 try:
20 math = subprocess.check_output(f"qalc -e '{equation}'", shell=True)
21 await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}")
22 logger.info(f"Math command executed: {equation}")
23 except Exception as e:
24 await ctx.respond(e, ephemeral=True)
25 logger.error(f"Error in math command: {e}", exc_info=True)
26
27
28def setup(bot):
29 bot.add_cog(Math(bot))