botuniverse / onebot-11 Goto Github PK
View Code? Open in Web Editor NEWOneBot 11 标准
Home Page: https://11.onebot.dev
OneBot 11 标准
Home Page: https://11.onebot.dev
(2024.03)最近NTQQ 新增了群聊内表情回应。
尽管 Onebot11 标准已经很久没有更新了,但是相关需求仍然存在。 因此提议新增 GroupReactionEvent
事件。
当其他成员对 bot 所发送消息的回应会触发该事件。
字段名 | 数据类型 | 可能的值 | 说明 |
---|---|---|---|
time |
number int64 | - | 事件发生的时间戳 |
self_id |
number int64 | - | 收到事件的机器人 QQ 号 |
post_type |
string | notice |
上报类型 |
notice_type |
string | group_reaction |
通知类型 |
group_id |
number int64 | - | 群号 |
user_id |
string | - | QQ 号 |
message_id |
string | - | 回应的目标消息 ID |
qface_id |
string | - | QQ 表情 ID |
QQ 方面,当新的回应出现时:
emojiLikesList
字段中给出消息此刻的所有 Emoji Reaction(回应事件发生,如新增/删除)"emojiLikesList": [
{
"emojiId": "277",
"emojiType": "1",
"likesCnt": "1",
"isClicked": false
}
],
subElementType==12
,通过 busiId=="4" && busiType="19270"
判断,如图其xml content如下:
"xmlElement": {
"busiType": "4",
"busiId": "19270",
"c2cType": 0,
"serviceType": 0,
"ctrlFlag": 0,
"content": "<gtip align=\"center\"> <qq uin=\"replyer_qquin\" col=\"3\" jp=\"replyer_qqnumber\"/> <nor txt=\"回应了你的\"/> <url jp= \"\" msgseq=\"3893\" col=\"3\" txt=\"消息:\"/> <face type=\"1\" id=\"277\"> </face> </gtip>",
"templId": "10382",
"seqId": "1713682981753442094",
"templParam": {},
"pbReserv": null,
"members": {}
}
在该消息中,可以获取到目标消息的SeqID,发送者 QQID,以及表情 ID。
目前是出于实现方便的考虑,仅对本号发送消息的新增 reaction 生效,因为其他变更只会触发上述 1. 。
如果要完善考虑,纳入对其他消息的 reaction 进行监听或是 reaction 删除事件,可考虑将类型由 event 改为 message。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.