Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How I have built Telegram bot for study German

How I have built Telegram bot for study German

You can try the German Memory Bot just add the contact @german_memory_bot in Telegram or use this https://t.me/german_memory_bot

Github source - https://github.com/vermaxik/german_memory_bot
The contribution is welcome!

Maksym Verbovyi

February 08, 2019
Tweet

More Decks by Maksym Verbovyi

Other Decks in Programming

Transcript

  1. How I have built Telegram bot for study German Maksym

    Verbovyi Hamburg, February 2019 Telegram + Ruby = <3
  2. Solving my problems ➔ City sights and captions Want to

    understand popular sights on my way ➔ New words from colleagues Want to save new words to keeping list ➔ Keep in mind Training and memorizing new words, not just keep it
  3. Why messenger? ➔ Don’t need to download ➔ Don’t need

    to support ➔ Cross-platform app ➔ Fast and easy ➔ Big audience
  4. Why Telegram Messenger? ➔ Public API ➔ Ruby Wrapper (gem)

    ➔ Had some experience ➔ Ready solutions ➔ Don’t want to spend a lot of time
  5. Founder of Telegram Pavel Durov • Founded VK in 2006

    • Sold in 2013 by $400 million (12% shares) • 49,5 million audience in 2013 • Created Telegram Messenger 2016 • >200 million users in 2018 • Telegram ICO
  6. Telegram API* *https://core.telegram.org/bots • Inline bots • Payments platform •

    Gaming platform (HTML5) • Keyboards • Commands • Location and number
  7. └── 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 Ruby Telegram Boilerplate • Ruby Telegram Wrapper • ActiveRecord (models + migrations + rake tasks) • Postgresql • Internationalization (locales) • Responder and sender clases (template) • Logger (STDOUT + SQL)
  8. Changes that I made in Boilerplate • Updated versions of

    gems:) • MySQL • Adapted config • Added Google Cloud API
  9. German Memory Bot overview • Save original word • Translate

    word via Google API • Show list of your words and translations • Learn words via guessing algorithm • Already learned words not appear again • Reset training result (forget mode)
  10. Fan stats • 626 - total words for me •

    472 - de, 154 - en • Using 120 days (4 months) • Avg 5-6 words per day • 2-3 words in normal day • >10 words when German courses or informal speaking • Only 6-10 hours have spend to current implementation
  11. Plans • Ability to delete word • Push notifications •

    Improve learn mode (in progress) • Stats • Settings • Other languages