Sha256: 362cd53d342dcc2fdb647c1173d569b0bb9a6fd6f613173c6d3d306fabe4502d

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

module TeleNotify
  module Controller
    def webhook
      if params[:message]
        user = TelegramUser.create( { telegram_id: params[:message][:from][:id], first_name: params[:message][:from][:first_name] } )
        if user
          user.send_message("Notifications are now active. To cancel, stop this bot in Telegram.")
        end
        render :nothing => true, :status => :ok
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tele_notify-0.1.1 lib/tele_notify/telegram_controller.rb