Giter Club home page Giter Club logo

botframework-hubot's Introduction

Botframework adapter for Hubot

npm version Build Status Coverage Status

Installation

Use hubot in Bot Framework Supported Channels

  1. Install hubot. Make sure to npm install --save hubot-botframework to add this module.

    • Authorization and Card-based interactions are in alpha testing and are not part of the published npm package, so to use these features, clone or download this repository and install it as a local dependency of your hubot. Then after running npm install for your hubot, in the local copy of the BotFramework adapter, run npm install --production then run npm install --save <<relative-path-to-your-hubot>>/node_modules/hubot to point the local copy of the BotFramework adapter to your hubot.
  2. Create a Botframework Registration by completing the Bot Registration Page. Store the created app id and app password for use later.

  3. Configure the required environment variables, and run the command ./bin/hubot -a botframework to run the bot from your local computer.

You can then interact with your hubot through any Bot Framework supported channel.

Additional Steps to Use Hubot in Microsoft Teams

  1. Create a Microsoft Teams app package (.zip) to upload in Teams. We recommend using the manifest editor in App Studio for Microsoft Teams. Include the bot's app id and password in the bots section.

  2. In Microsoft Teams, navigate to the Store and select Upload a custom app. Select the zipped Teams App Package, and install the bot for personal and/or team use.

You can then interact with hubot through a personal chat or by @mentioning the name of the uploaded custom app in a Team. In personal chats, the bot's name can be dropped from messages(ping or hubot ping). In Teams, @mention the bot and omit the bot's name from the command (@myhubot ping).

Common Differences in Hubot running in Slack, Hipchat, other chat platforms and MS Teams

  1. Microsoft Teams uses a push model to send messages. This means that hubots that want to communicate in Teams MUST expose themselves via a public HTTPS endpoint that Microsoft Teams services can push messages to.
  2. The bot MUST be @ mentioned in a channel to receive a message. Microsoft Teams does NOT send all messages to the bot.

Global Variables

You can configure the Hubot BotFramework adapter through environment variables.

Required (obtained from the BotFramework portal):

  1. BOTBUILDER_APP_ID - This is the Id of your bot.
  2. BOTBUILDER_APP_PASSWORD - This is the secret for your bot.

Optional:

  1. BOTBUILDER_ENDPOINT - Sets a custom HTTP endpoint for your bot to receive messages on (default is /api/messages).

  2. HUBOT_TEAMS_ENABLE_AUTH - When set to true, restricts sending commands to hubot to a specific set of users in Teams. Messages from all non-Teams channels are blocked. Authorization is disabled by default.

  3. HUBOT_TEAMS_INITIAL_ADMINS - Required if HUBOT_TEAMS_ENABLE_AUTH is true. A comma-separated list of user principal names (UPNs). The users on this list will be admins and able to send commands to hubot when the hubot is first run with authorization enabled.

Channel Specific Variables

These variables will only take effect if a user communicates with your hubot through Microsoft Teams.

Optional:

  1. HUBOT_OFFICE365_TENANT_FILTER - Comma seperated list of Office365 tenant Ids that are allowed to communicate with your hubot. By default ALL Office365 tenants can communicate with your hubot if they sideload your application manifest.

Optional Authorization for Microsoft Teams:

NOTE: The UPNs used for authorization are stored in the hubot brain, so brain persistence affects the use of HUBOT_TEAMS_INITIAL_ADMINS as described below.

Authorization restricts the users that can send commands to hubot to a defined set of Microsoft Teams users. Authorization is currently only supported for the Teams channel, so when enabled, messages from all other channels are blocked. To maximize back compatibility, authorization is disabled by default and must be enabled to be used.

Configuring authorization

Authorization is set up using the HUBOT_TEAMS_ENABLE_AUTH and HUBOT_TEAMS_INITIAL_ADMINS environment variables.

  • HUBOT_TEAMS_ENABLE_AUTH controls whether authorization is enabled or not. If the variable is not set, authorization is disabled. To enable authorization, set the environment variable to true.

  • HUBOT_TEAMS_INITIAL_ADMINS is required if authorization is enabled. This variable contains a comma-separated list of UPNs. When the hubot is run with authorization enabled for the first time, the users whose UPNs are listed will be admins and authorized to send commands to hubot. These UPNs are stored in the hubot brain. After running hubot with authorization enabled for the first time:

    • If your hubot brain is persistent, to change the list of authorized users, first delete the stored list of authorized users from your hubot's brain then change HUBOT_TEAMS_INITIAL_ADMINS to the new list. Also consider using the hubot-msteams script package to dynamically control authorizations.

    • If your hubot brain isn't persistent, the HUBOT_TEAMS_INITIAL_ADMINS list will be used to set admins every time hubot is restarted.

Card-based Interactions for Microsoft Teams

Add screenshots (create an images folder to store them in)

Hubot is great, but hubot without needing to type in whole commands and with less typos is even better. Card-based interactions wrap hubot responses into cards and provide buttons on the card containing useful follow-up commands. To run a follow-up command, simply click the button with the command. If user input is needed, another card is shown with fields for input, and the rest of the command is constructed for you.

Currently, card based interactions are supported for the hubot-github package.

Defining new card-based interactions

Adding new card-based interactions has two steps:

  1. Add entries to HubotResponseCards located in src/hubot-response-cards.coffee. Each entry is from a regex to an array of follow up commands.

    • The regex should map to the command that you want to generate a card for with wildcards for the hubot's name and regexes for each user input. See the hubot-github entries for examples.
    • The follow up queries should match the key for the follow up command in HubotQueryParts.
  2. Add entries to HubotQueryParts located in src/hubot-query-parts.coffee. Each entry is from the command to two arrays containing the text and input parts of a command. These arrays are used to construct the query with any user inputs to send to hubot.

    • textParts contains the text surrounding any user inputs, if a command has no user input, it contains one string in textParts. Note that the first entry of textParts starts with 'hubot'
    • inputParts contains representations of each user input in a command, if any. The text is used to prompt the user for input. A special syntax can used for inputs with finite choices to create a dropdown selector. In this case, a / is used followed by the choices separated by the word " or ". See the hubot-github entries for examples.

Once these entries have been added, cards with follow up commands will be generated for the commands added to HubotResponseCards. For menu cards used to initiate card-based interactions for any command in a script library, use the hubot-msteams library.

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments

botframework-hubot's People

Contributors

billbliss avatar maxpert avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar msmemend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botframework-hubot's Issues

Confused on how this works with Teams

I am running hubot with the application loaded. I did get an AppID from Microsoft as instructed. What I am not sure I understand is, does this plugin connect to teams and simulate a client or must I make hubot with the plugin publicly available and provide Teams the URL for access to hubot?

Hubot says it's replying but the message doesn't arrive

Is this being maintained at all? My org has moved from Slack, where we used hubot daily for automations, to Teams, where we're trying to get hubot set up to do the same thing. We could use some help.

I just set up hubot with this adapter, went through the bot registration, created an app and added it to Teams, and most everything appears to be working--but Teams will not receive replies from hubot. With some debugging I can see the json payload that hubot is trying to send out, and I can see the ChatConnector trying to send a message, but it doesn't arrive.

ChatConnector: message received.
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: onBotEvents
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-middleware: creating middleware...
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-msteams: toReceivable
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Message 'yoda hi' matched regex //(\w+)\s(\w+)/i/; listener.options = { id: null }
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Executing listener callback for Message 'yoda hi'
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Message 'yoda hi' matched regex //^\s*[@]?yoda[:,]?\s*(?:hi|hey|sup|howdy|aloha|greetings|hello)/i/; listener.options = { id: null }
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] DEBUG Executing listener callback for Message 'yoda hi'
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-adapter: reply
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-botframework-middleware: creating middleware...
[Thu Feb 17 2022 11:37:58 GMT-0700 (Mountain Standard Time)] INFO hubot-msteams: toSendable
ChatConnector: sending message.

Capture

What can we do?

/api/messages return 404 and HPE_INVALID_METHOD

I am trying to integrate BotFramework-Hubot with StackStorm 3.2.0.

I always get Cannot GET /api/messages from /api/messages.

curl http://localhost:8081/api/messages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/messages</pre>
</body>
</html>

Then I added export NODE_DEBUG='*', export DEBUG='*' before start hubot via bin/hubot -a botframework , then I found these error messages

STREAM 9762: do read
NET 9762: _read
NET 9762: Socket._read readStart
HTTP 9762: SERVER new http connection
TIMER 9762: no 863 list was found in insert, creating a new one
STREAM 9762: resume
STREAM 9762: resume true
STREAM 9762: flow true
STREAM 9762: read undefined
STREAM 9762: need readable true
STREAM 9762: length less than watermark true
STREAM 9762: reading or ended false
HTTP 9762: SERVER socketOnParserExecute NaN
HTTP 9762: parse error { [Error: Parse Error

]
  bytesParsed: 0,
  code: 'HPE_INVALID_METHOD',
  rawPacket:
   <Buffer 16 03 01 02 00 01 00 01 fc 03 03 b1 36 da a8 68 6d df 11 37 43 46 e4 a7 ea 2e da c5 6d d5 ba 62 d3 de de 07 ab 7a 0a da c0 3e f9 20 19 f2 fd 16 bd 21 ... > }
NET 9762: destroy
NET 9762: close
NET 9762: close handle
NET 9762: has server
NET 9762: SERVER _emitCloseIfDrained
NET 9762: SERVER handle? true   connections? 0
NET 9762: emit close
HTTP 9762: server socket close
TIMER 9762: timeout callback 5000

and also

STREAM 9762: length less than watermark true
STREAM 9762: reading or ended false
Tue, 14 Jul 2020 07:42:56 GMT express:router dispatching GET /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router query  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router expressInit  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router <anonymous>  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router query  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT express:router jsonParser  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT body-parser:json skip empty body
Tue, 14 Jul 2020 07:42:56 GMT express:router urlencodedParser  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT body-parser:urlencoded skip empty body
Tue, 14 Jul 2020 07:42:56 GMT express:router multipart  : /api/messages
Tue, 14 Jul 2020 07:42:56 GMT finalhandler default 404
STREAM 9762: resume
STREAM 9762: readableAddChunk null

Refactor the middleware send() function to not break the middleware abstraction

Middleware is meant to act as an in between converter between Bot Framework and hubot entities. PR #29 adds a middleware.send() method in order to be able to handle aggregating multiple hubot responses into one Bot Framework response, but this should be changed to move sending to Bot Framework into the main adapter to maintain proper middleware abstraction.

hubot doesn't give me any reaction after I run ./bin/hubot -a botframework

I want to use this adapter to create a hubot that can connect our mirosoft teams.
First, I generated a bot by this link: https://dev.botframework.com/bots/new, and set BOTBUILDER_APP_ID and BOTBUILDER_APP_PASSWORD with the value I get when I create the new bot. then I run ./bin/hubot -a botframework:

[ec2-user@ip-172-31-11-119 microsoft]$ ./bin/hubot -a botframework
npm WARN [email protected] requires a peer of coffee-script@^1.12.6 but none was installed.

up to date in 1.497s
[Wed May 23 2018 09:05:46 GMT+0000 (UTC)] INFO hubot-botframework-adapter: Adapter loaded. Using appId 349c9cc8-3593-447d-8b97-a1367560cf4d
[Wed May 23 2018 09:05:46 GMT+0000 (UTC)] INFO hubot-botframework-adapter: Adapter running.
[Wed May 23 2018 09:05:47 GMT+0000 (UTC)] WARNING Loading scripts from hubot-scripts.json is deprecated and will be removed in 3.0 (github/hubot-scripts#1113) in favor of packages for each script.

Your hubot-scripts.json is empty, so you just need to remove it.
[Wed May 23 2018 09:05:47 GMT+0000 (UTC)] INFO hubot-redis-brain: Using default redis on localhost:6379

It stopped here.

Another question, when can not chat with my bot in microsoft teams, It tell me: sending new message to this bot has been disabled by your administrator. Any suggestion on this?

Support Skype

Should this provide support for Skype ?

I've created this repo I'm using for internal bots inspired on the MSTeamsMiddleware.
Any chance we could extract the relevant logic of the MSTeamsMiddleware so it can be shared for Skype and MS Teams?

Thanks,
Leo.

Does robot.hear work?

I wonder if "hearing" = listening to a conversation without being explicitly @mentioned is supposed to work in Microsoft Teams.

Example:

module.exports = (robot) ->
  robot.hear /badger/i, (res) ->
    res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS"

The same question goes for robot.messageRoom, example:

module.exports = (robot) ->

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

So, if I just mention the word "badger" in any conversation inside a channel, I would expect hubot to respond with Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS.

Does a Channel translate to a Room? I couldn't make it work so far, so I wonder if I just can give up trying. Thanks you!

Handling for undefined value of sourceEvent for message payload received from Skype for Business

As the message payload format received from Skype for business is missing "sourceEvent", type error occurred to the middleware when reading property 'clientActivityId' in TextMiddleware.toReceivable function.

Attached the logs as below.

2017-09-12T16:41:04.255185294Z [Tue Sep 12 2017 16:41:04 GMT+0000 (UTC)] INFO hubot-botframework-adapter: onBotEvents
2017-09-12T16:41:04.255237694Z [Tue Sep 12 2017 16:41:04 GMT+0000 (UTC)] INFO hubot-botframework-adapter: Handling activity Channel: skypeforbusiness; type: message
2017-09-12T16:41:04.255245394Z [Tue Sep 12 2017 16:41:04 GMT+0000 (UTC)] INFO hubot-botframework-middleware: creating middleware...
2017-09-12T16:41:04.255252294Z [Tue Sep 12 2017 16:41:04 GMT+0000 (UTC)] INFO hubot-botframework-middleware: TextMiddleware toReceivable
2017-09-12T16:41:04.257131076Z TypeError: Cannot read property 'clientActivityId' of undefined
2017-09-12T16:41:04.257190876Z     at TextMiddleware.toReceivable (/var/www/chatbot-core/node_modules/hubot-botframework/src/middlewares.coffee:56:77)
2017-09-12T16:41:04.257201576Z     at BotFrameworkAdapter.handleActivity (/var/www/chatbot-core/node_modules/hubot-botframework/src/adapter.coffee:70:41)
2017-09-12T16:41:04.257208576Z     at BotFrameworkAdapter.onBotEvents (/var/www/chatbot-core/node_modules/hubot-botframework/src/adapter.coffee:66:10)
2017-09-12T16:41:04.257215076Z     at ChatConnector.onEventHandler (/var/www/chatbot-core/node_modules/hubot-botframework/src/adapter.coffee:57:45)
2017-09-12T16:41:04.257221276Z     at ChatConnector.onDispatchEvents (/var/www/chatbot-core/node_modules/botbuilder/lib/bots/ChatConnector.js:426:22)
2017-09-12T16:41:04.257276975Z     at ChatConnector.dispatch (/var/www/chatbot-core/node_modules/botbuilder/lib/bots/ChatConnector.js:435:18)
2017-09-12T16:41:04.257286375Z     at /var/www/chatbot-core/node_modules/botbuilder/lib/bots/ChatConnector.js:141:27
2017-09-12T16:41:04.257292575Z     at OpenIdMetadata.getKey (/var/www/chatbot-core/node_modules/botbuilder/lib/bots/OpenIdMetadata.js:26:13)
2017-09-12T16:41:04.257298975Z     at ChatConnector.verifyBotFramework (/var/www/chatbot-core/node_modules/botbuilder/lib/bots/ChatConnector.js:116:28)
2017-09-12T16:41:04.257305275Z     at /var/www/chatbot-core/node_modules/botbuilder/lib/bots/ChatConnector.js:44:23
2017-09-12T16:41:04.257311775Z     at callbacks (/var/www/chatbot-core/node_modules/hubot/node_modules/express/lib/router/index.js:164:37)
2017-09-12T16:41:04.257317975Z     at param (/var/www/chatbot-core/node_modules/hubot/node_modules/express/lib/router/index.js:138:11)
2017-09-12T16:41:04.257324275Z     at pass (/var/www/chatbot-core/node_modules/hubot/node_modules/express/lib/router/index.js:145:5)
2017-09-12T16:41:04.257330575Z     at Router._dispatch (/var/www/chatbot-core/node_modules/hubot/node_modules/express/lib/router/index.js:173:5)
2017-09-12T16:41:04.257365774Z     at Object.router (/var/www/chatbot-core/node_modules/hubot/node_modules/express/lib/router/index.js:33:10)
2017-09-12T16:41:04.257373174Z     at next (/var/www/chatbot-core/node_modules/connect/lib/proto.js:174:15)
2017-09-12T16:41:04.257379174Z     at Object.multipart [as handle] (/var/www/chatbot-core/node_modules/connect-multiparty/index.js:42:27)
2017-09-12T16:41:04.257385774Z     at next (/var/www/chatbot-core/node_modules/connect/lib/proto.js:174:15)
2017-09-12T16:41:04.257394674Z     at Object.urlencodedParser [as handle] (/var/www/chatbot-core/node_modules/body-parser/lib/types/urlencoded.js:81:44)
2017-09-12T16:41:04.257401074Z     at next (/var/www/chatbot-core/node_modules/connect/lib/proto.js:174:15)
2017-09-12T16:41:04.257407074Z     at /var/www/chatbot-core/node_modules/body-parser/lib/read.js:121:5
2017-09-12T16:41:04.257413274Z     at invokeCallback (/var/www/chatbot-core/node_modules/raw-body/index.js:262:16)
2017-09-12T16:41:04.257447374Z     at done (/var/www/chatbot-core/node_modules/raw-body/index.js:251:7)
2017-09-12T16:41:04.257456473Z     at IncomingMessage.onEnd (/var/www/chatbot-core/node_modules/raw-body/index.js:307:7)
2017-09-12T16:41:04.257462573Z     at emitNone (events.js:86:13)
2017-09-12T16:41:04.257468473Z     at IncomingMessage.emit (events.js:185:7)
2017-09-12T16:41:04.257474273Z     at endReadableNT (_stream_readable.js:974:12)
2017-09-12T16:41:04.257480173Z     at _combinedTickCallback (internal/process/next_tick.js:80:11)
2017-09-12T16:41:04.257486073Z     at process._tickCallback (internal/process/next_tick.js:104:9)

Noob issue with getting botframework back to hubot

I apologize to all the extreamly smart people here on this project for such a rudimentary question but i've spend the past day and a half working on this... I'm attempting to connect my hubot sever to our ms-teams server. I am getting hung up on getting my chats back to hubot.

Currently when I use the test button on dev.botframework.com I do see a chat message coming up on teams as my incoming webhook. Now the issue is creating a custom bot its asking for a Callback URL, from what I understand is this gets my chats back to the framework. From what ive been able to find it should be #botname.azurewebsites.net/api/messages. However for my bot scentsy_chronos this returns a page not found. Am I missing a set to get my bot its own url?

When starting hubot on my windows server I do get:

[Sat Aug 05 2017 23:08:17 GMT-0700 (Pacific Daylight Time)] INFO hubot-botframew
ork-adapter: Adapter loaded. Using appId 072de5c6-80a4-489a-8377-7e3afccd7385
[Sat Aug 05 2017 23:08:17 GMT-0700 (Pacific Daylight Time)] INFO hubot-botframew
ork-adapter: Adapter running.
[Sat Aug 05 2017 23:08:19 GMT-0700 (Pacific Daylight Time)] INFO hubot-redis-bra
in: Discovered redis from REDIS_URL environment variable
[Sat Aug 05 2017 23:08:19 GMT-0700 (Pacific Daylight Time)] INFO hubot-redis-bra
in: Data for export%20REDIS_URL=redis:/:######@10.1.10.12:16379/prefix brain r
etrieved from Redis

So I would believe its making the connection into the framework to get the messages but getting them there is the issue... Any help would be greatly appreciated.

Thanks
Cody

Hubot-auth

Hi all,
Can we use the hubot-auth with botframework ?

As per the auth documentation i should be able to retrieve my MSTeam user id with the command show users but in my case nothing is displayed. That's why i am wondering if the integration works.

Is it still working with MS Teams?

I'm wondering if this approach is still working with MS Teams. Because trying to follow the documentation and when going to https://dev.botframework.com/bots/new and trying to create new bot, when submiting the form it always fails like this:

  • first time the form is submited there is an unclear popup displaying someting like "CorrelationID: XYZ"
  • if retrying it indicates that the MsaAppId is already being used

Botbuilder dependency

In package.json botbuilder dependency is defined as
"botbuilder": ">=3.5.0"

Since botbuilder moved from version 3.15.0 to 4.0.6 the framework is downloading the latest and greates. Unfortunately Hubot is throwing an error on startup:
[Thu Oct 04 2018 05:22:21 GMT+0000 (UTC)] ERROR Cannot load adapter botframework - TypeError: BotBuilder.ChatConnector is not a constructor

rolling back to 3.5.0 fix the issues.

Hubot in channel

I am able to add hubot to a conversation in MS teams and interact with it. However when I try to add it as a member in a channel, it will not let me.
Has this happened to anyone else?

integrate hubot with Microsoft teams

Hi ,
when i am integrating hubot with Microsoft teams in Azure Portal and when testing it in web chat it's giving me error like this:- Activity dropped because the bot's endpoint is missing.
could you please help me to resolve this issue.
Thanks.

Authentication

Hi,
I am trying to use the embeded authentication mechanism but it seems that the "loadAuthorizedUsers" event is not triggered. Indeed i am able to retrive the admin list coming from the env var in test hubot command but for the authentication mechanism there is no admins. can someone confirm that this feature works as expected ?

Document Pls

@maxpert

Hi,

Could you please provide the document where the integration is explained.

Tried connecting the adapter to https://botname.azurewebsites.net/api/messages. Getting status as adapter started, but no activities are received when a test chat is initialized at dev.botframework.com

Should there be any other configuration done?

Regards,
Ram

No listeners executed; falling back to catch-all

Hi,
I am trying to test the adapter out of box. I registered my bot on dev.botframework and sideloaded it through teams.
I run hubot with adapter:
$ ./bin/hubot -a BotFramework --alias !
When I go into a channel and type:
@Rosie badger,
I expect a response from example.coffee:

robot.hear /badger/i, (res) ->
    res.send "Badgers? BADGERS? WE DON'T NEED NO STINKIN BADGERS"

Snippet of just running through shell without adapter ./bin/hubot:

rosie2> rosie2 badger

rosie2 badger

rosie2> [Mon Sep 18 2017 14:48:08 GMT-0400 (Eastern Daylight Time)] DEBUG Message 'rosie2 badger' matched regex //badger/i/; listener.options = { id: null }

[Mon Sep 18 2017 14:48:08 GMT-0400 (Eastern Daylight Time)] DEBUG Executing listener callback for Message 'rosie2 badger'

Badgers?  BADGERS? WE DON'T NEED NO STINKIN BADGERS

However, using MSTeams adapter, I always get no listeners executed, falling back to catch all:

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: onBotEvents

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: Handling activity Channel: msteams; type: message

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-middleware: creating middleware...

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] INFO hubot-msteams: toReceivable

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] INFO hubot-botframework-adapter: 
{
	"user": {
		"id": "2xxA",
		"name": "Will W",
		"tenant": "efc88xxxx3f835af",
		"activity": {
			"text": "rosie2  badger",
			"textFormat": "plain",
			"attachments": [
				{
					"contentType": "text/html",
					"content": "<div><span itemscope=\"\" itemtype=\"http://schema.skype.com/Mention\" itemid=\"0\">Rosie</span>&nbsp;badger</div>"
				}
			],
			"type": "message",
			"timestamp": "2017-09-18T18:28:36.619Z",
			"localTimestamp": "2017-09-18T14:28:36.619-04:00",
			"entities": [
				{
					"mentioned": {
						"id": "28:7db26xxxxxxx7ef3e9",
						"name": "Rosie"
					},
					"text": "<at>Rosie</at>",
					"type": "mention"
				},
				{
					"locale": "en-US",
					"country": "US",
					"platform": "Windows",
					"type": "clientInfo"
				}
			],
			"sourceEvent": {
				"teamsChannelId": "19:[email protected]",
				"teamsTeamId": "19:[email protected]",
				"channel": {
					"id": "19:[email protected]"
				},
				"team": {
					"id": "19:[email protected]"
				},
				"tenant": {
					"id": "efc8xxxxxxca3f835af"
				}
			},
			"address": {
				"id": "150xxxxx6511",
				"channelId": "msteams",
				"user": {
					"id": "29:1F9J5Oxxxxxxxxxxxxxxxxe476TUrYl9vgA",
					"name": "Will"
				},
				"conversation": {
					"isGroup": true,
					"id": "19:[email protected];messageid=150xxxx6511"
				},
				"bot": {
					"id": "28:7db26cxxxxxxxxxxxxef3e9",
					"name": " rosie2"
				},
				"serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/"
			},
			"source": "msteams"
		},
		"room": "19:[email protected];messageid=1505xxxxxx6511"
	},
	"text": "rosie2  badger",
	"id": "150xxxx16511",
	"done": false,
	"room": "19:[email protected];messageid=1505xxxxxxx11"
}

[Mon Sep 18 2017 14:28:49 GMT-0400 (Eastern Daylight Time)] DEBUG No listeners executed; falling back to catch-all

Does it have to do with the text field having two spaces between 'rosie2' and 'badger'
"text": "rosie2  badger"
The mention is to Rosie, but the text has rosie2 badger.

How to use this adapter?

Please tell me how to use this adapter.

HUBOT → Azure Bot service [Bot channel registration] → Microsoft team

I think that I can connect it and use it.

Is there a way to use it?

Remove limitation that requires @ mention for a bot to receive a channel message

I am aware of #28 (comment) but it is really a deal breaker for using Teams. I've been asked to move our department from Slack to Teams, but I cannot transition to a service that doesn't "work". I can't imagine why a bot would be limited in this way. It's almost like an "output only" thing that you've made ...but with the ability to sometimes interact with it. It's really confusing as to how this is a good idea for anyone.

Hubot On Kik Through Microsoft

Hubot is not responding in Kik with hubot-epichal module. The logs show that the bot is learning "Hello" and various phrases and words but it never replies. Script responses work perfectly. Hubot will respond to messages from various chats but it never seems to listen to any chat on Kik that it's been invited too. It is not actually listening except for its private chat with me. Announce.coffee will not message assigned chats on Kik. Pubsub, rss poller and any scripts that use a room number or subscription fail on Kik. Finally, the bot only posts urls of images and not the image on Kik.

New Version Requested

Hi,

I saw there were quite a good amount of work put in after the latest version 0.10.1 since 2017.
Just wondering if there is a plan to release a newer version?

Thank you,
Li

I find an error when i try to run a command line for setting skype for bussiness

Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))

New-CsOnlineApplicationEndpoint -ApplicationId 4a4b1429-64d7-417b-8d74-9541c3e3da1e -Name niobot sip:[email protected]

Enterprise voice directory service failed.

+ CategoryInfo          : NotSpecified: (Microsoft.Rtc.M...Directory service discovery failed. Please try again later. :PlatformServiceCmdletException) [New-CsOnlineApplicationEndpoint], BvdCmdletException

+ FullyQualifiedErrorId : Could not instantiate TrustedApplicationEndpointManager,Microsoft.Rtc.Management.Hosted.PlatformService.NewPlatformServiceAppEndpointConfigCmdlet

+ PSComputerName        : admin0g.online.partner.lync.cn

Hubot does not respond to Azure

Hi,

I'm attempting to setup a connection between Azure -> EC2 -> botframework-hubot. I've managed to get a response(error 401) from hubot when sending via POSTMAN.

After setting up, the appId and appPassword in botframework, I tried to send a message to hubot via Azure but there's not response.

Any help/advice is greatly appreciated.

Hubot reply in MS teams is not displaying Line Breaks

I have installed Hubot and added to MS Teams but the reply I am getting from Hubot is being displayed as a paragraph instead of Multiple Lines. I have tried installing with npm package "hubot-botframework" and also using the Git Repository.

Can you please let me know how I can fix this issue?

let robot upload file have error

i read this doc:
https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-files

i want try make robot upload file,i did what the doc write ,i first send a upload QA card
card json :{ "attachments": [{ "contentType": "application/vnd.microsoft.teams.card.file.consent", "name": "file_example.txt", "content": { "description": "<Purpose of the file, such as: this is your monthly expense report>", "sizeInBytes": 1029393, "acceptContext": { }, "declineContext": { } } }] }

and it work ,robot send the card to us chat,then if i click accept or don't accpet ,then in robot service i saw some error log :
**
[Thu Oct 17 2019 09:30:31 GMT+0800 (GMT+08:00)] DEBUG No listeners executed; falling back to catch-all
express:router dispatching POST /api/messages +7s
express:router query : /api/messages +0ms
express:router expressInit : /api/messages +0ms
express:router : /api/messages +0ms
express:router query : /api/messages +0ms
express:router jsonParser : /api/messages +0ms
body-parser:json content-type "application/json; charset=utf-8" +0ms
body-parser:json content-encoding "identity" +0ms
body-parser:json read body +0ms
body-parser:json parse body +1ms
body-parser:json parse json +0ms
express:router urlencodedParser : /api/messages +0ms
body-parser:urlencoded body already parsed +0ms
express:router multipart : /api/messages +0ms

ChatConnector: message received.
TypeError: this.onInvokeHandler is not a function
at ChatConnector.onDispatchEvents (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:545:22)
at ChatConnector.dispatch (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:557:18)
at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:150:27
at OpenIdMetadata.getKey (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/OpenIdMetadata.js:26:13)
at ChatConnector.verifyBotFramework (/home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:124:28)
at /home/chatbot/hubot/node_modules/botbuilder/lib/bots/ChatConnector.js:46:23
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at next (/home/chatbot/hubot/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/chatbot/hubot/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at multipart (/home/chatbot/hubot/node_modules/connect-multiparty/index.js:49:27)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at urlencodedParser (/home/chatbot/hubot/node_modules/body-parser/lib/types/urlencoded.js:82:7)
at Layer.handle [as handle_request] (/home/chatbot/hubot/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/home/chatbot/hubot/node_modules/express/lib/router/index.js:317:13)
at /home/chatbot/hubot/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/home/chatbot/hubot/node_modules/express/lib/router/index.js:335:12)
at next (/home/chatbot/hubot/node_modules/express/lib/router/index.js:275:10)
at /home/chatbot/hubot/node_modules/body-parser/lib/read.js:130:5
at invokeCallback (/home/chatbot/hubot/node_modules/raw-body/index.js:224:16)
at done (/home/chatbot/hubot/node_modules/raw-body/index.js:213:7)
at IncomingMessage.onEnd (/home/chatbot/hubot/node_modules/raw-body/index.js:273:7)
at IncomingMessage.emit (events.js:203:15)
at endReadableNT (_stream_readable.js:1145:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
**
but i still can get the action ,i mean appet upload file or don't accpet actions ,so i want know what problem with the error and how to fix it ? ,the error give me feel like the botbuilder don't have correspond code for upload file actions.

Hubot not able to respond

My hubot is registered with bot services and I can correctly send a message to it and get a response:

[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-adapter: onBotEvents
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-adapter: Handling activity Channel:                            webchat; type: message
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-middleware: creating middleware...
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-middleware: TextMiddleware toReceivable
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] DEBUG Message 'orly' matched regex //orly/i/; listener.options = { id: null }
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] DEBUG Executing listener callback for Message 'orly'
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-adapter: send
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-adapter: reply
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-middleware: creating middleware...
[Thu Nov 08 2018 18:04:28 GMT+0000 (UTC)] INFO hubot-botframework-middleware: TextMiddleware toSendable

But after I add it to the Team and channel and send a message to the bot it tries to respond but no response is getting back to me:

[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-adapter: onBotEvents
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-adapter: Handling activity Channel:                            msteams; type: message
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-middleware: creating middleware...
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-msteams: toReceivable
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] DEBUG Message 'Sparky orly' matched regex //orly/i/; listener.options = { id: null }
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] DEBUG Executing listener callback for Message 'Sparky orly'
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-adapter: send
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-adapter: reply
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-botframework-middleware: creating middleware...
[Thu Nov 08 2018 18:05:48 GMT+0000 (UTC)] INFO hubot-msteams: toSendable

I had this working yesterday, then I changed the name of my hubot and it would never work again. I changed the name back but it still doesnt work. I tried making a new app in app studio and removing the old app and changing the id of the app and the version of the app. I don't have permissions to create a new bot so I couldnt try that. I don't know where to look to find what the error is, the channel page has no error for MS Teams except when I uninstall the app when it says I don't have permissions to do something. Can anyone help point me to what I can look at to troubleshoot this issue, its really hard to know what the issue is when I don't get an error anywhere. Thanks a lot!

Can you please provide a sample

Hi,
I am completly noob in bot and i am struggling to make it works. Can you please add a basic sample in your documentation.

My understanding is that we just need to create a hubot script as documented by hubot containing an endpoint (/api/messages) which will handle the communication with botframework. Thus if i create a bot with the following code :

robot.router.post('/api/messages', function(req,resp){ data = req.body resp.send(data) }

it should work. however in using the test feature in dev.botframework.com i can't send any messages to my bot.

Any help will be great.

++

Is this being actively maintained?

Hi -- is this repository being actively maintained? I'd love to submit a bug report for a longstanding issue we're seeing with token refreshes failing (or a PR with a fix) but I'll hold off until I get confirmation that it's gonna have eyes and minds on it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.