Kogno
  • Introduction
  • Getting Started
    • Configuration
    • Starting the Server
    • Messenger Configuration
    • Telegram Configuration
    • WhatsApp Configuration
    • NLP Configuration
  • Conversation Class
  • Contexts
    • Blocks
      • before_anything
      • postback
      • deep_link
      • command
      • any_attachment
      • regular_expression
      • keyword
      • any_number
      • any_text
      • intent
      • entity
      • membership
      • recurring_notification
      • everything_else
      • after_all
    • Sub Contexts
    • Routing
    • Sequences
    • Conversational Forms
  • Replies / Notifications
    • text
    • button
    • quick_reply
    • raw
    • list
    • carousel
    • url
    • typing
    • image
    • video
    • html
    • markdown
    • contact
    • location
    • recurring_notification_request
    • messenger_generic_template
    • whatsapp_template
  • Templates
  • Models
    • User model
  • Scheduled Messages
  • Telegram Inline Query
  • Command Line
  • Global Methods
  • Internationalization
Powered by GitBook
On this page

Was this helpful?

  1. Getting Started

Messenger Configuration

PreviousStarting the ServerNextTelegram Configuration

Last updated 2 years ago

Was this helpful?

Before configuring this section, you must have an App created in Meta and a Facebook Page. See the instructions .

The configuration file for Messenger is located at config/platforms/messenger.rb

Kogno::Application.configure do |config|
  
  config.messenger.graph_url = "https://graph.facebook.com/v2.6/me"

  config.messenger.pages = {
    "YOUR_FANPAGE_ID" => {
      name: "YOUR_FANPAGE_NAME",
      token: "YOUR_ACCESS_TOKEN"
    },
    # "YOUR_2ND_FANPAGE_ID" => {
    #   name: "YOUR_2ND_FANPAGE_NAME",
    #   token: "YOUR_2ND_ACCESS_TOKEN"
    # }
  }

  config.messenger.webhook_route = "/webhook_messenger"
  config.messenger.webhook_verify_token = "<YOUR_VERIFY_TOKEN>"
  
  config.routes.post_comment = :main

  config.routes.recurring_notification = :main

  config.messenger.whitelisted_domains = [
    "kogno.io"
  ]

  config.messenger.persistent_menu =  [
    {
      locale: :default,
      composer_input_disabled: false,
      call_to_actions: [
        {
          title: "Title",
          type: :postback,
          payload: "your_context/a_payload_in_the_context"
        },
        {
          title: "Title2",
          type: :postback,
          payload: "your_payload"
        }
      ]
    }
  ]

  config.messenger.welcome_screen_payload = "GET_STARTED"

  config.messenger.greeting = [
    {
      locale: :default,
      text: "Hello word."
    }
  ]

  config.messenger.ice_breakers = [
    {
      question: "Question 1?",
      payload: "context/payload"
    },
    {
      question: "Question 2",
      payload: "payload_two"
    }
  ]  

end

Field Description

Configuration
Description

config.messenger.graph_url

Facebook Graph Url

config.messenger.pages

One or more Facebook Pages can be configured and run under the same project.

config.messenger.webhook_route

config.messenger.webhook_verify_token

config.routes.post_comment

 config.messenger.persistent_menu

To activate/deactivate it run:

kogno messenger menu on|off

config.messenger.welcome_screen_payload

config.messenger.greeting

config.messenger.whitelisted_domains

After modifying this you should run this command kogno messenger update_whitelisted_domains

config.messenger.ice_breakers

To activate/deactivate it run kogno messenger ice_breakers on|off

The CallBack URL path where the Messenger Platform will send notifications. Read the more about this .

Messenger Platform token for .

Configure the default context which will handle a message from a Post Commend.

allows you to have an always-on user interface element inside Messenger conversations.

The default postback payload for the . To activate/deactivate it run kogno messenger get_started on|off

of your bot's Messenger profile allows you to specify the greeting message people will see on the welcome screen of your bot. To activate/deactivate it run kogno messenger greeting on|off

Messenger .

provide a way for users to start a conversation with a business with a list of frequently asked questions.

here
here
verification request
Read more
The persistent menu
Get Started button
The greeting property
whitelisted domains
Ice Breakers