-1

I created PHP webhook and used https service to call the intent response, but when user says unknow intent name it must give the response sorry.

but I didn't get the response.

My code

if(intent->name="name of intent") {
   echo response
}
else if(intent->name="name of intent") {
   echo response
}
else{
   echo response
}

But I'm not getting into else part

johndoe
  • 4,387
  • 2
  • 25
  • 40
b PRASANTH
  • 37
  • 6

1 Answers1

0

In your code:

if(intent->name="name of intent") {
   echo response
}
else if(intent->name="name of intent") {
   echo response
}
else{
   echo response
}

you are using "=" instead of "==" and hence it never goes to else part.

edited code:

if(intent->name=="name of intent") {
   echo response
}
else if(intent->name=="name of intent") {
   echo response
}
else{
   echo response
}
Ashwin Patti
  • 588
  • 1
  • 3
  • 8