diff --git a/main.py b/main.py index a67e2a2..4f365e2 100644 --- a/main.py +++ b/main.py @@ -428,7 +428,6 @@ class Communication(asyncio.Protocol): name = "Communication" def __init__(self, client=client1): - print("créé") self.client = client self.transport = None @@ -452,12 +451,6 @@ communication = Communication(client1) async def start_bot(): await client1.start(os.environ.get("DISCORD_TOKEN"), max_messages=500000) - -def execption_handler(loop, context): - print('%s: %s' % ('Connection', context['exception'])) - traceback.print_exc() - - print(os.path.join("/tmp", os.path.dirname(os.path.realpath(__file__))) + ".sock") loop = asyncio.get_event_loop() diff --git a/modules/base/Base.py b/modules/base/Base.py index 48f1645..4049538 100644 --- a/modules/base/Base.py +++ b/modules/base/Base.py @@ -183,8 +183,3 @@ class BaseClass: else: # Run event asyncio.ensure_future(self.client._run_event(coro, method, *args, **kwargs), loop=self.client.loop) - - async def on_error(self, event_method, *args, **kwargs): - # Basic error handler - print('Ignoring exception in {}'.format(event_method), file=sys.stderr) - traceback.print_exc() diff --git a/modules/base/BaseLua.py b/modules/base/BaseLua.py index 7b66b78..3bf7053 100644 --- a/modules/base/BaseLua.py +++ b/modules/base/BaseLua.py @@ -39,7 +39,6 @@ class BaseClassLua(BaseClass): super().__init__(client) # Get lua globals self.lua = lupa.LuaRuntime(unpack_returned_tuples=True) - print(os.path.abspath(path)) self.luaMethods = self.lua.require(path) def call(self, method, *args, **kwargs): diff --git a/modules/modules/__init__.py b/modules/modules/__init__.py index c4109c6..d3d73d9 100644 --- a/modules/modules/__init__.py +++ b/modules/modules/__init__.py @@ -58,10 +58,9 @@ class MainClass(BaseClassPython): return for arg in args: e = self.client.load_module(arg) - print(e) if e: - await message.channel.send("An error occurred during the loading of the module {module}." - .format(module=arg)) + await message.channel.send("An error occurred during the loading of the module {module}: {error}." + .format(module=arg, error=e)) await self.com_list(message, args, kwargs) async def com_reload(self, message, args, kwargs): @@ -78,7 +77,6 @@ class MainClass(BaseClassPython): await self.com_list(message, args, kwargs) return for arg in args: - print(arg) e = self.client.unload_module(arg) if e: await message.channel.send("An error occurred during the loading of the module {module}." @@ -99,11 +97,10 @@ class MainClass(BaseClassPython): await self.com_list(message, args, kwargs) return for arg in args: - print(arg) e = self.client.unload_module(arg) if e: - await message.channel.send("An error occurred during the loading of the module {module}." - .format(module=arg)) + await message.channel.send("An error occurred during the loading of the module {module}: {error}." + .format(module=arg, error=e)) await self.com_list(message, [], []) async def com_list(self, message, args, kwargs):