Fixed construction of user input cards for any hubot name
This commit is contained in:
Родитель
056a5b86ed
Коммит
bd00c181f1
|
@ -5,7 +5,7 @@
|
|||
# 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 <<relative-path-to-your-hubot>>/node_modules/hubot` to point the local copy of the BotFramework adapter to your hubot.
|
||||
- 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.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1780,6 +1780,7 @@ describe 'MicrosoftTeamsMiddleware', ->
|
|||
|
||||
beforeEach ->
|
||||
robot = new MockRobot
|
||||
robot.name = 'hubot'
|
||||
teamsMiddleware = new MicrosoftTeamsMiddleware(robot, appId, appPassword)
|
||||
event =
|
||||
value:
|
||||
|
|
Загрузка…
Ссылка в новой задаче