Skip to content
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

Webhook quick start sinatra docs #162

Open
wants to merge 2 commits into
base: master
from

Conversation

@chriso0710
Copy link

chriso0710 commented Nov 29, 2017

Thanks for this gem. I have been using it with long polling and webhooks.
Webhooks are far superior compared to long polling and I think this should be made clear in the docs. I was missing a small quick start example for Sinatra/Rails.

So this is my shot at a better documentation, see issue #19

Keep up the good work!

post '/telegram' do
request.body.rewind
data = JSON.parse(request.body.read)
@bot = Telegram::Bot::Api.new(ENV['TELEGRAM_BOT_API_TOKEN'])

This comment has been minimized.

Copy link
@ivanovaleksey

ivanovaleksey Nov 30, 2017

Contributor

Is it necessary to use instance variables for bot and message?

This comment has been minimized.

Copy link
@chriso0710

chriso0710 Nov 30, 2017

Author

No, of course not. But on the other hand it won't hurt anyone... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.