这有效:
root@dev:~/hubot# bin/hubot forever start -w --watchDirectory ${PWD} --watchIgnore ${PWD}/*.log --pidfile ${PWD}/hubot.pid -l ${PWD}/hubot.log -a -c coffee node_modules/.bin/hubot --adapter slack
奇怪的是,当我尝试用本地开发和测试时:
root@dev:~/hubot# bin/hubot
[Thu Apr 07 2016 00:33:10 GMT+0000 (UTC)] INFO hubot-redis-brain: Using default redis on localhost:6379
eve>
eve> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen
当我在shell中输入帮助时,我的脚本或模块都没有显示。但是当我在松弛时这样做时,我会看到所有可用的脚本和模块:
eve <user> doesn't have <role> role - Removes a role from a user
eve <user> has <role> role - Assigns a role to a user
eve adapter - Reply with the adapter
eve delete reminder <action> - Delete reminder matching <action> (exact match required)
eve deploy <gitsha> to production - Runs Jenkins Phase 1 deployment.
eve echo <text> - Reply back with <text>
eve flip production pools - Flips the yin and yang production pools
eve help - Displays all of the help commands that Hubot knows about.
eve help <query> - Displays all help commands that match <query>.
eve list jobs - List current cron jobs
eve new job "<crontab format>" <message> - Schedule a cron job to say something
eve new job <crontab format> "<message>" - Ditto
eve new job <crontab format> say <message> - Ditto
eve ping - Reply with pong
**更新1:我打开了调试级别日志记录,我可以看到脚本正在被解析,但执行命令时我无法使用这些脚本:(**
[2016年4月7日00:46:44 GMT + 0000(UTC)] DEBUG加载适配器shell 前夕&GT; [2016年4月7日00:46:44 GMT + 0000(UTC)] DEBUG加载脚本 from / root / hubot / scripts [Thu Apr 07 2016 00:46:44 GMT + 0000(UTC)] DEBUG为/root/hubot/scripts/example.coffee解析帮助[2007年4月4日 2016 00:46:44 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/scripts/prod_deploy.coffee [2016年4月7日星期四00:46:44 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/scripts/remindme.coffee [2016年4月7日00:46:44 GMT + 0000 (UTC)] DEBUG解析/root/hubot/scripts/team_tools.coffee的帮助 [2016年4月7日00:46:44 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/scripts/update.coffee [2016年4月7日00:46:44 GMT + 0000 (UTC)] DEBUG从/ root / hubot / src / scripts加载脚本[2007年4月4日星期四 2016 00:46:44 GMT + 0000(UTC)] DEBUG从中加载hubot脚本 / root / hubot / node_modules / hubot-scripts / src / scripts [2016年4月7日星期四 00:46:44 GMT + 0000(UTC)] DEBUG从npm加载外部脚本 套餐[Thu Apr 07 2016 00:46:45 GMT + 0000(UTC)] DEBUG解析帮助 for /root/hubot/node_modules/hubot-diagnostics/src/diagnostics.coffee [2016年4月7日00:46:45 GMT + 0000(UTC)] INFO hubot-redis-brain: 在localhost上使用默认redis:6379 [2016年4月7日星期四00:46:45 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/node_modules/hubot-redis-brain/src/redis-brain.coffee [星期四 2016年4月7日00:46:45 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/node_modules/hubot-auth/src/auth.coffee [2016年4月7日星期四 00:46:45 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/node_modules/hubot-help/src/help.coffee [2016年4月7日星期四 00:46:45 GMT + 0000(UTC)] DEBUG解析帮助 /root/hubot/node_modules/hubot-cron/src/scripts/cron.coffee
更新2:我意识到我的问题的一部分是在bin / hubot文件中明确地将我的机器人名称作为前夕,而我一直在尝试使用evedev,我的开发hubot名称。但是,我仍然想知道为什么help命令没有显示所有可用的命令,但是当我在Slack时,它确实如此。
答案 0 :(得分:1)
您可以在bin/hubot
看起来像exec node_modules/.bin/hubot --name "botname" "$@"
通过上述设置,机器人名称将为botname
答案 1 :(得分:1)
作为对更新2 的回答,您需要在键入help
之前输入机器人名称,如下所示:
myhubot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen
VS
myhubot> myhubot help
myhubot> Shell: myhubot adapter - Reply with the adapter
myhubot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
myhubot echo <text> - Reply back with <text>
myhubot help - Displays all of the help commands that Hubot knows about.
myhubot help <query> - Displays all help commands that match <query>.
myhubot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
myhubot map me <query> - Returns a map view of the area returned by `query`.
myhubot mustache me <url|query> - Adds a mustache to the specified URL or query result.
myhubot ping - Reply with pong
myhubot pug bomb N - get N pugs
myhubot pug me - Receive a pug
myhubot the rules - Make sure hubot still knows the rules.
myhubot time - Reply with current time
myhubot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
myhubot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
ship it - Display a motivation squirrel