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

fix message to

上级 d073f7e1
......@@ -41,14 +41,14 @@ bot
.then(msg => {
log.info('Bot', 'recv: %s', msg.toStringEx())
// logToFile(JSON.stringify(msg.rawObj))
if (/^(ding|ping|bing)$/i.test(m.get('content'))) {
const replyMsg = m.reply('dong')
bot.send(replyMsg)
.then(() => { log.warn('Bot', 'REPLY: dong') })
}
})
.catch(e => log.error('Bot', 'ready: %s' , e))
if (/^(ding|ping|bing)$/i.test(m.get('content'))) {
const replyMsg = m.reply('dong')
bot.send(replyMsg)
.then(() => { log.warn('Bot', 'REPLY: dong') })
}
})
bot.init()
......
......@@ -115,7 +115,9 @@ class Message {
this.obj[prop] = value
return this
}
type () { return Message.Type[this.obj.type] }
type() { return Message.Type[this.obj.type] }
count() { return Message.counter }
dump() {
console.error('======= dump message =======')
......@@ -126,8 +128,6 @@ class Message {
Object.keys(this.rawObj).forEach(k => console.error(`${k}: ${this.rawObj[k]}`))
}
count() { return Message.counter }
static find(selector, option) {
return new Message({MsgId: '-1'})
}
......
......@@ -183,8 +183,8 @@ class PuppetWeb extends Puppet {
}
send(message) {
const userName = message.to().id
const content = message.content()
const userName = message.get('to')
const content = message.get('content')
log.silly('PuppetWeb', `send(${userName}, ${content})`)
return this.bridge.send(userName, content)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册