sulla icon indicating copy to clipboard operation
sulla copied to clipboard

Difference between CHATID and MESSAGE.FROM

Open jona950 opened this issue 4 years ago • 2 comments

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!

jona950 avatar May 27 '20 02:05 jona950

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]".

ValerioCietto avatar May 27 '20 12:05 ValerioCietto

i know it. i tried await client.sendText(chatId, '👋 Hello from sulla!' (works) but for send image no works.!

jona950 avatar May 27 '20 17:05 jona950