From a5ef75e03ba651495954733747c18e0197bccd32 Mon Sep 17 00:00:00 2001 From: Zhuohuan LI Date: Sat, 3 Sep 2016 15:48:37 +0800 Subject: [PATCH] code clean --- example/tuling123-bot.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/example/tuling123-bot.js b/example/tuling123-bot.js index 463c006a..501f4fe9 100644 --- a/example/tuling123-bot.js +++ b/example/tuling123-bot.js @@ -15,7 +15,11 @@ const co = require('co') const Tuling123 = require('tuling123-client') const EventEmitter2 = require('eventemitter2') -const Wechaty = require('..') +const { + Wechaty + , Config +} = require +('../') //log.level = 'verbose' // log.level = 'silly' @@ -28,7 +32,9 @@ const Wechaty = require('..') const TULING123_API_KEY = '18f25157e0446df58ade098479f74b21' const brain = new Tuling123(TULING123_API_KEY) -const bot = new Wechaty({ profile: 'example-bot.wechaty.json' }) +const bot = new Wechaty({ + profile: Config.DEFAULT_PROFILE +}) console.log(` Welcome to Tuling Wechaty Bot. @@ -44,7 +50,7 @@ bot .on('login' , user => log.info('Bot', `bot login: ${user}`)) .on('logout' , e => log.info('Bot', 'bot logout.')) .on('scan', ({url, code}) => { - console.log(`Scan QR Code in url to login: w${code}\n${url}`) + console.log(`Scan QR Code in url to login: ${code}\n${url}`) }) .on('message', m => { if (bot.self(m)) return -- GitLab