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

Merge pull request #2 from telegram-bot-rb/async

Async requests
Этот коммит содержится в:
printercu
2016-10-19 14:00:26 +03:00
коммит произвёл GitHub
родитель 4b511f51a7 caee9809d0
Коммит 9e67122465
24 изменённых файлов: 728 добавлений и 121 удалений

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

@@ -1,33 +0,0 @@
module Telegram
module Bot
class UpdatesController
# Helpers for botan.io metrics.
module Botan
class MissingFrom < Error; end
protected
def botan
@botan ||= bot.try!(:botan)
end
# Track custom event for user taken from `from` field:
#
# botan_track :my_event, {data: :val}
#
def botan_track(event, data = {})
raise MissingFrom, 'Can not track without user' unless from
botan.try! { |x| x.track(event, from['id'], data) }
end
# Track current action and payload for current user. Best used with `before_action`:
#
# before_action :botan_track_action
#
def botan_track_action
botan_track(action_name, payload)
end
end
end
end
end