Hi,
If anyone is having this error:
(Could not construct ApplicationDefaultCredentials)
Could be solved adding the following (in botman.php)
putenv("GOOGLE_APPLICATION_CREDENTIALS=path_to_json_credential_file");
putenv("GOOGLE_CLOUD_PROJECT=name_proyect");
The rest is as in the guide:
$dialogflow = \BotMan\Middleware\DialogFlow\V2\DialogFlow::create('es');
$botman->middleware->received($dialogflow);
$botman->hears('input.(.*)', function ($bot) {
$extras = $bot->getMessage()->getExtras();
$bot->reply($extras['apiReply']);
})->middleware($dialogflow);
In the previous code 'input.(.*)' is the action prefix used in your dialogsflow's Intent; for example, I have an Intent called scheduleappointment and inside the appointment i have an action called input.scheduleappointment that return date, time and appointment name.
Hi,
If anyone is having this error:
(Could not construct ApplicationDefaultCredentials)
Could be solved adding the following (in botman.php)
The rest is as in the guide:
In the previous code 'input.(.*)' is the action prefix used in your dialogsflow's Intent; for example, I have an Intent called scheduleappointment and inside the appointment i have an action called input.scheduleappointment that return date, time and appointment name.