diff options
| author | SamlonDev <stankiewiczgracjan2019@gmail.com> | 2025-05-26 17:55:12 +0200 |
|---|---|---|
| committer | SamlonDev <stankiewiczgracjan2019@gmail.com> | 2025-05-26 17:55:12 +0200 |
| commit | 063a34f20983b6acfe92d9b1b20cd441e96540c4 (patch) | |
| tree | 29e4ff3e567e88161fd47672f01eba74a4885435 /cogs/math.py | |
| parent | add math using qalc (diff) | |
| download | senator-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.py | 11 |
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 @@ | |||
| 1 | from base64 import decode | 1 | from discord.ext import commands |
| 2 | from codecs import utf_8_decode | ||
| 3 | import string | ||
| 4 | import discord | 2 | import discord |
| 5 | from discord import (ApplicationContext) | 3 | from discord import (ApplicationContext) |
| 6 | import subprocess | 4 | import 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()}") |
