hubotio / hubot

A customizable life embetterment robot.
https://hubotio.github.io/hubot/
MIT License
16.66k stars 3.75k forks source link

robot.messageRoom not working with MS teams #1553

Closed abhatt1250 closed 3 years ago

abhatt1250 commented 3 years ago

Hi, Was trying to integrate hubot with teams and able to run "module.exports = (robot) -> robot.hear /badger/i, (res) -> res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS" "

But when trying to run robot.messageRoom with the below snippet.

"module.exports = (robot) ->

robot.hear /green eggs/i, (res) -> room = "channleid" robot.messageRoom room, "I do not like green eggs and ham. I do not like them sam-I-am.""

It is giving the error

[Mon Mar 08 2021 08:43:31 GMT+0000 (Coordinated Universal Time)] INFO hubot-botframework-adapter: send   | [Mon Mar 08 2021 08:43:31 GMT+0000 (Coordinated Universal Time)] INFO hubot-botframework-adapter: reply   | [Mon Mar 08 2021 08:43:31 GMT+0000 (Coordinated Universal Time)] ERROR TypeError: Cannot read property 'activity' of undefined   | at BotFrameworkAdapter.reply (/opt/app-root/src/node_modules/hubot-botframework/src/adapter.coffee:58:37)   | at BotFrameworkAdapter.send (/opt/app-root/src/node_modules/hubot-botframework/src/adapter.coffee:53:9)   | at Robot.messageRoom (/opt/app-root/src/node_modules/hubot/src/robot.coffee:562:5)   | at TextListener.callback (/opt/app-root/src/scripts/testScript2.coffee:5:11)   | at /opt/app-root/src/node_modules/hubot/src/listener.coffee:65:12   | at allDone (/opt/app-root/src/node_modules/hubot/src/middleware.coffee:44:37)   | at /opt/app-root/src/node_modules/hubot/node_modules/async/lib/async.js:274:13   | at Object.async.eachSeries (/opt/app-root/src/node_modules/hubot/node_modules/async/lib/async.js:142:20)   | at Object.async.reduce (/opt/app-root/src/node_modules/hubot/node_modules/async/lib/async.js:268:15)   | at /opt/app-root/src/node_modules/hubot/src/middleware.coffee:49:13   | at processTicksAndRejections (internal/process/task_queues.js:79:11)   Any help would be appreciated on how to integrate messageRoom function with teams. Thanks.