1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-03 09:46:17 +03:00

Merge pull request #163 from telegram-bot-rb/update_api

Update to Bot API 5.3
Этот коммит содержится в:
Max Melentiev
2021-06-25 19:43:17 +01:00
коммит произвёл GitHub
родитель ac45940937 a49ef51da9
Коммит 07faf87ed7
6 изменённых файлов: 24 добавлений и 9 удалений

Просмотреть файл

@@ -1,5 +1,9 @@
# Unreleased
# 0.15.4
- Update to Bot API 5.3
# 0.15.3
- Ruby 3.0 support: fix translation helpers.

Просмотреть файл

@@ -8,7 +8,7 @@ group :development do
gem 'pry-byebug', '~> 3.9.0'
gem 'sdoc', '~> 2.0.3'
gem 'telegram-bot-types', '~> 0.6.2'
gem 'telegram-bot-types', '~> 0.6.3'
gem 'rspec', '~> 3.10.0'
gem 'rspec-its', '~> 1.3.0'

Просмотреть файл

@@ -1,5 +1,5 @@
# Generated with bin/fetch-telegram-methods
# Bot API 5.0
# Bot API 5.3
getUpdates
setWebhook
@@ -30,13 +30,16 @@ sendDice
sendChatAction
getUserProfilePhotos
getFile
kickChatMember
banChatMember
unbanChatMember
restrictChatMember
promoteChatMember
setChatAdministratorCustomTitle
setChatPermissions
exportChatInviteLink
createChatInviteLink
editChatInviteLink
revokeChatInviteLink
setChatPhoto
deleteChatPhoto
setChatTitle
@@ -47,12 +50,13 @@ unpinAllChatMessages
leaveChat
getChat
getChatAdministrators
getChatMembersCount
getChatMemberCount
getChatMember
setChatStickerSet
deleteChatStickerSet
answerCallbackQuery
setMyCommands
deleteMyCommands
getMyCommands
editMessageText

Просмотреть файл

@@ -99,6 +99,8 @@ module Telegram
pre_checkout_query
poll
poll_answer
my_chat_member
chat_member
].freeze
class << self

Просмотреть файл

@@ -1,6 +1,6 @@
module Telegram
module Bot
VERSION = '0.15.3'.freeze
VERSION = '0.15.4'.freeze
def self.gem_version
Gem::Version.new VERSION

Просмотреть файл

@@ -9,14 +9,19 @@ RSpec.describe Telegram::Bot::UpdatesController::TypedUpdate do
context 'when `update` is a virtus model' do
subject { controller }
unique_types = Telegram::Bot::UpdatesController::PAYLOAD_TYPES - %w[
unique_types = (Telegram::Bot::UpdatesController::PAYLOAD_TYPES - %w[
edited_message
channel_post
edited_channel_post
]
unique_types.each do |type|
my_chat_member
chat_member
]).
map { |x| [x, Telegram::Bot::Types.const_get(type.camelize)] }.to_h.
merge(
'chat_member' => Telegram::Bot::Types::ChatMemberUpdated
)
unique_types.each do |type, type_class|
context "with #{type}" do
type_class = Telegram::Bot::Types.const_get(type.camelize)
let(:payload_type) { type }
let(:payload) do
{}.tap do |result|