danielcardeenas/sulla

Difference between CHATID and MESSAGE.FROM

jona950 opened this issue ยท 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!

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 "00123456789@c.us".

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