当我有适配器时,Hubot可以工作,但是当我尝试使用Shell进行本地开发时,没有加载任何脚本或包。
这样做是可行的:
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:我打开了调试级别日志,我可以看到脚本正在被解析,但是当我执行它们的命令时,脚本是不可用的:(** )
清华04月07 00:46:44 GMT+0000 (UTC)调试加载适配器外壳eve> GMT+0000 07 2016 00:46:44 UTC (UTC)从/root/hubot/scripts (UTC)调试加载脚本清华07年4月7日00:46:44 GMT+0000 (UTC)调试解析帮助/root/hubot/ scripts /example.coffee清华清华4月07 00:46:44 GMT+0000 (UTC)调试解析帮助/root/hubot/脚本/prod_部署2016年4月7日:46:44 UTC (UTC)调试解析帮助/root/ hubot/ GMT+0000 /team_ Thu清华咖啡06年4月07 00:46:44 UTC (UTC)调试解析帮助/root/hubot/ GMT+0000 /update0.2016 00:46:44 GMT+0000 (UTC)从/root/hubot/src/脚本加载调试脚本主机/节点_模块/hubot-脚本/src/脚本清华清华06年4月07 00:46:44 GMT+0000 (UTC)调试加载外部程序包清华06年4月07 00:46:45 GMT+0000 (UTC)调试解析帮助清华清华06年4月07日00:46:45 GMT+0000 (UTC)信息hubot- redis :在本地主机上使用默认redis:2016年4月7日清华6379 GMT+0000 (UTC)调试解析帮助清华清华06年4月07 00:46:45 /root/hubot/node_modules/hubot-redis-brain/src/redis-brain.coffee GMT+0000 (UTC)调试解析帮助/root/hubot/node_modules/hubot-help/src/help.coffee清华清华06年4月07 00:46:45 GMT+0000 (UTC)调试解析帮助/root/hubot/node_modules/hubot-help/src/help.coffee清华06年4月07 00:46:45 UTC调试解析帮助/root/hubot/ UTCnode_modules/hubot-cron/src/scripts/cron.coffee
更新2:我意识到我的部分问题是在bin/hubot文件中显式地将我的bot名称作为eve,而我一直在使用我的开发宏名称evedev进行尝试。但是,我仍然想知道为什么help命令没有显示所有可用的命令,但是当我在Slack时,它会显示。
发布于 2016-06-28 14:51:25
作为对您的更新2的回答,您需要在键入help之前将bot的名称放在前面,如下所示:
myhubot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screenvs
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发布于 2016-04-21 06:27:25
您可以在bin/hubot中检查当前的机器人名称。
看起来像exec node_modules/.bin/hubot --name "botname" "$@"
在上面的设置中,bot名称将是botname
https://stackoverflow.com/questions/36464723
复制相似问题