andrepcg /
plane_trakr_bot
Ruby telegram bot to notify of airplane ADS-B sightings
29/100 healthLoading repository data…
MaksimAbramchuk / repository
:airplane: Ruby Telegram boilerplate for creating awesome bots. Check out best tools from the world of bots - https://github.com/BotCube/awesome-bots
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.

I've created an awesome list of resources related to bots (from tutorials and SDKs to the events and people). Be sure to check it out!
If you want to use Webhooks API instead of long-polling, be able to save state and create more scalable and powerful bot read the article below.
Full guide on creating statefull Telegram bot
Use the on method in message_responder.rb like in the example below:
def respond
on /^\/start/ do
answer_with_greeting_message
end
on /^\/command (.+)/ do |arg| #supports up to two arguments but it is easily extendable
# do your stuff
end
end
For the first you need to install gems required to start a bot:
bundle install
Then you need to create secrets.yml where your bot unique token will be stored and database.yml where database credentials will be stored. I've already created samples for you, so you can easily do:
cp config/database.yml.sample config/database.yml
cp config/secrets.yml.sample config/secrets.yml
Then you need to fill your Telegram bot unique token to the secrets.yml file and your database credentials to database.yml.
After this you need to create and migrate your database:
rake db:create db:migrate
Great! Now you can easily start your bot just by running this command:
bin/bot
└── ruby-telegram-bot-boilerplate
├── bin # executables folder
│ └── bot # main executable file
├── config # folder with configs
│ ├── database.yml.sample # sample database configuration
│ ├── secrets.yml.sample # sample credentials file
│ └── locales.yml # file with i18n locales
├── db # database related stuff
│ └── migrate # migrations
│ └── 001_create_users.rb # migration for creating table 'users'
├── lib # helper libs folder
│ ├── app_configurator.rb # class for application configuration
│ ├── database_connector.rb # class for connecting to database
│ ├── message_responder.rb # main class for responding to message
│ ├── message_sender.rb # simple class just for message sending
│ └── reply_markup_formatter.rb # class for creating custom keyboards
├── models # database models folder
│ └── user.rb # active record User model
├── Gemfile # Gemfile
├── Gemfile.lock # Gemfile.lock
├── README.md # Readme file
└── Rakefile # Rakefile with tasks for database management
Some more specific info you can also find here.
If you have some proposals how to improve this boilerplate feel free to open issues and send pull requests!
Selected from shared topics, language and repository description—not editorial ratings.
andrepcg /
Ruby telegram bot to notify of airplane ADS-B sightings
29/100 health