diff options
Diffstat (limited to '')
| -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()}") |
