- Group chats are not supported!
return_to
is almost deprecated
Install all required gems:
bundle install
Clone these files and fill them with your data:
- "config.yml.example" ---> "config.yml"
- ".env.example" ---> ".env"
- start postgresql server with sudo:
sudo service postgresql start
- enter your account password in terminal prompt.
You can run rake tasks.
bundle exec rake --tasks
Launch the following from the app root
bundle exec ruby app.rb
To view all places, where you should place your new code, search by files texts a code word: TEMPLATE_TODO
message.text
---->Routers::Messages::TextCommandsRouter
- ---->
Handlers::TextCommands::YourHandlerHere
- ----> Does, what it should do, when given command is typed
message.data
goes toRouters::Messages::CallbacksRouter
- ---->
Handlers::Callbacks::YourHandlerHere
- a) callback is from Main Menu: ----> Shows tapped menu
b) callback is from Feature: ---->Routers::Features::YourFeatureRouter
- only from 3b: ----> Shows tapped menu
Phrase | Description |
---|---|
Common command | Text commands. The ones, that are writen with a foregoing slash |
Main Menu | Bot's main menu. Usually consists of your features and Preferences |
Option | Clickable callback-buttons at each menu |
User Options | Same as preferences |
Preferences | User's preferences |
There're default behaviors of those methods below.
Method Handlers::Common::Base#start
does next:
- Checks if User is already registered (finds in database by his telegram_id). 2.1. If User is registered -- shows Main Menu. 2.2. If User is not registered -- launches registration dialog.
As you could notice, default start
behaviour requires model User to exist.
Sends a help-message to chat, where /help
was called.
Message contains all described common commands.