aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/math.py
diff options
context:
space:
mode:
authorSamlonDev <stankiewiczgracjan2019@gmail.com>2025-05-26 17:55:12 +0200
committerSamlonDev <stankiewiczgracjan2019@gmail.com>2025-05-26 17:55:12 +0200
commit063a34f20983b6acfe92d9b1b20cd441e96540c4 (patch)
tree29e4ff3e567e88161fd47672f01eba74a4885435 /cogs/math.py
parentadd math using qalc (diff)
downloadsenator-sperma-063a34f20983b6acfe92d9b1b20cd441e96540c4.tar.gz
senator-sperma-063a34f20983b6acfe92d9b1b20cd441e96540c4.zip
volume control and fixes to math
Diffstat (limited to 'cogs/math.py')
-rw-r--r--cogs/math.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/cogs/math.py b/cogs/math.py
index 80a6de9..df2be4a 100644
--- a/cogs/math.py
+++ b/cogs/math.py
@@ -1,6 +1,4 @@
1from base64 import decode 1from discord.ext import commands
2from codecs import utf_8_decode
3import string
4import discord 2import discord
5from discord import (ApplicationContext) 3from discord import (ApplicationContext)
6import subprocess 4import subprocess
@@ -10,11 +8,10 @@ class Math(commands.Cog):
10 self.bot = bot 8 self.bot = bot
11 9
12 @commands.slash_command( 10 @commands.slash_command(
13 name="Math", 11 name="math",
14 description="wrug szyskih matfisuf", 12 description="wrug szyskih matfisuf"
15
16 ) 13 )
17 async def math(self, ctx:ApplicationContext, equation:string): 14 async def math(self, ctx:ApplicationContext, equation:str):
18 try: 15 try:
19 math=subprocess.check_output(f"qalc -e {equation}", shell=True) 16 math=subprocess.check_output(f"qalc -e {equation}", shell=True)
20 await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}") 17 await ctx.respond(f"{equation} = {math.decode('utf-8').strip()}")