Lots of updates

This commit is contained in:
Richard Chien
2018-07-01 11:01:24 +08:00
parent 1835a4c33d
commit a13128f356
9 changed files with 162 additions and 90 deletions

View File

@ -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 .helpers import send
async def handle_message(bot: CQHttp, ctx: Dict[str, Any]) -> None:
@ -23,9 +23,10 @@ async def handle_message(bot: CQHttp, ctx: Dict[str, Any]) -> None:
handled = await handle_command(bot, ctx)
if handled:
logger.debug('Message is handled as a command')
logger.debug('Message is handled as command')
return
elif ctx['to_me']:
await send(bot, ctx, '你在说什么我看不懂诶')
# TODO: NLP
handled = await handle_natural_language(bot, ctx)
if handled:
logger.debug('Message is handled as natural language')
return