Closed ghost closed 7 years ago
I'm experiencing the same issue too.
I added a pull request to fix that problem. Just a simple backslash remover function xD
Got the same problem here, tried using your pull req but it doesn't work for me ( /\/s aren't accepted for me, tried using /\\/s but doesn't work either). Managed to do it by doing a simple .split('\\').join(' ') which is weird, but which works.
Sorry. I might not have time to push a new release to npm today.
Do you have a copy of the JSON that is failing? I wonder if I can submit it to the folks at Cleverbot to see if their API is returning malformed JSON.
Thanks!
There you go. http://pastebin.com/rmGRGjYY
Also found out that -logically- Cleverbot doesn't like when we're using "s. Adding a replace for them in the message part could be wiser.
Testing this out.. It also sometimes breaks on the new emojis.. Needs more testing
From the string \test\\\.
I can say that the JSON returned is not escaped for input
and successive fields. Maybe Cleverbot can fix this?
I pushed a new version that I think should fix it. Please try now.
So sometimes my bot errors with unexpected token found in JSON... Error can be found here https://sentry.io/share/issue/3133353338302e323234363239343030/