diff --git a/README.md b/README.md index 1279e3da43c35522f177262bdbf0f46d345fb8f1..fa5e1af0d35bea2f5b4d1afc80c7331c511dbac4 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ Notice that you need to wait a moment while bot trys to get the login QRCode fro After that, bot will be on duty. (roger-bot source can be found at [here](https://github.com/zixia/wechaty/blob/master/example/roger-bot.js)) -## 2. Advanced: 50 lines -There's another basic usage demo bot named [ding-dong-bot](https://github.com/zixia/wechaty/blob/master/example/ding-dong-bot.js), who can reply _dong_ when bot receives a message _ding_. +## 2. Advanced: dozens of lines +Here's an chatbot [ding-dong-bot](https://github.com/zixia/wechaty/blob/master/example/ding-dong-bot.js) who can reply _dong_ when receives a message _ding_. -## 3. Hardcore: 100 lines -To Be Written. +## 3. Hardcore: hundreds of lines +Here's a chatbot [api-ai-bot](https://github.com/zixia/wechaty/blob/master/example/api-ai-bot.js), who can slightly understand NLP. -Plan to glue with Machine Learning/Deep Learning/Neural Network/Natural Language Processing. +Natual Language Understanding enabled by [api.AI](https://api.ai), you can get your module on api.AI by it's free plan. # Installation diff --git a/src/puppet-web-bridge.js b/src/puppet-web-bridge.js index be2fe549bc2d0a85eb0014df24cc64d9489e603d..98386669c54236736ffb9668385aff37c38e02f3 100644 --- a/src/puppet-web-bridge.js +++ b/src/puppet-web-bridge.js @@ -112,7 +112,7 @@ class Bridge { ) ).toString('base64') // see: http://blog.sqrtthree.com/2015/08/29/utf8-to-b64/ - const argsDecoded = `JSON.parse(decodeURIComponent(atob('${argsEncoded}')))` + const argsDecoded = `JSON.parse(decodeURIComponent(window.atob('${argsEncoded}')))` const wechatyScript = `return (Wechaty && Wechaty.${wechatyFunc}.apply(undefined, ${argsDecoded}))` log.silly('Bridge', 'proxyWechaty: ' + wechatyScript)