botman / driver-botframework

BotMan Microsoft Bot Framework Driver
MIT License
9 stars 12 forks source link

Error 500 when bot is going to reply in Chat #21

Closed franzbuenaventura closed 3 years ago

franzbuenaventura commented 3 years ago

Hi, I'm having an issue when the bot is trying to reply on my chat. I only have the basic bot setup since I'm still working on the deployment. After I setup Web Bot App, I added the correct credentials and ngrok

I use 'site/botframework' for the endpoint

When I send message, the bot receives it based on the 'php artisan serve' and the ngrok status

When I type 'hi' which the bot should respond with 'hello', I'm getting the following error:

`[2021-01-17 21:44:42] local.ERROR: Undefined property: stdClass::$access_token {"exception":"[object] (ErrorException(code: 0): Undefined property: stdClass::$access_token at C:\Users\azureuser\Desktop\botman\vendor\botman\driver-botframework\src\BotFrameworkDriver.php:135) [stacktrace]

0 C:\Users\azureuser\Desktop\botman\vendor\botman\driver-botframework\src\BotFrameworkDriver.php(135): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined prope...', 'C:\\Users\\azureu...', 135, Array)

1 C:\Users\azureuser\Desktop\botman\vendor\botman\driver-botframework\src\BotFrameworkDriver.php(212): BotMan\Drivers\BotFramework\BotFrameworkDriver->getAccessToken()

2 C:\Users\azureuser\Desktop\botman\vendor\botman\botman\src\BotMan.php(655): BotMan\Drivers\BotFramework\BotFrameworkDriver->sendPayload(Array)

3 [internal function]: BotMan\BotMan\BotMan->BotMan\BotMan\{closure}(Array)

4 C:\Users\azureuser\Desktop\botman\vendor\mpociot\pipeline\src\Pipeline.php(114): call_user_func_array(Object(Closure), Array)`

franzbuenaventura commented 3 years ago

After playing with it more, I just remove the "env" on appid and password on my botframework config file and it works

My file looks like this: `<?php

return [

/*
|--------------------------------------------------------------------------
| App ID
|--------------------------------------------------------------------------
|
| Your Microsoft Bot Framework App ID.
|
*/
'app_id' => 'appid',

/*
|--------------------------------------------------------------------------
| App Key
|--------------------------------------------------------------------------
|
| Your Microsoft Bot Framework App key/secret.
|
*/
'app_key' => 'key',

]; `