Sha256: 7e89a1dc9228adadc96abcf19e78905443f426a0b6a2c105516b0492d00f0594

Contents?: true

Size: 451 Bytes

Versions: 1

Compression:

Stored size: 451 Bytes

Contents

class SubscribeController < ApplicationController
  def webhook
    if params[:message]
      user = TelegramUser.create( { telegram_id: params[:message][:from][:id], first_name: params[:message][:from][:first_name],last_name: params[:message][:from][:last_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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
telegram_notifications-0.0.1 lib/generators/telegram_notifications/migration/templates/active_record/subscribe_controller.rb