Skip to content

Commit 7990e98

Browse files
committed
Update wechat.js
1 parent d4891aa commit 7990e98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wechat.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Wechat extends WechatCore {
5252
}
5353

5454
sendMsg (msg, toUserName) {
55-
if (typeof msg === 'string') {
55+
if (typeof msg !== 'object') {
5656
return this.sendText(msg, toUserName)
5757
} else if (msg.emoticonMd5) {
5858
return this.sendEmoticon(msg.emoticonMd5, toUserName)
@@ -279,6 +279,7 @@ class Wechat extends WechatCore {
279279
})
280280
})).catch(err => {
281281
debug(err)
282+
this.emit('error', err)
282283
})
283284
}
284285
if (msg.ToUserName === 'filehelper' && msg.Content === '退出wechat4u' ||

0 commit comments

Comments
 (0)