Skip to content

事件类型

luo9_bot 全量适配 Napcat OneBot v11 协议。

消息事件

json
{
  "PostType": "message",
  "Message": {
    "message_type": "group",
    "user_id": 123456,
    "group_id": 789012,
    "message": "你好",
    "raw_message": "你好",
    "time": 1714500000,
    "self_id": 987654,
    "message_id": 12345,
    "sub_type": "normal",
    "sender": { "nickname": "测试用户", "role": "member" }
  }
}

子类型

说明
friend好友消息
normal普通群消息
anonymous匿名消息
group_self自己发送

通知事件

NoticeType

类型触发场景关键字段
friend_add好友添加user_id
friend_recall好友撤回user_id, message_id
group_admin管理员变动sub_type(Set/Unset)
group_ban群禁言duration, sub_type(Ban/LiftBan)
group_increase成员增加sub_type(Approve/Invite)
group_decrease成员减少sub_type(Leave/Kick/KickMe)
group_card名片修改card_new, card_old
group_recall群消息撤回operator_id, message_id
group_upload文件上传file
group_title头衔变更title
honor荣誉变更honor_type
essence精华消息message_id
poke戳一戳target_id
lucky_king运气王target_id
group_msg_emoji_like表情回应message_id

请求事件

类型字段说明
frienduser_id, comment, flag好友请求
groupgroup_id, user_id, comment, flag, sub_type群请求

元事件

类型字段说明
lifecyclesub_type(Enable/Disable/Connect)生命周期
heartbeatstatus, interval心跳

消息段

类型说明
text文本
faceQQ 表情
image图片
at@某人
reply回复
jsonJSON 消息
record语音
video视频

CQ 码

CQ 码说明
[CQ:face,id=14]QQ 表情
[CQ:image,file=abc.image]图片
[CQ:at,qq=123456]@某人
[CQ:reply,id=12345]回复
[CQ:record,file=abc.record]语音

基于 GPLv3 许可发布