🔇 Feature: 调整日志输出格式与等级 (#1233)

This commit is contained in:
Ju4tCode
2022-09-09 11:52:57 +08:00
committed by GitHub
parent 179d7105c9
commit 8c42490a7e
29 changed files with 261 additions and 165 deletions

View File

@ -20,6 +20,9 @@ class Message:
__slots__ = ()
def __repr__(self) -> str:
return "Message()"
async def __call__(self, type: str = EventType()) -> bool:
return type == "message"
@ -29,6 +32,9 @@ class Notice:
__slots__ = ()
def __repr__(self) -> str:
return "Notice()"
async def __call__(self, type: str = EventType()) -> bool:
return type == "notice"
@ -38,6 +44,9 @@ class Request:
__slots__ = ()
def __repr__(self) -> str:
return "Request()"
async def __call__(self, type: str = EventType()) -> bool:
return type == "request"
@ -47,6 +56,9 @@ class MetaEvent:
__slots__ = ()
def __repr__(self) -> str:
return "MetaEvent()"
async def __call__(self, type: str = EventType()) -> bool:
return type == "meta_event"
@ -78,6 +90,9 @@ class SuperUser:
__slots__ = ()
def __repr__(self) -> str:
return "Superuser()"
async def __call__(self, bot: Bot, event: Event) -> bool:
return event.get_type() == "message" and (
f"{bot.adapter.get_name().split(maxsplit=1)[0].lower()}:{event.get_user_id()}"