-
Notifications
You must be signed in to change notification settings - Fork 65
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
room.say(file)报错 #295
Comments
Can you reproduce this problem use this example code? |
可以。如下 |
是只有我有这个问题?还是这个是BUG?有人能够解答下么? |
0. Report Issue Guide
1. Versions
What is your wechaty version?
Answer:0.46.4"
What is your wechaty-puppet-padplus version?
Answer:0.7.36
What is your node version? (run
node --version
)Answer:12.16.1
What os are you using
Answer:windows
2. Describe the bug
room.say(FileBox)报错,代码如下:
var base64Code = fileList[i].fileStr;
var fileName = fileList[i].realFileName;
const fileBox1 = FileBox.fromBase64(base64Code, fileName);
room.say(fileBox1);
其中的base64Code和fileName是机器人通过请求第三方系统得到。报错信息如下:
16:16:56 INFO PadplusManager ready to restart due to receive event: reconnect
16:16:56 ERR can not get response from grpc server
(node:8112) UnhandledPromiseRejectionWarning: Error: no padplus message
at PadplusManager. (E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\padplus-manager\padplus-manager.js:838:23)
at Generator.next ()
at E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\padplus-manager\padplus-manager.js:8:71
at new Promise ()
at __awaiter (E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\padplus-manager\padplus-manager.js:4:12)
at PadplusManager.sendFile (E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\padplus-manager\padplus-manager.js:835:16)
at PuppetPadplus. (E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\puppet-padplus.js:1012:56)
at Generator.next ()
at fulfilled (E:\Project\getHappy\node_modules\wechaty-puppet-padplus\dist\src\puppet-padplus.js:5:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:8112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by reje
cting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:8112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process
with a non-zero exit code.
代码跟踪发现在message.ts中的uploadFile方法。
public async uploadFile (fileBox: FileBox): Promise {
log.verbose(PRE,
recallMessage
)const data = {
data: await fileBox.toBase64(),
filename: fileBox.name,
}
}
res得到为空,导致后续报错。
3. To Reproduce
This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.
Steps to reproduce the behavior:
4. Expected behavior
Give a clear and concise description of what you expected to happen.
5. Actual behavior
If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.
6. Full Output Logs
Set env
WECHATY_LOG=silly
in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)We need full log instead of log screenshot or log fragments!
Show Logs
7. Additional context
Add any other context about the problem here.
[bug]
The text was updated successfully, but these errors were encountered: