Comments (5)
@smashah any comment)?
from wa-automate-nodejs.
hey @uargb Can you share the code that you're using?
The index.ts in the demo literally reads a file, saves it and sends it back to the number that sent the file so it should work fine.
from wa-automate-nodejs.
Hello, I want to send a video (aaa.mp4) that is in the same folder of the server.js file and what am I doing wrong? help please...
// import { create, Whatsapp } from 'sulla-hotfix';
const sulla = require('sulla-hotfix');
sulla.create().then(client => start(client));
var fs = require('fs');
// function to encode file data to base64 encoded string
function base64_encode(file) {
// read binary data
var bitmap = fs.readFileSync(file);
// convert binary data to base64 encoded string
return new Buffer(bitmap).toString('base64');
}
a=base64_encode("aaa.mp4");
var base64str = 'data:video/mp4'+";base64,"+a.toString('base64')
console.log(base64str)
function start(client) {
client.onMessage(async message => {
if (message.body === 'Hi') {
client.sendText(message.from, '👋 Hello from sulla!');
await client.sendFile(message.from,[base64str],'aaa.mp4', `Hello this is the caption`)
console.log()
//client.sendText(message.from, '👋 Hello from sulla!');
}
/*
console.log(message)
console.log("................................................................................")
console.log(message.mimetype)
console.log("...............................................................")
const mediaData = decryptMedia(message);
console.log(mediaData)
*/
});
}
from wa-automate-nodejs.
@Marcoserious why are there square brackets around base64str?
from wa-automate-nodejs.
I'm closing this issue for now. Please keep me updated if there are some more issues.
from wa-automate-nodejs.
Related Issues (20)
- QR does not appear HOT 3
- Not getting scanner/QR HOT 8
- I'm stuck on authenticating HOT 2
- frame nav breaks launch HOT 2
- client.inviteInfo return undefined HOT 2
- await Client.getAllUnreadMessages() returning "Error [TypeError]: _0x30d707[("NyC" + "SU")](...) is not a function" HOT 1
- await Client.getAmountOfLoadedMessages() returns error "Error [TypeError]: Cannot read properties of undefined (reading 'length')"
- There are some launch regressions in 4.71.1 HOT 15
- sendTextWithMentions() returns "Error [TypeError]: Store[("add" + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + _0x502bb1(...) + "t")] is not a function" HOT 1
- client.deleteMessage() returns Error [TypeError]: mmrrf(...) is not a function HOT 1
- code based login (instead of qr code)
- approveGroupJoinRequest() returns error TypeError: _0x461cc2[("moZ" + "AY")](...) is not a function
- linkpreview improvements HOT 2
- Regarding licensing.
- [insiders] feat: `sendStoryWithThumb` HOT 3
- Not able to send message using .sendText method. | PS: have not purchased any license or anything. HOT 1
- WA not functioning after update
- forwardmessages not working on 4.71.0 - 4.71.10
- Client.getAllUnreadMessages() returns: TypeError: Cannot read properties of undefined (reading 'profilePicFind')
- Memory leak + cannot receive any message HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wa-automate-nodejs.