command

Catches a Telegram command, which has been specified as an argument.

circle-info

Read more about Telegram commands in the official documentationarrow-up-right.

command(name=String|Symbol, &block)

Platforms

Platform
Supported

Messenger

WhatsApp

Telegram

Usage

class MainContext < Conversation

  def blocks
    
    command :start do
      @reply.text "Hello and welcome!"
    end
    
end

Configuration

In order to be implemented in Kogno, the commands must be created first in Telegram through the BotFatherarrow-up-right or well, by defining them in the configuration file config/platforms/telegram.rb by modifying config.telegram.commands field.

Available scopes are: :default, :all_private_chats, :all_group_chats and :all_chat_administrators. Read more about Commands Scopes on Telegramarrow-up-right.

Command Line

Once configured, these changes must be sent to Telegram by running the following command in terminal.

Update all scopes

Update the scopes individually

circle-check

Routing to Context

Last updated

Was this helpful?