зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-08-28 15:26:18 +03:00
Сравнить коммиты
1 Коммитов
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
7d8a19d3c8 |
@@ -1,6 +1,6 @@
|
||||
# Unreleased
|
||||
|
||||
# 0.15.5
|
||||
# 0.15.6
|
||||
|
||||
- Rails 7.0 support.
|
||||
- Fix sending File objects in nested objects in sendMediaGroup.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[](http://badge.fury.io/rb/telegram-bot)
|
||||
[](https://codeclimate.com/github/telegram-bot-rb/telegram-bot)
|
||||
[](https://travis-ci.com/telegram-bot-rb/telegram-bot)
|
||||
[](https://app.travis-ci.com/github/telegram-bot-rb/telegram-bot)
|
||||
|
||||
Tools for developing Telegram bots. Best used with Rails, but can be used in
|
||||
[standalone app](https://github.com/telegram-bot-rb/telegram-bot/wiki/Not-rails-application).
|
||||
|
||||
@@ -37,7 +37,7 @@ module Telegram
|
||||
end
|
||||
|
||||
def prepare_async_args(action, body = {})
|
||||
[action.to_s, Async.prepare_hash(RequestBodyFormatter.format(body))]
|
||||
[action.to_s, Async.prepare_hash(RequestBodyFormatter.format(body, action))]
|
||||
end
|
||||
|
||||
def error_for_response(response)
|
||||
@@ -63,7 +63,7 @@ module Telegram
|
||||
end
|
||||
|
||||
def request(action, body = {})
|
||||
response = http_request("#{base_uri}#{action}", RequestBodyFormatter.format(body))
|
||||
response = http_request("#{base_uri}#{action}", RequestBodyFormatter.format(body, action))
|
||||
raise self.class.error_for_response(response) if response.status >= 300
|
||||
JSON.parse(response.body)
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module Telegram
|
||||
module Bot
|
||||
VERSION = '0.15.5'.freeze
|
||||
VERSION = '0.15.6'.freeze
|
||||
|
||||
def self.gem_version
|
||||
Gem::Version.new VERSION
|
||||
|
||||
@@ -129,7 +129,8 @@ RSpec.describe Telegram::Bot::Client do
|
||||
let(:body) { body_json.to_json }
|
||||
let(:body_json) { {'param' => 'val', 'description' => 'some description'} }
|
||||
before do
|
||||
expect(described_class).to receive(:prepare_body).with(request_body) { prepared_body }
|
||||
expect(Telegram::Bot::Client::RequestBodyFormatter).
|
||||
to receive(:format).with(request_body, action) { prepared_body }
|
||||
expect(instance).to receive(:http_request).with(url, prepared_body) { response }
|
||||
end
|
||||
around { |ex| Telegram::Bot::ClientStub.stub_all!(false) { ex.run } }
|
||||
|
||||
Ссылка в новой задаче
Block a user