mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-08-01 18:50:00 +00:00
✨ implement check_reply
check_atme
check_nickname
This commit is contained in:
@ -77,6 +77,13 @@ class Sender(BaseModel):
|
||||
tenant_key: str
|
||||
|
||||
|
||||
class ReplySender(BaseModel):
|
||||
id: str
|
||||
id_type: str
|
||||
sender_type: str
|
||||
tenant_key: str
|
||||
|
||||
|
||||
class Mention(BaseModel):
|
||||
key: str
|
||||
id: UserId
|
||||
@ -84,6 +91,37 @@ class Mention(BaseModel):
|
||||
tenant_key: str
|
||||
|
||||
|
||||
class ReplyMention(BaseModel):
|
||||
id: str
|
||||
id_type: str
|
||||
key: str
|
||||
name: str
|
||||
tenant_key: str
|
||||
|
||||
|
||||
class MessageBody(BaseModel):
|
||||
content: str
|
||||
|
||||
|
||||
class Reply(BaseModel):
|
||||
message_id: str
|
||||
root_id: Optional[str]
|
||||
parent_id: Optional[str]
|
||||
msg_type: str
|
||||
create_time: str
|
||||
update_time: str
|
||||
deleted: bool
|
||||
updated: bool
|
||||
chat_id: str
|
||||
sender: ReplySender
|
||||
body: MessageBody
|
||||
mentions: List[ReplyMention]
|
||||
upper_message_id: Optional[str]
|
||||
|
||||
class Config:
|
||||
extra = "allow"
|
||||
|
||||
|
||||
class EventMessage(BaseModel):
|
||||
message_id: str
|
||||
root_id: Optional[str]
|
||||
@ -128,6 +166,14 @@ class MessageEvent(Event):
|
||||
__event__ = "im.message.receive_v1"
|
||||
event: MessageEventDetail
|
||||
|
||||
to_me: bool = False
|
||||
reply: Optional[Reply]
|
||||
"""
|
||||
:说明: 消息是否与机器人有关
|
||||
|
||||
:类型: ``bool``
|
||||
"""
|
||||
|
||||
@overrides(Event)
|
||||
def get_type(self) -> Literal["message", "notice", "meta_event"]:
|
||||
return "message"
|
||||
|
Reference in New Issue
Block a user