mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-26 07:41:20 +00:00
✅ add test cases
This commit is contained in:
22
tests/plugins/param/param_event.py
Normal file
22
tests/plugins/param/param_event.py
Normal file
@ -0,0 +1,22 @@
|
||||
from nonebot.adapters import Event, Message
|
||||
from nonebot.params import EventToMe, EventType, EventMessage, EventPlainText
|
||||
|
||||
|
||||
async def event(e: Event) -> Event:
|
||||
return e
|
||||
|
||||
|
||||
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
|
Reference in New Issue
Block a user