Import everything from aiocqhttp.message in none.message

This commit is contained in:
Richard Chien 2018-10-14 22:52:37 +08:00
parent bc0d7aaa64
commit 67362e97e7
4 changed files with 7 additions and 11 deletions

View File

@ -143,10 +143,8 @@ def load_builtin_plugins() -> None:
load_plugins(plugin_dir, 'none.plugins')
from .message import message_preprocessor
from .message import message_preprocessor, Message, MessageSegment
from .command import on_command, CommandSession, CommandGroup
from .natural_language import on_natural_language, NLPSession, NLPResult
from .notice_request import (
on_notice, NoticeSession,
on_request, RequestSession,
)
from .notice_request import (on_notice, NoticeSession,
on_request, RequestSession)

View File

@ -1,7 +1,7 @@
import random
from typing import Union, Sequence, Callable
from aiocqhttp import message
from .message import escape
Expression_T = Union[str, Sequence[str], Callable]
@ -23,5 +23,5 @@ def render(expr: Expression_T, *, escape_args=True,
if escape_args:
for k, v in kwargs.items():
if isinstance(v, str):
kwargs[k] = message.escape(v)
kwargs[k] = escape(v)
return expr.format(**kwargs)

View File

@ -3,11 +3,10 @@ import re
from collections import namedtuple
from typing import Dict, Any, Iterable, Optional, Callable, Union
from aiocqhttp.message import Message
from . import NoneBot, permission as perm
from .command import call_command
from .log import logger
from .message import Message
from .session import BaseSession
_nl_processors = set()

View File

@ -1,6 +1,5 @@
from aiocqhttp.message import unescape
from none import on_command, CommandSession, permission as perm
from none.message import unescape
@on_command('echo')