Maybe this is a problem from Hubot. I am Using 0.71.1 of Rocketchat (dockerimage) and Hubot 2.19.0.
I am programming API function, the following Function is working, this simply displays the Verison Informations usw:
robot.respond(/api testfunction1$/i, function(res) {
robot.adapter.callMethod(‘getServerInfo’)
.then(function(result) {
console.log(result)
})
.catch(function(error) {
console.log(error)
})
Running this functions makes a Log entry i Rocketcaht like:
Meteor ➔ method getServerInfo -> …
Calling the following function returns a 404 Error “Method not found”:
robot.respond(/api testfunction2$/i, function(res) {
robot.adapter.callMethod(‘adminRooms’, ‘general’, [ ‘c’, ‘d’, ‘p’ ], 50)
.then(function(result) {
res.reply(“Success”)
console.log(result)
})
.catch(function(error) {
res.reply(“Error”)
console.log(error)
})
})
No LOG Method occures.
If i open “Administration” - “Rooms” in Rocketchat the following LOG Entry occures:
Meteor ➔ publish adminRooms ->
The difference to the first function is the “publish” instead of the “method” in the LOG Entry, how do i have to call the “adminRooms” Method/function in hubot to get a list of all Rooms?