lib/telegram/bot/client.rb in telegram-bot-ruby-0.9.0 vs lib/telegram/bot/client.rb in telegram-bot-ruby-0.9.1
- old
+ new
@@ -6,13 +6,13 @@
def self.run(*args, &block)
new(*args).run(&block)
end
- def initialize(token, h = {})
- @options = default_options.merge(h)
- @api = Api.new(token)
+ def initialize(token, hash = {})
+ @options = default_options.merge(hash)
+ @api = Api.new(token, url: options.delete(:url))
@logger = options.delete(:logger)
end
def run
yield self
@@ -42,10 +42,15 @@
end
private
def default_options
- { offset: 0, timeout: 20, logger: NullLogger.new }
+ {
+ offset: 0,
+ timeout: 20,
+ logger: NullLogger.new,
+ url: 'https://api.telegram.org'
+ }
end
def log_incoming_message(message)
uid = message.from ? message.from.id : nil
logger.info(