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

Take chat from message for callback queries

Этот коммит содержится в:
Max Melentiev
2016-10-07 12:45:16 +03:00
родитель 3cb6e930b8
Коммит dd38cfea93
3 изменённых файлов: 51 добавлений и 3 удалений

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

@@ -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