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

Add UpdatesController#webhook_request

Этот коммит содержится в:
Max Melentiev
2023-04-16 20:15:45 +01:00
родитель ca20bb0533
Коммит cbe7186c44
12 изменённых файлов: 76 добавлений и 12 удалений

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

@@ -430,6 +430,10 @@ There are several options to run it automatically:
- Use `Telegram::Bot::Middleware` with rack ([example in wiki](https://github.com/telegram-bot-rb/telegram-bot/wiki/Not-rails-application)).
- Use poller (described in the next section).
When controller runs in webhook mode `Telegram::Bot::Middleware` passes
`ActionDispatch::Request` object to the `.dispatch` method.
It's available via `#webhook_request` controller method.
To run action without update (ex., send notifications from jobs),
you can call `#process` directly. In this case controller can be initialized
with `:from` and/or `:chat` options instead of `update` object: