Fixed construction of user input cards for any hubot name
This commit is contained in:
Родитель
056a5b86ed
Коммит
bd00c181f1
|
@ -5,7 +5,7 @@
|
||||||
# Installation
|
# Installation
|
||||||
### Use hubot in Bot Framework Supported Channels
|
### 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 <<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.
|
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
|
# if user input is not needed
|
||||||
maybeConstructUserInputPrompt: (event) ->
|
maybeConstructUserInputPrompt: (event) ->
|
||||||
query = event.value.hubotMessage
|
query = event.value.hubotMessage
|
||||||
# Remove hubot from the beginning of the command if it's there
|
# Remove the robot's name from the beginning of the command if it's there
|
||||||
query = query.replace("hubot ", "")
|
query = query.replace("#{@robot.name} ", "")
|
||||||
|
|
||||||
card = HubotResponseCards.maybeConstructMenuInputCard(query)
|
card = HubotResponseCards.maybeConstructMenuInputCard(query)
|
||||||
if card is null
|
if card is null
|
||||||
|
|
|
@ -1780,6 +1780,7 @@ describe 'MicrosoftTeamsMiddleware', ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
robot = new MockRobot
|
robot = new MockRobot
|
||||||
|
robot.name = 'hubot'
|
||||||
teamsMiddleware = new MicrosoftTeamsMiddleware(robot, appId, appPassword)
|
teamsMiddleware = new MicrosoftTeamsMiddleware(robot, appId, appPassword)
|
||||||
event =
|
event =
|
||||||
value:
|
value:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче