Since a few months, there's a pretty complete reverse of the MQTT protocol used by the messenger app implemented with two Instant Messaging libraries:
- bitlbee-facebook https://github.com/bitlbee/bitlbee-facebook
- purple-facebook https://github.com/dequis/bitlbee-facebook
Both share the same codebase and were essentially implemented by the same person, so you could either reuse the codebase or use bitlbee-facebook and do your thing on top of IRC.