Bot Event - Muki-nb/mqbot GitHub Wiki
仍在搭建中~
Bot Event
- 内容请参考 go-cqhttp
- 监听子事件时同样会上报父事件。
例如:同时监听
message.group
和message
时,每当收到群消息,二者都会响应。 - 事件名遵循
post_type.second_type.sub_type
的命名规则。 - 该wiki仅列出常用事件,其他详细事件请自行通过 go-cqhttp 查询。
message
消息事件。
message.group
群消息。
message.private
私聊消息。
notice
通知事件。
notice.friend_recall
私聊撤回。
notice.group_recall
群撤回。
notice.group_increase
群成员增加。
notice.group_decrease
群成员减少。
notice.friend_add
好友添加。 注意:是通知而非好友添加请求。 如需处理好友添加请查看 request.friend
notice.notify.poke
戳一戳。
可根据是否存在sender_id
或group_id
判别私聊或群聊戳一戳。
request
request.friend
好友添加通知。 自动同意添加好友可以使用:
bot.on("request.friend",data => {
bot.setFriendAddRequest(data.flag);
});
request.group
加群通知。 自动同意可以使用:
bot.on("request.group",data => {
bot.setGroupAddRequest(data.flag,data.sub_type);
});
下面分别为申请和邀请的子事件。
request.group.add
申请加群通知。 自动同意可以使用:
bot.on("request.group.add",data => {
bot.setGroupAddRequest(data.flag,"add");
});
自动拒绝可以使用:
bot.on("request.group.add",data => {
bot.setGroupAddRequest(data.flag,"add",false,"理由");
});
request.group.invite
邀请加群通知。 自动同意可以使用:
bot.on("request.group.invite",data => {
bot.setGroupAddRequest(data.flag,"invite");
});
自动拒绝可以使用:
bot.on("request.group.invite",data => {
bot.setGroupAddRequest(data.flag,"invite",false,"理由");
});