nonebot2/tests/plugins/param/param_event.py

31 lines
577 B
Python
Raw Normal View History

2021-12-20 00:28:02 +08:00
from nonebot.adapters import Event, Message
from nonebot.params import EventToMe, EventType, EventMessage, EventPlainText
async def event(e: Event) -> Event:
return e
class SubEvent(Event):
...
async def sub_event(e: SubEvent) -> SubEvent:
return e
2021-12-20 00:28:02 +08:00
async def event_type(t: str = EventType()) -> str:
return t
async def event_message(msg: Message = EventMessage()) -> Message:
return msg
async def event_plain_text(text: str = EventPlainText()) -> str:
return text
async def event_to_me(to_me: bool = EventToMe()) -> bool:
return to_me