I think I've found a way to send any file to chats. But we need more research before be able to send anything. DO NOT EXCITE, yet.
There is a class I call MediaCollection used to prepare files before send to a chat. We could get it from module "dhcbbcecif". I don't know how to add to autodiscovery.
var mediaCollection = new modules["dhcbbcecif"].exports();
This object has a method to add more files to collection called processFiles. So we could use Blobs in order to add new files.
mediaCollection.processFiles([myBlob], chatObj, 1);
I guess it internally creates a Media object with all stuff it needs to send to a chat (including media keys).
Finally media object could be sent to a chat:
var mediaObj = mediaCollection.models[0];
mediaObject.sendToChat(chatObj, {})
I did not try the whole process, nor did I write any code. It is just a research.
May be we could use this for autodiscovery:
if (module.exports.prototype.processFiles !== undefined) {...}
Well, there seems to be no interest... But it works, I'm using it on new project: https://github.com/alfred82santa/whalesong/blob/master/js/src/whalesong/chat.js#L118
You can try to adapt code for mukulhase/WebWhatsapp-Wrapper
@alfred82santa this definitely has my interest, please keep it going.
feel free to test this feature: https://github.com/alfred82santa/whalesong#minibot
Most helpful comment
@alfred82santa this definitely has my interest, please keep it going.