From e58bdd7d5a050d3661e0a7b40d22f55a21cfa4be Mon Sep 17 00:00:00 2001 From: Seorgiy <44596276+seorgiy@users.noreply.github.com> Date: Sun, 3 Dec 2023 07:38:09 +0300 Subject: [PATCH] fix chat member rights (#299) * fix chat member rights * Fix specs, add missing attributes --------- Co-authored-by: Alexander Tipugin --- .../bot/types/chat_administrator_rights.rb | 3 ++ .../bot/types/chat_member_administrator.rb | 9 +++-- .../bot/types/write_access_allowed.rb | 2 ++ spec/support/type_attributes.yml | 34 ++++++++++++++----- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/lib/telegram/bot/types/chat_administrator_rights.rb b/lib/telegram/bot/types/chat_administrator_rights.rb index e1708f78..691f180b 100644 --- a/lib/telegram/bot/types/chat_administrator_rights.rb +++ b/lib/telegram/bot/types/chat_administrator_rights.rb @@ -15,6 +15,9 @@ class ChatAdministratorRights < Base attribute? :can_post_messages, Types::Bool attribute? :can_edit_messages, Types::Bool attribute? :can_pin_messages, Types::Bool + attribute? :can_post_stories, Types::Bool + attribute? :can_edit_stories, Types::Bool + attribute? :can_delete_stories, Types::Bool attribute? :can_manage_topics, Types::Bool end end diff --git a/lib/telegram/bot/types/chat_member_administrator.rb b/lib/telegram/bot/types/chat_member_administrator.rb index c70c7078..ab9c4ae2 100644 --- a/lib/telegram/bot/types/chat_member_administrator.rb +++ b/lib/telegram/bot/types/chat_member_administrator.rb @@ -16,9 +16,12 @@ class ChatMemberAdministrator < Base attribute :can_change_info, Types::Bool attribute :can_invite_users, Types::Bool attribute? :can_post_messages, Types::Bool - attribute? :can_edit_messages, Types::Integer - attribute? :can_pin_messages, Types::Integer - attribute? :can_manage_topics, Types::Integer + attribute? :can_edit_messages, Types::Bool + attribute? :can_pin_messages, Types::Bool + attribute? :can_post_stories, Types::Bool + attribute? :can_edit_stories, Types::Bool + attribute? :can_delete_stories, Types::Bool + attribute? :can_manage_topics, Types::Bool attribute? :custom_title, Types::String end end diff --git a/lib/telegram/bot/types/write_access_allowed.rb b/lib/telegram/bot/types/write_access_allowed.rb index 02c7c0a2..2dbc0dc5 100644 --- a/lib/telegram/bot/types/write_access_allowed.rb +++ b/lib/telegram/bot/types/write_access_allowed.rb @@ -4,7 +4,9 @@ module Telegram module Bot module Types class WriteAccessAllowed < Base + attribute? :from_request, Types::Bool attribute? :web_app_name, Types::String + attribute? :from_attachment_menu, Types::Bool end end end diff --git a/spec/support/type_attributes.yml b/spec/support/type_attributes.yml index a36a0ad8..65fe2de9 100644 --- a/spec/support/type_attributes.yml +++ b/spec/support/type_attributes.yml @@ -803,15 +803,6 @@ ForceReply: required: false - name: selective required: false -BotShortDescription: -- name: short_description - required: true -BotName: -- name: name - required: true -BotDescription: -- name: description - required: true BotCommandScopeDefault: - name: type required: true @@ -841,6 +832,15 @@ BotCommandScopeAllGroupChats: BotCommandScopeAllChatAdministrators: - name: type required: true +BotShortDescription: +- name: short_description + required: true +BotDescription: +- name: description + required: true +BotName: +- name: name + required: true ChatAdministratorRights: - name: is_anonymous required: true @@ -864,6 +864,12 @@ ChatAdministratorRights: required: false - name: can_pin_messages required: false +- name: can_post_stories + required: false +- name: can_edit_stories + required: false +- name: can_delete_stories + required: false - name: can_manage_topics required: false MenuButtonWebApp: @@ -1060,6 +1066,12 @@ ChatMemberAdministrator: required: false - name: can_pin_messages required: false +- name: can_post_stories + required: false +- name: can_edit_stories + required: false +- name: can_delete_stories + required: false - name: can_manage_topics required: false - name: custom_title @@ -1280,8 +1292,12 @@ PassportData: - name: credentials required: true WriteAccessAllowed: +- name: from_request + required: false - name: web_app_name required: false +- name: from_attachment_menu + required: false ChatShared: - name: request_id required: true