-
Notifications
You must be signed in to change notification settings - Fork 218
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FAQ] sample rails app with telegram-bot-ruby #161
Labels
Comments
Hi @kirantpatil , it look's like:
do not forgot |
Take a look at #19 |
@kirantpatil Something like class TelegramController < ApplicationController
before_action :auth
skip_before_action :verify_authenticity_token
def webhook
update = Telegram::Bot::Types::Update.new(params.permit!.to_h)
message = update.message
# do something
end
private
def client
@client ||= Telegram::Bot::Api.new(Rails.application.credentials.telegram[:bot_token])
end
def auth
Raise "Unauthorized" unless params.require(:webhook_token) == Rails.application.credentials.telegram[:webhook_token]
end
end |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I would like to know how to use this gem with Rails app ?
If there is a sample app, please provide its source code url.
Thanks.
The text was updated successfully, but these errors were encountered: