class Hamilton::CmdHandler

Overview

The module for handling commands, callback queries (please, do not use them), known text messages, and some of messages payloads.

Should be included in the class with the implementations of updates' handling functions.

Included Modules

Defined in:

handlers/cmd_handler.cr

Constructors

Instance Method Summary

Instance methods inherited from module Hamilton::Handler

call(update : Hamilton::Types::Update) call, call_next(update : Hamilton::Types::Update) : Nil call_next, next : Handler | HandlerProc | Nil next, next=(next __arg0 : Handler | HandlerProc | Nil) next=

Instance methods inherited from class Reference

==(other : Hamilton::Any) ==

Instance methods inherited from class Object

===(other : Hamilton::Any) ===

Constructor Detail

def self.new(log_level : Log::Severity = Log::Severity::Info) #

Instance Method Detail

def call(update : Hamilton::Types::Update) #
Description copied from module Hamilton::Handler

Handling method that processes an update.


def caller : Hash(Symbol, Proc(Hamilton::Types::Update, Hamilton::Storage, NamedTuple(method: Symbol | Nil, data: Hamilton::Storage))) #

def caller=(caller : Hash(Symbol, Proc(Hamilton::Types::Update, Hamilton::Storage, NamedTuple(method: Symbol | Nil, data: Hamilton::Storage)))) #

def context : Hamilton::Context #

Context for the current bot sessions.


def context=(context : Hamilton::Context) #

Context for the current bot sessions.


def log : Log #

Logger instance.


def log=(log : Log) #

Logger instance.


def mapper : Hash(Symbol, Hash(String | Symbol, Symbol)) #

Mapping between methods and mapper between update types and methods to handle them.


def mapper=(mapper : Hash(Symbol, Hash(String | Symbol, Symbol))) #

Mapping between methods and mapper between update types and methods to handle them.