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

chore(clean): code & doc

上级 914de986
......@@ -6,7 +6,8 @@
Wechaty is a Bot Framework for Wechat **Personal** Account which can help you create a bot in 6 lines of javascript by easy to use API, with cross-platform support include [Linux](https://travis-ci.org/chatie/wechaty), [Windows](https://ci.appveyor.com/project/chatie/wechaty), [Darwin(OSX/Mac)](https://travis-ci.org/chatie/wechaty) and [Docker](https://circleci.com/gh/chatie/wechaty).
[![Join the chat at https://gitter.im/zixia/wechaty](https://badges.gitter.im/zixia/wechaty.svg)](https://gitter.im/zixia/wechaty?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![node](https://img.shields.io/node/v/wechaty.svg?maxAge=604800)](https://nodejs.org/) [![Repo Size](https://reposs.herokuapp.com/?path=Chatie/wechaty)](https://github.com/chatie/wechaty) [![Issue Stats](http://issuestats.com/github/chatie/wechaty/badge/pr)](http://issuestats.com/github/chatie/wechaty) [![Issue Stats](http://issuestats.com/github/chatie/wechaty/badge/issue)](http://issuestats.com/github/chatie/wechaty)
[![Join the chat at https://gitter.im/zixia/wechaty](https://badges.gitter.im/zixia/wechaty.svg)](https://gitter.im/zixia/wechaty?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![node](https://img.shields.io/node/v/wechaty.svg?maxAge=604800)](https://nodejs.org/) [![Repo Size](https://reposs.herokuapp.com/?path=Chatie/wechaty)](https://github.com/chatie/wechaty)
[![Issue Stats](http://issuestats.com/github/chatie/wechaty/badge/pr)](http://issuestats.com/github/chatie/wechaty) [![Issue Stats](http://issuestats.com/github/chatie/wechaty/badge/issue)](http://issuestats.com/github/chatie/wechaty)
:octocat: <https://github.com/chatie/wechaty>
:beetle: <https://github.com/chatie/wechaty/issues>
......
......@@ -131,11 +131,11 @@ function wechaty::runBot() {
local -i ret=0
case "$botFile" in
*.js)
echo "Executing node $*"
if [ "$NODE_ENV" != "production" ]; then
echo "Executing babel-node --presets es2015 $*"
babel-node --presets es2015 "$@" &
else
echo "Executing node $*"
node "$@" &
fi
;;
......
......@@ -85,7 +85,9 @@ export class Contact implements Sayable {
private dirtyObj: ContactObj | null
private rawObj: ContactRawObj
constructor(public readonly id: string) {
constructor(
public readonly id: string,
) {
log.silly('Contact', `constructor(${id})`)
if (typeof id !== 'string') {
......@@ -499,15 +501,15 @@ export class Contact implements Sayable {
throw new Error('unsupport name type')
}
const list = await Config.puppetInstance()
const contactList = await Config.puppetInstance()
.contactFind(filterFunction)
.catch(e => {
log.error('Contact', 'findAll() rejected: %s', e.message)
return [] // fail safe
})
await Promise.all(list.map(c => c.ready()))
await Promise.all(contactList.map(c => c.ready()))
return list
return contactList
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册