diff --git a/none/__init__.py b/none/__init__.py index 1d31de04..53052b80 100644 --- a/none/__init__.py +++ b/none/__init__.py @@ -1,16 +1,16 @@ -import os +import asyncio import importlib import logging +import os import re -import asyncio from typing import Any from aiocqhttp import CQHttp from aiocqhttp.message import Message +from .log import logger from .message import handle_message from .notice_request import handle_notice_or_request -from .log import logger def create_bot(config_object: Any = None) -> CQHttp: diff --git a/none/command.py b/none/command.py index 0b68040c..1a8eab74 100644 --- a/none/command.py +++ b/none/command.py @@ -1,5 +1,5 @@ -import re import asyncio +import re from datetime import datetime from typing import ( Tuple, Union, Callable, Iterable, Dict, Any, Optional, Sequence @@ -9,8 +9,8 @@ from aiocqhttp import CQHttp from aiocqhttp.message import Message from . import permission as perm -from .helpers import context_id from .expression import render +from .helpers import context_id from .session import BaseSession # Key: str (one segment of command name) @@ -27,7 +27,8 @@ _sessions = {} class Command: - __slots__ = ('name', 'func', 'permission', 'only_to_me', 'args_parser_func') + __slots__ = ( + 'name', 'func', 'permission', 'only_to_me', 'args_parser_func') def __init__(self, *, name: Tuple[str], func: Callable, permission: int, only_to_me: bool): diff --git a/none/log.py b/none/log.py index 5842aeb0..6aab710b 100644 --- a/none/log.py +++ b/none/log.py @@ -1,5 +1,5 @@ -import sys import logging +import sys logger = logging.getLogger('none') default_handler = logging.StreamHandler(sys.stdout) diff --git a/none/message.py b/none/message.py index 0dbc65f5..a712176e 100644 --- a/none/message.py +++ b/none/message.py @@ -4,8 +4,8 @@ from aiocqhttp import CQHttp from aiocqhttp.message import MessageSegment from .command import handle_command -from .natural_language import handle_natural_language from .log import logger +from .natural_language import handle_natural_language async def handle_message(bot: CQHttp, ctx: Dict[str, Any]) -> None: diff --git a/none/natural_language.py b/none/natural_language.py index b5b5ba71..7fe36827 100644 --- a/none/natural_language.py +++ b/none/natural_language.py @@ -1,5 +1,5 @@ -import re import asyncio +import re from collections import namedtuple from typing import Dict, Any, Iterable, Optional, Callable, Union @@ -7,9 +7,9 @@ from aiocqhttp import CQHttp from aiocqhttp.message import Message from . import permission as perm -from .session import BaseSession from .command import call_command from .log import logger +from .session import BaseSession _nl_processors = set() diff --git a/none/notice_request.py b/none/notice_request.py index ca9a9049..45eabab6 100644 --- a/none/notice_request.py +++ b/none/notice_request.py @@ -3,8 +3,8 @@ from typing import Dict, Any, Optional, Callable, Union from aiocqhttp import CQHttp, Error as CQHttpError from aiocqhttp.bus import EventBus -from .session import BaseSession from .log import logger +from .session import BaseSession _bus = EventBus() diff --git a/none_demo/run.py b/none_demo/run.py index 17f088c5..11c76d10 100644 --- a/none_demo/run.py +++ b/none_demo/run.py @@ -1,7 +1,6 @@ from os import path import none - from none_demo import config bot = none.create_bot(config) diff --git a/setup.py b/setup.py index 42f37faf..4328530a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( description='A QQ bot framework', long_description=long_description, long_description_content_type="text/markdown", - install_requires=['aiocqhttp>=0.3', 'aiocache'], + install_requires=['aiocqhttp>=0.4', 'aiocache'], python_requires='>=3.6', platforms='any', classifiers=(