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
  • set_payload(payload=String, params=Hash)
  • Usage
  • html_template(route=String, params=Hash)
  • Usage

Was this helpful?

Global Methods

PreviousCommand LineNextInternationalization

Last updated 2 years ago

Was this helpful?

set_payload(payload=String, params=Hash)

Creates a .

Usage

set_payload "products/show", {product_id: 5, category: "Clothes"}

This payload with its parameters will be received by a postback action block in the products context. Read about .

The payload in Telegram is called and it only supports 64 characters. In Kogno we managed to increase that limit to much more, so you should not worry about that limit anymore.

html_template(route=String, params=Hash)

Render a template with .rhtml extension from the bot/templates/context_name/ directory.

Usage

html_template "main/demo1", { title: "This is the title" }

The template "main/demo1" will be located in bot/templates/main/demo1.rhtml.

<%= title %>
<% 7.times do %>
  <b>Hello</b> <i>World</i>
<% end %>

callback_data
payload with parameters
postback block