2013-08-01 45 views
1

Hubot是一款出色的工具,该机器人集成在我们的聊天室中并部署了多项任务。一些额外的功能已被添加到hubot这样的命令和问候。我不是很好的咖啡剧本,目前想找到一种方式,Hubot迎接谁在一天(@uersname Good morning, @username Good Afternoon, etc.)Hubot在登录聊天室时欢迎@username

一个简单的Hello创建相应的登录到聊天室的时间用户:

# hubot greeting. 
# 
# (hi|hello) - say hi to your butler 

module.exports = (robot) -> 
    robot.respond /hi|hello/i, (msg) -> 
    msg.send "Howdy!" 
+0

您正在使用哪种适配器? –

+0

“你好”,也许太不正式了,它是一个机器人助手,不是一个枪手 –

回答

2

我我不太确定如何获得用户手柄,但有一个事件robot.enter

robot.enter (response) -> 
     msg.send "Welcome, Lord #{response.message.user.name}"