fix #49
parent
e2980305a5
commit
ab9bd1c675
|
|
@ -57,4 +57,4 @@ Seg.data: Dict[str, Any] = {
|
|||
}
|
||||
}
|
||||
```
|
||||
message_id怎么搞到手全凭你本事,也请在自己的插件里写好确定是否能撤回对应的消息的功能,毕竟这玩意真的单纯根据message_id撤消息
|
||||
其中message_id是消息的实际qq_id,于新版的mmc中可以从数据库获取(如果工作正常的话)
|
||||
|
|
@ -7,10 +7,12 @@ Seg.type = "notify"
|
|||
Seg.data: Dict[str, Any] = {
|
||||
"sub_type": "ban",
|
||||
"duration": "对应的禁言时间,单位为秒",
|
||||
"banned_user_info": "被禁言的用户的信息,为标准UserInfo对象"
|
||||
"banned_user_info": "被禁言的用户的信息,为标准UserInfo转换成的字典"
|
||||
}
|
||||
```
|
||||
此时`MessageBase.UserInfo`,即消息的`UserInfo`为操作者(operator)的信息
|
||||
|
||||
**注意: `banned_user_info`需要自行调用`UserInfo.from_dict()`函数转换为标准UserInfo对象**
|
||||
## 群聊开启全体禁言
|
||||
```python
|
||||
Seg.data: Dict[str, Any] = {
|
||||
|
|
@ -30,6 +32,8 @@ Seg.data: Dict[str, Any] = {
|
|||
**对于自然禁言解除的情况,此时`MessageBase.UserInfo`为`None`**
|
||||
|
||||
对于手动解除禁言的情况,此时`MessageBase.UserInfo`,即消息的`UserInfo`为操作者(operator)的信息
|
||||
|
||||
**注意: `lifted_user_info`需要自行调用`UserInfo.from_dict()`函数转换为标准UserInfo对象**
|
||||
## 群聊关闭全体禁言
|
||||
```python
|
||||
Seg.data: Dict[str, Any] = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "MaiBotNapcatAdapter"
|
||||
version = "0.4.2"
|
||||
version = "0.4.3"
|
||||
description = "A MaiBot adapter for Napcat"
|
||||
|
||||
[tool.ruff]
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ class NoticeHandler:
|
|||
data={
|
||||
"sub_type": sub_type,
|
||||
"duration": duration,
|
||||
"banned_user_info": banned_user_info,
|
||||
"banned_user_info": banned_user_info.to_dict() if banned_user_info else None,
|
||||
},
|
||||
)
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ class NoticeHandler:
|
|||
type="notify",
|
||||
data={
|
||||
"sub_type": sub_type,
|
||||
"lifted_user_info": lifted_user_info,
|
||||
"lifted_user_info": lifted_user_info.to_dict() if lifted_user_info else None,
|
||||
},
|
||||
)
|
||||
return seg_data, operator_info
|
||||
|
|
@ -463,7 +463,7 @@ class NoticeHandler:
|
|||
type="notify",
|
||||
data={
|
||||
"sub_type": "lift_ban",
|
||||
"lifted_user_info": lifted_user_info,
|
||||
"lifted_user_info": lifted_user_info.to_dict(),
|
||||
},
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue