jgorset / facebook-messenger

Definitely the best way to make Bots on Facebook Messenger with Ruby
MIT License
962 stars 211 forks source link

Message Request Acceptance case not accounted for? #137

Closed echan00 closed 7 years ago

echan00 commented 7 years ago

I sent myself a message via Messenger UI on the Facebook website today. This is a bot I previously interacted with but removed from messenger. After I accepted the chat request on messenger I received the following error on my bot server.

Facebook::Messenger::Incoming::UnknownPayload: {"recipient"=>{"id"=>"1110601652364180"}, "timestamp"=>1492108574712, "sender"=>{"id"=>"1120238611424434"}, "message_request"=>"accept"}

File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/incoming.rb" line 35 in parse File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/bot.rb" line 57 in receive File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 135 in block (2 levels) in trigger File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 134 in each File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 134 in block in trigger File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 128 in each File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 128 in trigger File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 50 in receive File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 29 in call File "/app/vendor/bundle/ruby/2.2.0/bundler/gems/facebook-messenger-60693ce5b6ec/lib/facebook/messenger/server.rb" line 19 in call File "/app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/routing/mapper.rb" line 51 in serve File "/app/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.5.1/lib/action_dispatch/journey/router.rb" line 43 in block in serve

jgorset commented 7 years ago

Ah, ok, so Facebook is sending us something when you accept a message request now and we don't recognise it. It'd be cool to have a hook for this like we do for on :message! If you need it, please feel free to submit a pull request. Your :sparkles: :cake: :sparkles: awaits!

abury commented 7 years ago

Is this in v1? I'm still getting this error running on 1.0.0

Edit; Answered my own question, no it's not. @jgorset are there plans for a new release? Let me know if I can help at all.