提交 1e2075ef 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

format

上级 404c73fb
......@@ -38,24 +38,24 @@ bot.on('message', (m) => {
.then(msg => log.warn('Bot', 'recv: %s', msg))
.catch(e => log.err('Bot', 'ready: ' + e))
log.info('Bot', 'recv: %s', m)
if (/^ding|ping$/.test(m.get('content'))) {
const r = new Wechaty.Message()
r.set('to', m.get('from'))
r.set('content', 'dong')
bot.send(r)
.then(() => { log.info('Bot', 'REPLY: dong') })
}
log.info('Bot', 'recv: %s', m)
if (/^ding|ping$/.test(m.get('content'))) {
const r = new Wechaty.Message()
r.set('to', m.get('from'))
r.set('content', 'dong')
bot.send(r)
.then(() => { log.info('Bot', 'REPLY: dong') })
}
})
function login() {
log.info('Bot', 'Welcome to Wechaty')
log.info('Bot', 'Welcome to Wechaty')
bot.puppet
.getLoginQrImgUrl()
.then(url =>
console.log(`\n\nAction needed. Scan the belowing QRCode to login:\n\n${url}\n\nTip: You can copy/paste it to a web browser.\n`)
).catch(e => log.error('Bot', 'promise rejected'))
bot.puppet
.getLoginQrImgUrl()
.then(url =>
console.log(`\n\nAction needed. Scan the belowing QRCode to login:\n\n${url}\n\nTip: You can copy/paste it to a web browser.\n`)
).catch(e => log.error('Bot', 'promise rejected'))
}
bot.on('login' , () => npm.info('Bot', 'logined'))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册