Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

回复消息中多余的at #24

Closed
ieew opened this issue Aug 8, 2020 · 5 comments
Closed

回复消息中多余的at #24

ieew opened this issue Aug 8, 2020 · 5 comments

Comments

@ieew
Copy link

ieew commented Aug 8, 2020

描述你遇到的问题:
回复消息的解析可能存在问题

复现步骤:
该 BUG 会在进行以下操作后出现:

  1. 群内有人回复某一条消息的时候

运行环境:

  • 操作系统: [例如: Android(Termux), Android(MiraiAndroid)]
  • mirai-core 版本: 1.3.0
  • mirai-api-http 版本: 1.7.3
  • graia-application-mirai 版本: 0.1.5
  • 是否出现在机器人长期运行后: [否]

额外信息:
如果回复消息中包含qq自动添加的at行为则是:
image

[
    Source(id=19532, time=datetime.datetime(2020, 8, 8, 1, 29, 58, tzinfo=datetime.timezone.utc)),
    Quote(id=19527, groupId=xxxxxxxx, senderId=xxxxxxxx, targetId=601249169, origin=MessageChain(__root__=[Source(id=19527, time=datetime.datetime(2020, 8, 8, 1, 27, 3, tzinfo=datetime.timezone.utc)), Plain(type='Plain', text='1')])),
    At(type='At', target=xxxxxxxx, display='@雪洛千心山'),
    Plain(type='Plain', text=' '),
    At(type='At', target=xxxxxxxx, display='@雪洛千心山'),
    Plain(type='Plain', text=' 帮楼上百度')
]

如果回复消息中qq自动添加的at被删除之后则是:
image

[
    Source(id=19534, time=datetime.datetime(2020, 8, 8, 1, 36, 10, tzinfo=datetime.timezone.utc)),
    Quote(id=19527, groupId=xxxxxxxx, senderId=xxxxxxxx, targetId=xxxxxxxx, origin=MessageChain(__root__=[Source(id=19527, time=datetime.datetime(2020, 8, 8, 1, 27, 3, tzinfo=datetime.timezone.utc)), Plain(type='Plain', text='1')])),
    At(type='At', target=xxxxxxxx, display='@雪洛千心山'),
    Plain(type='Plain', text=' '),
    Plain(type='Plain', text='帮楼上百度')
]
@GreyElaina
Copy link
Member

mirai-core 的问题, 非本项目问题, 我没有做这种隐式添加消息元素的.

@GreyElaina GreyElaina reopened this Aug 8, 2020
@GreyElaina
Copy link
Member

@ieew 你使用 v3 时, 使用的是和 v4 一样的消息接收方式吗

@ieew
Copy link
Author

ieew commented Aug 9, 2020

用的一样的消息接收方式

@ieew
Copy link
Author

ieew commented Aug 9, 2020

今天检查了一下http api那边传过来的信息,接口获得的json为

{"type":"GroupMessage","messageChain":[{"type":"Source","id":19550,"time":1596959296},{"type":"Quote","id":19527,"senderId":xxxxxxxx,"targetId":xxxxxxxx,"groupId":xxxxxxxx,"origin":[{"type":"Source","id":19527,"time":1596850023},{"type":"Plain","text":"1"}]},{"type":"At","target":xxxxxxxx,"display":"@雪洛千心山"},{"type":"Plain","text":" "},{"type":"At","target":xxxxxxxx,"display":"@雪洛千心山"},{"type":"Plain","text":" 帮楼上百度"}],"sender":{"id":xxxxxxx,"memberName":"未知","permission":"OWNER","group":{"id":xxxxxxxx,"name":"个人网盘","permission":"MEMBER"}}}

经过确认,http api那边并没有返回多余的at

@coranholmes
Copy link

我也遇到这个问题,请问解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants