Error with JSON string when trying to add emojis/hexadecimal-encoded characters

248 Views Asked by At

Bear with me, I'm brand new to all of this and I need some help. I'm working on an AI with JSON and I'm trying to add emoji faces (like (ノ◕ヮ◕)ノ*:・゚✧, (✿◠‿◠), and so on) to an entity that my bot can later extract from at random. The easiest way I can describe it is, if the user says something specific, I want my bot to be able to answer with an emoji face instead of a text response, BUT I also want the response to be random.

Example:

Q: I hate you
A: (╥_╥)

Q: I hate you
A: (╯°□°)╯︵ ┻━┻

At first I thought I could just add a bunch of different emoji faces, but that's when I started getting the errors. If I just put the emoji in the string it gives me an error saying Incorrect token '(' at position 0.", and it will continue to say every character is an incorrect token.

I've been reading up on JSON and hexadecimal-encoded characters, And I've been trying to break down the emoji faces into codes like ( or ) but the response is coming out in code, not in parentheses like it should, and when I try to add \ or " I end up getting an error. My question is, am I missing something? Here is the JSON, The first part should just be ('), the second should be (╯°□°)╯︵ ┻━┻

[
  {
    "value": " ( ' ) ",
    "synonyms": [
      " &#40",
      " &#39",
      " &#41"
    ]
  },
  {
    "value": "(╯°□°)╯︵ ┻━┻",
    "synonyms": []
  }
]
0

There are 0 best solutions below