Install hubot
. Make sure to npm install --save hubot-botframework
to add this module.
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.Create a Botframework Registration by completing the Bot Registration Page. Store the created app id and app password for use later.
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.
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.
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
).
You can configure the Hubot BotFramework adapter through environment variables.
Required (obtained from the BotFramework portal):
BOTBUILDER_APP_ID
- This is the Id of your bot.BOTBUILDER_APP_PASSWORD
- This is the secret for your bot.Optional:
BOTBUILDER_ENDPOINT
- Sets a custom HTTP endpoint for your bot to receive messages on (default is /api/messages
).
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.
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.
These variables will only take effect if a user communicates with your hubot through Microsoft Teams.
Optional:
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.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.
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.
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.
Adding new card-based interactions has two steps:
Add entries to HubotResponseCards located in src/hubot-response-cards.coffee
. Each entry is from a regex to an array of follow up commands.
hubot-github
entries for examples.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.
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.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments