LINE Bot (Message API) with auto-response message


I try to integrate my official account with bot and auto-response message. I want to use auto-response message to a specific keywords (ex. "Hello" => "Hello, {username}") and some on my bot (ex. "Goodbye" => "Goodbye, {username}")

However, I want to have a default message on my bot (or auto-response message on the other way around) when user type something that doesn't match any keywords (ex. "Hi", "What") and my bot will responsed (ex. "I don't understand")

Here's what the problem.

User: "Hello" //user input Bot: "Hello, {username}" //from auto-response message Bot: "I don't understand" //from bot, cause in my code there's only "Goodbye"

Is there anywat that I can fix this problem? If there is a matched on auto-response message, I want my bot to do nothing Yes, I can include those keywords on my bot too, but I don't want to make a duplicates

Thank you.

  • 0
  • 2
  • 2786
  • twitter facebook

You can do this by building a message interpreter. Sending the message event to script that offers responses based on the content of the message.

  • 0

Owner help

  • 0
本当によろしいですか? question.vm