feat: 添加状态监控插件和Redis原子操作支持
- 新增 `/status` 指令,展示机器人运行状态和系统指标 - 实现Redis Lua脚本支持原子化计数器操作 - 添加消息收发统计功能 - 完善文档,包括插件开发和性能优化指南 - 重构WebSocket连接池,增加健康检查机制 - 移除旧版编译脚本,优化项目结构
This commit is contained in:
@@ -77,6 +77,32 @@ print(f"正常: {status.good}")
|
||||
- `status`: 状态描述
|
||||
- `good`: 运行是否正常
|
||||
|
||||
### `get_profile_like` - 获取资料点赞信息
|
||||
|
||||
```python
|
||||
async def get_profile_like(self) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
获取个人资料的点赞信息。
|
||||
|
||||
**返回值:**
|
||||
- 包含点赞信息的字典
|
||||
|
||||
### `nc_get_user_status` - 获取用户在线状态 (NapCat)
|
||||
|
||||
```python
|
||||
async def nc_get_user_status(self, user_id: int) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
获取指定用户的在线状态(NapCatQQ 特有 API)。
|
||||
|
||||
**参数:**
|
||||
- `user_id`: 目标用户的 QQ 号
|
||||
|
||||
**返回值:**
|
||||
- 包含用户状态信息的字典
|
||||
|
||||
|
||||
## 状态设置
|
||||
|
||||
### `set_self_longnick` - 设置个性签名
|
||||
@@ -381,16 +407,6 @@ async def handle_restore_profile(event: MessageEvent, args: str):
|
||||
3. **客户端支持**: 不是所有 OneBot 客户端都支持全部 API,使用前最好测试一下。
|
||||
4. **谨慎操作**: `bot_exit` 会让机器人下线,谨慎使用。
|
||||
|
||||
## 重复的方法
|
||||
|
||||
`AccountAPI` 中还包含了一些与好友、群组相关的方法,这些方法在其他模块中也有定义:
|
||||
|
||||
- `get_stranger_info()`: 同 [好友 API](./friend.md#get_stranger_info---获取陌生人信息)
|
||||
- `get_friend_list()`: 同 [好友 API](./friend.md#get_friend_list---获取好友列表)
|
||||
- `get_group_list()`: 同 [群组 API](./group.md#get_group_list---获取群列表)
|
||||
|
||||
这些方法在 `AccountAPI` 中的实现可能略有不同(比如缓存逻辑),但功能相同。建议使用对应模块中的版本,因为那些是专门为该功能设计的。
|
||||
|
||||
## 下一步
|
||||
|
||||
- [好友 API](./friend.md): 管理好友相关功能
|
||||
|
||||
Reference in New Issue
Block a user