diff options
author | Mango0x45 <thomasvoss@live.com> | 2021-01-04 23:45:10 +0000 |
---|---|---|
committer | Mango0x45 <thomasvoss@live.com> | 2021-01-04 23:45:10 +0000 |
commit | ad64d47483b9ea91408f6a8e32933129c28bba94 (patch) | |
tree | 8af2cb239f0018c14bf13ae7702376cec97144e9 | |
parent | 398c9d299bb401c3de0dcaceb23cfa213aeb5170 (diff) | |
download | steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar.gz steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar.bz2 steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar.lz steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar.xz steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.tar.zst steve-bot-ad64d47483b9ea91408f6a8e32933129c28bba94.zip |
Fix a very very very very very bad error
-rwxr-xr-x | cogs/utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cogs/utils.py b/cogs/utils.py index 637f344..f302dae 100755 --- a/cogs/utils.py +++ b/cogs/utils.py @@ -42,7 +42,9 @@ async def bc_calc(ctx, eqn: str): with open("temp.txt", "w") as f: f.write(eqn) - result = subprocess.check_output(f"bc bc_funcs/* temp.txt", shell=True) + result = subprocess.check_output( + f"echo 'scale=20; $(cat temp.txt)' | bc bc_funcs/*", shell=True + ) os.remove("temp.txt") await ctx.send(result.decode("utf-8").replace("\\\n", "").strip()) except subprocess.CalledProcessError as err: @@ -569,7 +571,8 @@ class Utils(commands.Cog): @commands.command(aliases=["calc"]) async def math(self, ctx, *, eqn: str): # 10 second timeout - await asyncio.wait_for(bc_calc(ctx, eqn), 10) + await bc_calc(ctx, eqn) + # await asyncio.wait_for(bc_calc(ctx, eqn), 10) @commands.command() async def retime(self, ctx, start_sec, end_sec, frames=0, framerate=30): |