aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/math.py
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-03-18 15:29:51 +0100
committersalmonik <raisersoft@proton.me>2026-03-18 15:29:51 +0100
commitc0053ca98912901b5d387d58fbc57f9b7da91f38 (patch)
tree14fe7a7beae1ca2745333dcd7032a6ced28de0f7 /cogs/math.py
parentfix tts (diff)
downloadsenator-sperma-c0053ca98912901b5d387d58fbc57f9b7da91f38.tar.gz
senator-sperma-c0053ca98912901b5d387d58fbc57f9b7da91f38.zip
voice doesn't work due to DAVE, but we got copyparty search
Diffstat (limited to 'cogs/math.py')
-rw-r--r--cogs/math.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/cogs/math.py b/cogs/math.py
deleted file mode 100644
index bf164b3..0000000
--- a/cogs/math.py
+++ /dev/null
@@ -1,35 +0,0 @@
1# This file is part of Senator Sperma
2# Licensed under the GPL-3.0 License
3# Copyright (C) 2026 Salmonik @ salmonik@tuta.io
4# https://codeberg.org/salmonik/senator-sperma
5
6import logging
7import asyncio
8
9from discord import ApplicationContext
10from discord.ext import commands
11
12logger = logging.getLogger(__name__)
13
14
15class Math(commands.Cog):
16 def __init__(self, bot):
17 self.bot = bot
18
19 @commands.slash_command(
20 name="math",
21 description="wrug szyskih matfisuf"
22 )
23 async def math(self, ctx: ApplicationContext, equation: str):
24 try:
25 math = await asyncio.create_subprocess_exec(f"qalc -e '{equation}'")
26 result = await math.wait()
27 await ctx.respond(f"{equation} = {result.decode('utf-8').strip()}")
28 logger.info(f"Math command executed: {equation}")
29 except Exception as e:
30 await ctx.respond(e, ephemeral=True)
31 logger.error(f"Error in math command: {e}", exc_info=True)
32
33
34def setup(bot):
35 bot.add_cog(Math(bot))