MainContextwill have the ability to handle the following scenarios:
kogno new your_projectin the terminal, the initial directory structure will contain several directories that will be explained in the following chapters, but the part we'll draw the parallel, is on the
contexts/(Controller in Rails)
ActionControllerclass in Rails, the logic that coordinates the interactions between a user visiting a web, with views and models is written in files such as
purchases_controller.rband so on.
Contextclass in Kogno, the logic that coordinates the interactions between an user who sends a message, with the templates and the models, are also written in files such as
main_context.rb(created by default).
templates/(Views in Rails)
.erbextension in directories like
bot/templates/main(created by default),
bot/templates/main/menu.erbfile and will expect two parameters:
buttons_messagewhich will be explained below.
"main/menu"is used in different situations in the conversation, such as when the user sends a message like "Hi" , "Thank you" or even when the app hasn't understood what the user has said.
models/(Model in Rails)
users) is a model that by default is already created in
@usercan be called, since this is the instance of the
Usermodel for the message sender.
conversation.rb(application_controller.rb in Rails)
Conversationclass, which would be equivalent to
ApplicationControllerclass in Rails.