⬇️ 更新文档样式
This commit is contained in:
@ -1,47 +1,19 @@
|
||||
---
|
||||
title: liteyuki.message.event
|
||||
order: 1
|
||||
icon: laptop-code
|
||||
category: API
|
||||
---
|
||||
|
||||
### ***class*** `MessageEvent`
|
||||
### **class** `MessageEvent`
|
||||
### *method* `__init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, user_id: str, session_type: str, receive_channel: str, data: Optional[dict[str, Any]] = None)`
|
||||
|
||||
|
||||
|
||||
###   ***def*** `__init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, session_type: str, receive_channel: str, data: Optional[dict[str, Any]]) -> None`
|
||||
**说明**: 轻雪抽象消息事件
|
||||
|
||||
 轻雪抽象消息事件
|
||||
|
||||
Args:
|
||||
|
||||
|
||||
|
||||
bot_id: 机器人ID
|
||||
|
||||
message: 消息,消息段数组[{type: str, data: dict[str, Any]}]
|
||||
|
||||
raw_message: 原始消息(通常为纯文本的格式)
|
||||
|
||||
message_type: 消息类型(private, group, other)
|
||||
|
||||
|
||||
|
||||
session_id: 会话ID(私聊通常为用户ID,群聊通常为群ID)
|
||||
|
||||
session_type: 会话类型(private, group)
|
||||
|
||||
receive_channel: 接收频道(用于回复消息)
|
||||
|
||||
|
||||
|
||||
data: 附加数据
|
||||
|
||||
<details>
|
||||
<summary>源代码</summary>
|
||||
<summary> <b>源代码</b> </summary>
|
||||
|
||||
```python
|
||||
def __init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, session_type: str, receive_channel: str, data: Optional[dict[str, Any]]=None):
|
||||
def __init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_type: str, raw_message: str, session_id: str, user_id: str, session_type: str, receive_channel: str, data: Optional[dict[str, Any]]=None):
|
||||
"""
|
||||
轻雪抽象消息事件
|
||||
Args:
|
||||
@ -66,22 +38,23 @@ def __init__(self, bot_id: str, message: list[dict[str, Any]] | str, message_typ
|
||||
self.raw_message = raw_message
|
||||
self.session_id = session_id
|
||||
self.session_type = session_type
|
||||
self.user_id = user_id
|
||||
self.receive_channel = receive_channel
|
||||
```
|
||||
</details>
|
||||
|
||||
###   ***def*** `reply(self, message: str | dict[str, Any]) -> None`
|
||||
### *method* `reply(self, message: str | dict[str, Any])`
|
||||
|
||||
 回复消息
|
||||
|
||||
Args:
|
||||
|
||||
message:
|
||||
**说明**: 回复消息
|
||||
|
||||
**参数**:
|
||||
> - message:
|
||||
|
||||
Returns:
|
||||
|
||||
<details>
|
||||
<summary>源代码</summary>
|
||||
<summary> <b>源代码</b> </summary>
|
||||
|
||||
```python
|
||||
def reply(self, message: str | dict[str, Any]):
|
||||
@ -96,11 +69,3 @@ def reply(self, message: str | dict[str, Any]):
|
||||
```
|
||||
</details>
|
||||
|
||||
### ***var*** `reply_event = MessageEvent(message_type=self.session_type, message=message, raw_message='', data={'message': message}, bot_id=self.bot_id, session_id=self.session_id, session_type=self.session_type, receive_channel='_')`
|
||||
|
||||
|
||||
|
||||
### ***var*** `data = {}`
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user