Skip to content

Commit

Permalink
Merge pull request #1 from neilherbertuk/Bugfix-question-responses
Browse files Browse the repository at this point in the history
Fix issue botman#19, question buttons response in wrong format
  • Loading branch information
neilherbertuk authored Oct 12, 2020
2 parents 9c3fc24 + 055f20b commit 60b4b46
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.DS_Store
composer.lock
.php_cs.cache
/vendor/
/vendor/
.discovery/
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"botman/studio-addons": "~1.0",
"illuminate/contracts": "~5.5.0",
"phpunit/phpunit": "~5.0",
"mockery/mockery": "dev-master",
"mockery/mockery": "~1.3",
"ext-curl": "*"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/BotFrameworkDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function matchesRequest()
public function getConversationAnswer(IncomingMessage $message)
{
if (false !== strpos($message->getText(), '<botman value="')) {
preg_match('/<botman value="(.*)"><\/botman>/', $message->getText(), $matches);
preg_match('/<botman value="(.*)" \/>/', $message->getText(), $matches);

return Answer::create($message->getText())
->setInteractiveReply(true)
Expand Down
2 changes: 1 addition & 1 deletion tests/BotFrameworkDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public function it_interactive_responses_correctly()
],
]);

$text = 'I use botman with Skype<botman value="yes"></botman>';
$text = 'I use botman with Skype<botman value="yes" />';
$message = new IncomingMessage($text, '29:2ZC81QtrQQti_yclfvcaNZnRgNSihIXUc6rgigeq82us', '29:2ZC81QtrQQti_yclfvcaNZnRgNSihIXUc6rgigeq82us');

$answer = $driver->getConversationAnswer($message);
Expand Down

0 comments on commit 60b4b46

Please sign in to comment.