Skip to content

Basic bot flow

moznion edited this page Feb 18, 2017 · 1 revision
  1. User actions something in talk room, or beacon event is fired (it sends the action to the LINE server)
  2. The LINE server sends the event(s) to callback url of your bot server as webhook. The event corresponds to users action
  3. Your bot server receives event(s) and should handle it

When you create a bot, you should do three phases.

  1. Receive webhook
  2. Parse event(s) that is via webhook by \LINE\LINEBot#parseEventRequest(). You must pass the body of webhook and the signature to the method. The signature is included in the X_LINE_SIGNATURE HTTP header
  3. Switch processing depending on the type of event and do your domain

See also