From 3de7293b94fd13593bbd8eb4c1d5128d8ff90f32 Mon Sep 17 00:00:00 2001 From: Suwako Moriya Date: Mon, 4 Mar 2019 13:45:59 +0100 Subject: [PATCH] Update fractale.py --- modules/fractale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/fractale.py b/modules/fractale.py index 34af079..90cf92a 100644 --- a/modules/fractale.py +++ b/modules/fractale.py @@ -1,6 +1,7 @@ # dummy module import discord import random +from concurrent.futures import ThreadPoolExecutor import fractale.source.main from PIL import Image @@ -91,8 +92,10 @@ class MainClass(): await self.send_fractal(message, ' '.join(args[1:])) else: await self.modules['help'][1].send_help(message.channel, self) + async def send_fractal(self, *args): + await self.client.loop.run_in_executor(ThreadPoolExecutor(), send_fractal_async, *args) - async def send_fractal(self, message, command): + async def send_fractal_async(self, message, command): parsed_data=self.parse(command) if parsed_data["Success"]: res=parsed_data["Result"]