command
Catches a Telegram command, which has been specified as an argument.
command(name=String|Symbol, &block)
command(name=String|Symbol, &block)Platforms
Platform
Supported
Messenger
Telegram
Usage
class MainContext < Conversation
def blocks
command :start do
@reply.text "Hello and welcome!"
end
endConfiguration
In order to be implemented in Kogno, the commands must be created first in Telegram through the BotFather 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 Telegram.
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
Routing to Context
Each command can be routed to a specific context, learn how in Routing Chapter.
Last updated
Was this helpful?