Global Methods

set_payload(payload=String, params=Hash)

Creates a payload with parameters.

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 postback block.

The payload in Telegram is called callback_data 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 %>

Last updated