Sha256: 95c030c026e8f2095d67f8dac924f19c0863945becf7df7f28543ea7bdfd51de
Contents?: true
Size: 834 Bytes
Versions: 17
Compression:
Stored size: 834 Bytes
Contents
module Telegram module Bot class Botan # Helpers for botan.io metrics. module ControllerHelpers 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
Version data entries
17 entries across 17 versions & 1 rubygems