【问题标题】:Calling one command from another从另一个命令调用一个命令
【发布时间】:2013-08-09 03:42:39
【问题描述】:

我想做某种别名,例如hubot status 应该调用hubot newrelic me 和hubot gauges for today。

我尝试执行 `msg.send "hubot newrelic me" 之类的操作,但似乎 hubot 只是忽略了该消息。

我该怎么做?

【问题讨论】:

    标签: hubot


    【解决方案1】:

    您可以使用事件使脚本彼此对话。

     robot.emit 'event', param
    
     robot.on 'event', (param) ->
       console.log 'received param', param
    

    这里有更多关于它的信息:https://leanpub.com/automation-and-monitoring-with-hubot/read#leanpub-auto-cross-script-communication-with-events

    【讨论】:

      猜你喜欢
      • 2017-02-26
      • 1970-01-01
      • 1970-01-01
      • 2020-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-24
      相关资源
      最近更新 更多