适配器工厂
https://hubot.github.com/docs/adapters/
自己写适配器
https://hubot.github.com/docs/adapters/development/

 

需要注意的是,scripts/ 下的脚本必须是 .coffee 或者 .js 格式的,而且必须暴露一个接受 robot 参数的函数!
我们还是先打开 scripts/example.coffee 看看吧!

 

// coffee
module.exports = (robot) ->
// js
module.exports = function(robot) {}

 

在这个函数里面,我们可以利用 robot.hearrobot.responserobot.sendrobot.reply 等 api 为不同的「输入」给出不同的「输出」!
我们还可以用 robot.http(url).get() 等方法来发出 http 请求!这样我们的机器人就可以有更强大的交互能力了!

想知道更多 api 的用法的话,可以参考文档:https://hubot.github.com/docs/scripting/

参考资料

https://hubot.github.com/

相关文章:

  • 2021-06-21
  • 2022-01-15
  • 2021-11-04
  • 2021-07-20
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2021-04-21
  • 2021-09-05
  • 2022-01-08
  • 2021-07-09
  • 2021-09-17
  • 2021-11-23
  • 2022-12-23
相关资源
相似解决方案