juzibot / donut-tester

40 stars 4 forks source link

通过file-box获取到网络的文件进行推送报错 #48

Closed archerzhaopan closed 3 years ago

archerzhaopan commented 3 years ago

我在 node js中使用以下的代码推送网络文件的时候报错, console.log('message='+message) const { FileBox } = require('file-box') const fileSay = FileBox.fromUrl( FileURL,decodeURI(FileReName),) console.log('REPLY: %s'+fileSay.toString()) console.log('---------------------------------'+ fileSay.toString()) 返回以下信息:

13 INTERNAL: can not get message callback response, data: {"content":"","to_wxid":"1XXXXXXX@chatroom"}

在未升级的时候,使用 wechaty-puppet-padplus服务是可以通过此方法推送的。

su-chang commented 3 years ago
const urlFileBox = FileBox.fromUrl('PUT_FILE_URL_LINK_HERE')
await message.say(urlFileBox)

参考以上代码测试下。 decodeURI或者考虑将该方法移除后测试下。

感谢配合。

archerzhaopan commented 3 years ago

你这边的提供的方法已测试不可行,而且官网的用法是

archerzhaopan commented 3 years ago

另外,我在这里https://github.com/wechaty/python-wechaty-puppet-hostie/blob/631841448dbaaa48dc1eb8718fc5c51c95f9a3fe/src/wechaty_puppet_hostie/puppet.py#L334 发现了类似的问题,请问是否有关系?

su-chang commented 3 years ago

你用的是python语言的wechaty么? 如果是的话,请尝试用typescript的版本尝试下。后者是没有问题的,前者需要在你所发的链接中继续提问。

archerzhaopan commented 3 years ago

不是的,我是直接用node的。我感觉是回调不了FileBox,发送文件除了使用FileBox,还有其他可选的嘛?

su-chang commented 3 years ago

wechaty中发送文件统一使用FileBox来进行操作的。

联系juzibot,并将token发送给他协助你排查下此问题。

archerzhaopan commented 3 years ago

逐行调试,发现是say(messageStr),发现是messageStr不能为null或者“”。 否则会返回:

13 INTERNAL: can not get message callback response, data: {"content":"","to_wxid":"xxxxxxx"}