зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-04 02:05:52 +03:00
Take chat from message for callback queries
Этот коммит содержится в:
@@ -131,6 +131,7 @@ class Telegram::WebhookController < Telegram::Bot::UpdatesController
|
||||
# do_smth_with(data)
|
||||
|
||||
# There are `chat` & `from` shortcut methods.
|
||||
# For callback queries `chat` if taken from `message` when it's available.
|
||||
response = from ? "Hello #{from['username']}!" : 'Hi there!'
|
||||
# There is `respond_with` helper to set `chat_id` from received message:
|
||||
respond_with :message, text: response
|
||||
|
||||
Ссылка в новой задаче
Block a user