From dd36db06d2053fe5e6b88e14f94c772738041f3e Mon Sep 17 00:00:00 2001 From: Zhuohuan LI Date: Tue, 17 May 2016 00:52:23 +0800 Subject: [PATCH] fix --- circle.yml | 9 --------- example/roger-bot.js | 6 +++--- src/puppet-web-browser.js | 1 + src/wechaty.js | 2 +- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/circle.yml b/circle.yml index 5d84fc73..94953245 100644 --- a/circle.yml +++ b/circle.yml @@ -1,15 +1,6 @@ machine: node: version: 6.1.0 - post: - - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' - - sudo apt-get update - - sudo apt-get install google-chrome-stable - -dependencies: - post: - notify: webhooks: # A list of hook hashes, containing the url field diff --git a/example/roger-bot.js b/example/roger-bot.js index 9a9e390a..ce7dceae 100644 --- a/example/roger-bot.js +++ b/example/roger-bot.js @@ -1,11 +1,10 @@ -const log = require('npmlog') -log.level = 'silly' const Wechaty = require('../src/wechaty') -const bot = new Wechaty({head: true}) +const bot = new Wechaty() bot.init() .then(bot.getLoginQrImgUrl.bind(bot)) .then(url => console.log(`Scan qrcode in url to login: \n${url}`)) +.catch(e => console.error(e)) bot.on('message', m => { console.log('RECV: ' + m.get('content')) // 1. print received message @@ -16,4 +15,5 @@ bot.on('message', m => { bot.send(reply) // 3. do reply! .then(() => console.log('REPLY: roger.')) // 4. print reply message + .catch(e => console.error(e)) }) diff --git a/src/puppet-web-browser.js b/src/puppet-web-browser.js index bbbae243..945f82cd 100644 --- a/src/puppet-web-browser.js +++ b/src/puppet-web-browser.js @@ -54,6 +54,7 @@ class Browser { .set('phantomjs.binary.path', phantomjsExe) .set('phantomjs.cli.args', [ '--ignore-ssl-errors=true' // this help socket.io connect with localhost + , '--load-images=false' , '--remote-debugger-port=9000' ]) diff --git a/src/wechaty.js b/src/wechaty.js index 0ab22ac8..56dc484f 100644 --- a/src/wechaty.js +++ b/src/wechaty.js @@ -56,7 +56,7 @@ class Wechaty extends EventEmitter { return 'dong' } - getLoginQrImgUrl() { return puppet.getLoginQrImgUrl() } + getLoginQrImgUrl() { return this.puppet.getLoginQrImgUrl() } } Puppet.Web = PuppetWeb -- GitLab