From 3e09f7457f47fa597f5552e97cf14312c57b64d0 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Fri, 17 Aug 2018 23:45:43 +0800 Subject: [PATCH] Use host, port, and debug from default configurations --- none/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/none/__init__.py b/none/__init__.py index 24a331d6..a302d18d 100644 --- a/none/__init__.py +++ b/none/__init__.py @@ -40,7 +40,12 @@ class NoneBot(CQHttp): async def _(ctx): asyncio.ensure_future(handle_notice_or_request(self, ctx)) - def run(self, host=None, port=None, *args, **kwargs): + def run(self, host: str = None, port: int = None, *args, **kwargs): + host = host or self.config.HOST + port = port or self.config.PORT + if 'debug' not in kwargs: + kwargs['debug'] = self.config.DEBUG + logger.info(f'Running on {host}:{port}') super().run(host=host, port=port, loop=asyncio.get_event_loop(), *args, **kwargs)