Skip to content

Commit

Permalink
Merge bd00c18 into f345d4c
Browse files Browse the repository at this point in the history
  • Loading branch information
MSMeMend committed Aug 31, 2018
2 parents f345d4c + bd00c18 commit 0d1b7d0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

# Installation
### Use hubot in Bot Framework Supported Channels
1. Install `hubot`. Make sure to `npm install --save hubot-botframework` to add this module.
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](https://dev.botframework.com/bots/new). Store the created app id and app password for use later.

Expand Down Expand Up @@ -54,7 +55,7 @@ Authorization is set up using the `HUBOT_TEAMS_ENABLE_AUTH` and `HUBOT_TEAMS_INI

* `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](https://github.com/jayongg/TeamsHubot) script package to dynamically control authorizations.
- 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](https://github.com/officedev/TeamsHubot) 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.

Expand All @@ -79,7 +80,7 @@ Adding new card-based interactions has two steps:
* 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](https://github.com/jayongg/TeamsHubot) library.
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](https://github.com/officedev/TeamsHubot) library.

# Contributing
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments
4 changes: 2 additions & 2 deletions src/msteams-middleware.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class MicrosoftTeamsMiddleware extends BaseMiddleware
# if user input is not needed
maybeConstructUserInputPrompt: (event) ->
query = event.value.hubotMessage
# Remove hubot from the beginning of the command if it's there
query = query.replace("hubot ", "")
# Remove the robot's name from the beginning of the command if it's there
query = query.replace("#{@robot.name} ", "")

card = HubotResponseCards.maybeConstructMenuInputCard(query)
if card is null
Expand Down
1 change: 1 addition & 0 deletions test/msteams-middleware.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,7 @@ describe 'MicrosoftTeamsMiddleware', ->

beforeEach ->
robot = new MockRobot
robot.name = 'hubot'
teamsMiddleware = new MicrosoftTeamsMiddleware(robot, appId, appPassword)
event =
value:
Expand Down

0 comments on commit 0d1b7d0

Please sign in to comment.