Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #19, question buttons response in wrong format #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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