Giter VIP home page Giter VIP logo

onebot-11's People

Contributors

kanrichan avatar shigma avatar stdrc avatar zty012 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

onebot-11's Issues

【提议】:新增 reaction 事件

(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 方面,当新的回应出现时:

  1. 会收到目标消息的更新,内容是目标消息的当前状态,因此该消息中并不会明确指出这是 Emoji Reaction,只在 emojiLikesList 字段中给出消息此刻的所有 Emoji Reaction(回应事件发生,如新增/删除)
"emojiLikesList": [
    {
        "emojiId": "277",
        "emojiType": "1",
        "likesCnt": "1",
        "isClicked": false
    }
],
  1. 如果该回应是对本号所发送消息的回应时,同时会收到一个群聊事件,是与群聊邀请类似的 grayTipElement,可通过subElementType==12,通过 busiId=="4" && busiType="19270" 判断,如图
image

其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。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.