Git Product home page Git Product logo

Comments (13)

mnixry avatar mnixry commented on June 1, 2024

我觉得有可能是gocq那边协议端的问题,因为这些数据处理的流程都是完全一样的,不太可能会出现视频有问题但是图片没有这种情况

你可以试着打开gocq的debug模式,检查一下消息发送前后API上报数据


另外我不太理解为什么要用判断cq码再使用event.dict这种形式,我记得message event是直接有reply字段的?

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

我觉得有可能是gocq那边协议端的问题,因为这些数据处理的流程都是完全一样的,不太可能会出现视频有问题但是图片没有这种情况

你可以试着打开gocq的debug模式,检查一下消息发送前后API上报数据

另外我不太理解为什么要用判断cq码再使用event.dict这种形式,我记得message event是直接有reply字段的?

image

gocq 和 nonebot 之前的协议我不是太熟悉,看了下似乎 gocq 只发送了个 [CQ:reply,id=xxxxx], 这个转成具体的回复消息是在 gocq 这边做的么,还是在 nonebot 做的?

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

我觉得有可能是gocq那边协议端的问题,因为这些数据处理的流程都是完全一样的,不太可能会出现视频有问题但是图片没有这种情况

你可以试着打开gocq的debug模式,检查一下消息发送前后API上报数据

另外我不太理解为什么要用判断cq码再使用event.dict这种形式,我记得message event是直接有reply字段的?

用这种奇怪的方式是因为我需要被回复的那条消息的 raw_message(一个带 cq 码的 str),而不是一个 dict 或 json_(:з」∠)_

from adapter-onebot.

StarHeartHunt avatar StarHeartHunt commented on June 1, 2024

event.reply 是 OneBot Adapter 在发现 reply 后去请求 /get_msg API 获取的,试一下手动调 gocq 的 API,检查一下这两条消息的内容。

说起来这个 Issue 也 Transfer 到 nonebot/adapter-onebot 比较好?

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

不好意思其实我是 Python 小白,请问是这样调用么_(:з」∠)_

红框内的那次是 event 中的输出[CQ:video,xxxx],黄框是手动调用的输出 [CQ:video,xxxx], 看起来 gocq 返回的是正常的

image

然后 gocq 这边本次的输出是这样的,还是不知道怎么让 gocq 那边把详细信息打印出来 orz

image

QQ 侧的会话内容

F74)2P(AO2R8CHYPWSS7H

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

另外提这个 issue 时使用的是 gocq v1.0.0-rc1, 当前手动调用验证的时候我更新了一下到 dev 的 最新 commit, 不过好像并没有什么区别

nonebot 没有更新,仍使用 2.0.0-beta.1

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

接着我又去源码里看了下,似乎是这里的 2 中把 [CQ:video,xxxx] 当成了 text 来解析导致的?

image

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

找到问题了,这个正则有问题,回复视频时 Message 的 url= 后面是没有值的,举例:

[CQ:video,file=1234567.mp4,url=]

但这里使用的是 + 匹配,要求 url= 后面仍有值,没有匹配上,最终给了 text

image

我将这里的 + 修改为 * 后可以正常匹配了,不过我对 CQ 协议不是特别了解,不知道这样修改后会不会引起别的注入问题,就不水 PR 了 2333, 期待大佬们早日修复一下这个问题~

image

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

转念一想,这个似乎是 gocq 的问题?CQ 协议有要求 = 后面一定有值么_(:з」∠)_我去翻翻他们的文档

from adapter-onebot.

mnixry avatar mnixry commented on June 1, 2024

转念一想,这个似乎是 gocq 的问题?CQ 协议有要求 = 后面一定有值么_(:з」∠)_我去翻翻他们的文档

原来是这个问题啊…以前有讨论过

nonebot/aiocqhttp#60

from adapter-onebot.

MistEO avatar MistEO commented on June 1, 2024

转念一想,这个似乎是 gocq 的问题?CQ 协议有要求 = 后面一定有值么_(:з」∠)_我去翻翻他们的文档

原来是这个问题啊…以前有讨论过

nonebot/aiocqhttp#60

确实可以了,感谢大佬 ✿✿ヽ(°▽°)ノ✿

from adapter-onebot.

mnixry avatar mnixry commented on June 1, 2024

@yanyongyu 这是一个Bug,我们应该进行修复。

参考PR:nonebot/aiocqhttp#65

from adapter-onebot.

yanyongyu avatar yanyongyu commented on June 1, 2024

fixed in latest commit 48fc96e

from adapter-onebot.

Related Issues (20)

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.