从 github 问题中得到了两个建议https://github.com/github/hubot/issues/647
[更新] 这个问题在源代码中robot.coffee
通过添加修复adapterName
,所以你可以robot.adapterName
从 2.7.2 版本开始检查,查看更改
嗅探,可以使用特殊信息进行检查,adapter
并可能在下面检查我的环境shell
,xmpp
irc
robot.respond /adapter$/i, (msg) ->
#console.log "adapter", robot.adapter
if robot.adapter.client?
if robot.adapter.client.preferredSaslMechanism?
msg.send "this is xmpp adapter"
if robot.adapter.bot?
if robot.adapter.bot.opt?
msg.send "this is irc adapter"
#if robot.adapter.bot?
# msg.send "this is campfire ?"
if robot.adapter.repl?
if robot.adapter.repl.terminal?
msg.send "this is shell adapter"
添加额外的参数,robot.coffee
它需要一个补丁,它在里面的代码见上面的更新
到目前为止我选择嗅探