makara-filip / ts-messenger-api

The unofficial API for FB Messenger communication
MIT License
51 stars 13 forks source link

sendMessage() resolves before message is sent #15

Closed adamhl8 closed 2 years ago

adamhl8 commented 3 years ago

Describe the bug I might be missing something/doing something dumb, but it seems like sendMessage() resolves its promise before actually sending the message.

To Reproduce

// login stuff

await api.listen();
await api.sendMessage({ body: 'Hi' }, friends[0].id);
process.exit(0) // Exit immediately after sending message.
// Message never actually gets sent.

Expected behavior sendMessage() fully sends message before resolving.

Environment (please complete the following information):

hoangvu12 commented 3 years ago

I don't think you will know if the message sent...