paked / messenger

Package messenger is used for making bots for use with Facebook messenger
MIT License
274 stars 72 forks source link

IDs from webhooks are strings and not numbers. #4

Closed 1lann closed 8 years ago

1lann commented 8 years ago

I don't know if they were numbers before, but at least now, user IDs from webhooks are numbers in strings. i.e. the json would be like:

{"sender":{"id":"1259905410705036"},"recipient":{"id":"1175644529126109"}, "..." }

This can be fixed by changing the structs to use strings instead of int64, or use something during decoding to convert it to an int64.

paked commented 8 years ago

Thanks for bringing this to my attention @1lann! Turns out Facebook recently changed their API. In order to keep backwards compatibility, I have left the value as an int64 but told json/encoding to look for a string.