1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-03 17:55:52 +03:00

Deprecate telegram_webhooks in favor of telegram_webhook

Этот коммит содержится в:
Max Melentiev
2018-02-02 10:38:18 +03:00
родитель 06253c940e
Коммит 88c8d4fd4e
6 изменённых файлов: 100 добавлений и 29 удалений

Просмотреть файл

@@ -340,17 +340,19 @@ end
### Routes in Rails app
There is `telegram_webhooks` helper for rails app to define routes for webhooks.
There is `telegram_webhook` helper for rails app to define routes for webhooks.
It defines routes at `telegram/#{bot.token}` and connects bots with controller.
For more options see [examples in wiki](https://github.com/telegram-bot-rb/telegram-bot/wiki/Routes-helpers-in-details).
```ruby
# Create routes for all Telegram.bots using single controller:
telegram_webhooks TelegramController
# Most off apps would require
telegram_webhook TelegramController
# which is same as
telegram_webhook TelegramController, :default
# Use different controllers for each bot:
telegram_webhooks chat: TelegramChatController,
auction: TelegramAuctionController
telegram_webhook TelegramChatController, :chat
telegram_webhook TelegramAuctionController, :auction
```
#### Processesing updates
@@ -377,7 +379,7 @@ Use `rake telegram:bot:poller` to run poller in rails app. It automatically load
changes without restart in development env.
Optionally pass bot id in `BOT` envvar (`BOT=chat`) to specify bot to run poller for.
This task requires `telegram_webhooks` helper to be used as it connects bots with controller.
This task requires `telegram_webhook` helper to be used as it connects bots with controller.
To run poller in other cases use:
```ruby