botmasterai / botmaster

The chatbot framework for your serious projects
http://botmasterai.com/
MIT License
251 stars 47 forks source link

Sender id varies and botmaster can't handle incoming messages #27

Closed andremw closed 7 years ago

andremw commented 7 years ago

I've set two instances of botmaster-messenger listening to two different pages (two different pageTokens). I then sent one message from my personal account to each of these two pages and did a simple reply(return bot.reply(update, 'Hello world');) but got this error:

StatusCodeError: 400 - {"error":{"message":"(#100) No matching user found","type":"OAuthException","code":100,"error_subcode":2018001,"fbtrace_id":"BJFnjNlYWmT"}} I noticed in the update obj that the sender id (that should be the same, right?) varies, and I think that it may be related to the error.

The update object of the message sent to each page:

{"sender":{"id":"1562151773797420"},"recipient":{"id":"311723625925833"},"timestamp":1495198187591,"message":{"mid":"mid.$cAAEbgvNWwbFiUgcIR1cIMG_0iWpC","seq":31635,"text":"hi"},"raw":{"id":"311723625925833","time":1495198187640,"messaging":[{"sender":{"id":"1562151773797420"},"recipient":{"id":"311723625925833"},"timestamp":1495198187591,"message":{"mid":"mid.$cAAEbgvNWwbFiUgcIR1cIMG_0iWpC","seq":31635,"text":"hi"}}]}}

{"sender":{"id":"1354592824626036"},"recipient":{"id":"1335710399797960"},"timestamp":1495198190004,"message":{"mid":"mid.$cAAS-0nNMF7BiUgcRtFcIMHJREirb","seq":31638,"text":"hey"},"raw":{"id":"1335710399797960","time":1495198190087,"messaging":[{"sender":{"id":"1354592824626036"},"recipient":{"id":"1335710399797960"},"timestamp":1495198190004,"message":{"mid":"mid.$cAAS-0nNMF7BiUgcRtFcIMHJREirb","seq":31638,"text":"hey"}}]}}

The error happens only for the second bot I add, not for the first one. If I invert the order of the addBot the one that was throwing an error works and the one that was working stops working.

I googled and found some issues ([1], [2] related to it, but it seems that it should be fixed by now. It seems that the issue was that sometimes the id came as string and sometimes as number, but it's not what's happening to me..

Any idea?

jdwuarin commented 7 years ago

Hey, this issue should be raised on botmaster-messenger. I created an issue there referencing this one. Closing this issue.

The issue can be found here: https://github.com/botmasterai/botmaster-messenger/issues/5