Webwhatsapp-wrapper: [RESEARCH] MediaCollection

Created on 11 Jun 2018  路  5Comments  路  Source: mukulhase/WebWhatsapp-Wrapper

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.

Feature Request enhancement

Most helpful comment

@alfred82santa this definitely has my interest, please keep it going.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drsoporte picture drsoporte  路  5Comments

kashif-raza picture kashif-raza  路  5Comments

kivlanzein picture kivlanzein  路  6Comments

EdisonHundLucas picture EdisonHundLucas  路  6Comments

shakraw picture shakraw  路  5Comments