lib/tg-bot.rb in tg-bot-0.0.3 vs lib/tg-bot.rb in tg-bot-0.0.4

- old
+ new

@@ -4,11 +4,11 @@ module Telegram class Bot include Telegram::Reply - attr_reader :user, :forward_from, :chat, :forward_from_chat, :message + attr_reader :user, :forward_from, :chat, :forward_from_chat, :message, :text def initialize(params) # User @user = Telegram::Params::From.new(params) @forward_from = Telegram::Params::ForwardFrom.new(params) @@ -17,14 +17,17 @@ @chat = Telegram::Params::Chat.new(params) @forward_from_chat = Telegram::Params::ForwardChat.new(params) # Message @message = Telegram::Params::Message.new(params) + + # Text + @text = @message.text end class << self def SetWebhook(url) - uri = URI("https://api.telegram.org/bot#{ENV['telegram_token']}/setWebhook?url=#{url}") + uri = URI("https://api.telegram.org/bot#{ENV['telegram_bot_token']}/setWebhook?url=#{url}") Net::HTTP.get(uri) end end end end \ No newline at end of file