This app uses telegram-bot gem.
This application developed for resieving weather.
Next planes - add following for the Nova Poshta packages.
< ... in process ... >
- Create bot with @BotFather
unless has_test_bot? - Clone repo.
- run
./bin/setup. - Update
config/secrets.ymlwith your bot's token.
bin/rake telegram:bot:poller
One way is just to run poller. You don't need anything else, just check your production secrets & configs. But there is better way: use webhooks.
You may want to use different token: after you setup the webhook, you need to unset it to run development poller again.
First you need to setup the webhook. There is rake task for it,
but you're free to set it manually with API call.
To use rake task you need to set host in routes.default_url_options
for production environment (config.routes for Rails < 5).
There is already such line in the repo in production.rb.
Uncomment it, change the values, and you're ready for:
bin/rake telegram:bot:set_webhook RAILS_ENV=production
Now deploy your app in any way you like. You don't need run anything special for bot,
but rails server as usual. Your rails app will receive webhooks and bypass them
to bot's controller.
bin/rspec
- Uncomment
async: trueinsecrets.yml. - Run and check the logs out.
- More info about async mode.
- Get token at botan.io.
- Uncomment
botansection insecrets.ymland update token. - Run.
Bug reports and pull requests are welcome on GitHub at https://github.com/telegram-bot-rb/telegram_bot_app.