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

Merge branch 'master' of github.com:Chatie/wechaty

...@@ -114,7 +114,7 @@ bot ...@@ -114,7 +114,7 @@ bot
) )
let n = 0 let n = 0
await from.say( await msg.say(
topicList topicList
.map(topic => ++n + '. ' + topic) .map(topic => ++n + '. ' + topic)
.join('\n'), .join('\n'),
...@@ -151,8 +151,12 @@ bot ...@@ -151,8 +151,12 @@ bot
if (/^froom$/.test(text)) { if (/^froom$/.test(text)) {
console.log('begin to check msg forward room') console.log('begin to check msg forward room')
const room = bot.Room.load('6350854677@chatroom') const dingRoom = await bot.Room.find({ topic: /^ding/i })
await msg.forward(room) if (dingRoom) {
await msg.forward(dingRoom)
} else {
msg.say('Cannot find dingRoom, please create a ding room first!')
}
return return
} }
...@@ -178,44 +182,6 @@ bot ...@@ -178,44 +182,6 @@ bot
return return
} }
if (/^delroom$/.test(text)) {
console.log('begin to check roomDel')
const room = bot.Room.load('6350854677@chatroom')
const contact = bot.Contact.load('qq512436430')
await room.del(contact)
from.say('room.del: ' + room + ', ' + contact)
return
}
if (/^addroom$/.test(text)) {
console.log('begin to check roomAdd')
const room = bot.Room.load('6350854677@chatroom')
const contact = bot.Contact.load('qq512436430')
await room.add(contact)
from.say('room.add: ' + room + ', ' + contact)
return
}
if (/^topicroom$/.test(text)) {
console.log('begin to check roomTopic')
const room = bot.Room.load('6350854677@chatroom')
await room.topic('change-to-wechaty')
from.say('room.topic: ' + room)
return
}
if (/^quitroom$/.test(text)) {
console.log('begin to check roomQuit')
const room = bot.Room.load('6350854677@chatroom')
await room.quit()
from.say('room.quit: ' + room)
return
}
if (/^(ding|ping|bing|code)$/i.test(msg.text()) /*&& !msg.self()*/) { if (/^(ding|ping|bing|code)$/i.test(msg.text()) /*&& !msg.self()*/) {
/** /**
* 1. reply 'dong' * 1. reply 'dong'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册