Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Github Hubot在登录聊天室时问候@username_Github_Coffeescript_Hubot - Fatal编程技术网

Github Hubot在登录聊天室时问候@username

Github Hubot在登录聊天室时问候@username,github,coffeescript,hubot,Github,Coffeescript,Hubot,Hubot是一个很好的工具,机器人集成在我们的聊天室中,并部署了多项任务。hubot中增加了一些额外的功能,例如,在接到命令时打招呼。我对咖啡脚本不是很在行,目前我想为Hubot找到一种方法,根据当天的时间向登录聊天室的用户打招呼(@uersname早上好,@username下午好,等等)。 创建了一个简单的Hello: # hubot greeting. # # (hi|hello) - say hi to your butler module.exports = (robot) ->

Hubot是一个很好的工具,机器人集成在我们的聊天室中,并部署了多项任务。hubot中增加了一些额外的功能,例如,在接到命令时打招呼。我对咖啡脚本不是很在行,目前我想为Hubot找到一种方法,根据当天的时间向登录聊天室的用户打招呼
(@uersname早上好,@username下午好,等等)。

创建了一个简单的Hello:

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

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

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

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

你用的是哪种适配器?“你好”,也许太随便了,它是一个机器人助手而不是一个扔枪的人