Closed wj-Mcat closed 4 years ago
And more, @huan I test the fromFile method in ts-wechaty with wechaty-puppet-hostie to send local file, it also throw the unsupported protocol file-box-type error.
Yes, that's we are using the GRPC and the FileBox
has to be serialized via the JSON.stringify()
.
I believe we can rely on your current solution for working around this:
FileBox.fromFile()
to load a fileFileBox
load the local file and set itself a base64
typeAdditionally, if you want to align with TS more strictly, please see the issue that talking about the FileBox types with the GRPC serialization: https://github.com/huan/file-box/issues/25
When I improve this method, I find that the type of
base64
data field isbytes
, notstr
. So I fix this data typing bugs.And more, @huan I test the
fromFile
method ints-wechaty
withwechaty-puppet-hostie
to send local file, it also throw the unsupported protocol file-box-type error.So, to make
from_file
work well now, I change the protocol FileBoxType infrom_file
method toBase64
Type. And it can work well.