Search code examples
pythonpython-2.7emojifacebook-messengerfacebook-messenger-bot

How to suppress emoji in Facebook Messenger Bot - Python


does anyone if its possible to suppress an emoji's sent from a facebook messenger bot? I'm trying to send a list and 8) is turning into 😎 on facebook's end.

I'm wondering if theres any known escape characters or if I can encode it somehow (HTML encoding?).

Here is how I'm sending my request.

requests.post("https://graph.facebook.com/v2.6/me/messages",
    params={"access_token": token},
    data=json.dumps({
        "recipient": {"id": recipient},
        "message": {"text": "8)"}
    }),
    headers={'Content-type': 'application/json'})

Python 2.7.. Thanks!!


Solution

  • Yes, this is possible with the 'word joiner' unicode character. Here it is, between these arrows: ->⁠<-.

    It doesn't work if you send the HTML code, you need to send the actual character.

    For example:

    :⁠)