before_anything
If it's called in the current context of the conversation, it will always be executed, at the beginning of the block matching process.
Last updated
Was this helpful?
If it's called in the current context of the conversation, it will always be executed, at the beginning of the block matching process.
Last updated
Was this helpful?
Was this helpful?
before_anything(&block)
Messenger
Telegram
In the example below, before_anything
and any_text
will always be executed on arrival of a text message:
class MainContext < Conversation
def blocks
before_anything do
logger.debug "This block is executed Before any other block in this context"
end
any_text do |text|
@reply.text "You've sent me '#{text}'"
end
end
end