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

Use bang-methods as actions for commands

Этот коммит содержится в:
Max Melentiev
2018-05-28 12:30:47 +03:00
родитель 8db3204609
Коммит 9310fa613b
15 изменённых файлов: 225 добавлений и 190 удалений

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

@@ -48,7 +48,7 @@ module Telegram
end
# Action to clear context.
def cancel
def cancel!
# Context is already cleared in action_for_message
end
@@ -71,7 +71,10 @@ module Telegram
@context = val && val.to_sym
super || context && begin
handler = handler_for_context
[true, handler, payload['text'].try!(:split) || []] if handler
if handler
action_options = {type: :message_context, context: context}
[[handler, action_options], payload['text'].try!(:split) || []]
end
end
end