Use any emoji as the chat emoji on Facebook Messenger


Facebook Messenger offers a feature they call the 'chat emoji' - a big button displayed in place of the 'send' button when no message content is present, which sends a nice big emoji to the chat.

They offer a fairly impressive palette of emoji to choose from, but one thing always stood out to me: the selection of national flags available is, frankly, piss poor. I have long thought that there must be a solution to this, but was never able to find one.

I previously tried intercepting the request to Facebook's servers using mitmproxy, but that didn't work because I wasn't able to work out whatever method of request signing they use. I was barking up the wrong tree, it turns out, as there's a node.js library to do exactly what I want. Here's how to impress your friends with your emoji hacking skills:

# First, install the library:
$ sudo npm install facebook-chat-api

Then you can write your program with a text editor, or even straight into the node REPL console:

const login = require("facebook-chat-api");

login({email: "", password: "s3cr3t"}, (err, api) => {
	if (err) return console.error(err);
	api.changeThreadEmoji("πŸ‡ΈπŸ‡¨", "00000000000000000", (err) => {
		if (err) return console.error(err);

Just replace "00000000000000000" with the ID number of the chat you want to change (visible in the address bar while using Messenger Web.) Execute it with node myscript.js, and check Facebook. Your cool new emoji should be visible. It's probably worth running shred -u on your file (or on ~/.node_repl_history) so that there aren't any traces of your Facebook password left on your hard drive.

So that's it! Now you can use any emoji you like in your Facebook group chats.

... except two, unfortunately. The Scottish and Welsh flags don't render correctly - you can see them in some places, but mostly they are replaced by an empty box or a generic "thumbs up" symbol. Ironically this was the reason I embarked on this journey in the first place, so I remain as dissatisfied with my Messenger experience as ever. Hopefully Facebook will recognise our right to be annoyingly patriotic along with the rest of the world soon!

Back to my homepage