未验证 提交 4a2c3b1c 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓) 提交者: GitHub

Merge pull request #1347 from lijiarui/add-quit-room-function-in-room-bot

test `room.quit()` in room-bot
......@@ -184,6 +184,21 @@ bot
if (msg.self()) {
return // skip self
}
/**
* `dong` will be the magic(toggle) word:
* bot will quit current room by herself.
*/
if (/^dong$/i.test(text)) {
if (room) {
await room.say('You said dong in the room, I will quit by myself!', from)
room.quit()
} else {
from.say('Nothint to do. If you say "dong" in a room, I will quit from the room.')
}
return
}
/**
* `ding` will be the magic(toggle) word:
* 1. say ding first time, will got a room invitation
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册