sulla
sulla copied to clipboard
Difference between CHATID and MESSAGE.FROM
i'm trying to send :
await client.sendImage( chatId (i guess message.from), 'path/to/img.jpg (the path without name.jpg?)', 'image-name.jpg (just name of image with extension)', 'Caption text (just text)' );
someone could help me? because when i send message or image is not working... await client.sendText(chatId, '👋 Hello from sulla!'); (using chatId as message.from) but this: client.sendText(message.from, '👋 Hello from sulla!'); works..! help me please!
The event listener
client.onMessage((message) => {
client.sendText(message.from, '👋 Hello from sulla!');
});
It works because inside the "onMessage" you have the object message, outside that function you don't have it.
So if you want to send an image outside the onMessage, you should have the chatid saved somewhere like a list or a db, and it is a string like "[email protected]".
i know it. i tried await client.sendText(chatId, '👋 Hello from sulla!' (works) but for send image no works.!