Pass connection when requiring adaptors
This commit is contained in:
parent
2c34f4c77e
commit
2c6d7ea7c3
|
@ -72,10 +72,10 @@ module.exports = class Robot
|
|||
@requireAdaptor = (adaptorName, connection) =>
|
||||
if @adaptors[adaptorName]?
|
||||
if typeof @adaptors[adaptorName] is 'string'
|
||||
@adaptors[adaptorName] = require(@adaptors[adaptorName]).adaptor(name: adaptorName)
|
||||
@adaptors[adaptorName] = require(@adaptors[adaptorName]).adaptor(name: adaptorName, connection: connection)
|
||||
else
|
||||
require("cylon-#{adaptorName}").register(this)
|
||||
@adaptors[adaptorName] = require("cylon-#{adaptorName}").adaptor(name: adaptorName)
|
||||
@adaptors[adaptorName] = require("cylon-#{adaptorName}").adaptor(name: adaptorName, connection: connection)
|
||||
|
||||
return @adaptors[adaptorName]
|
||||
|
||||
|
|
Loading…
Reference in New Issue