Skip to content

Commit

Permalink
fix chat member rights (#299)
Browse files Browse the repository at this point in the history
* fix chat member rights

* Fix specs, add missing attributes

---------

Co-authored-by: Alexander Tipugin <[email protected]>
  • Loading branch information
seorgiy and atipugin authored Dec 3, 2023
1 parent a3b8171 commit e58bdd7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
3 changes: 3 additions & 0 deletions lib/telegram/bot/types/chat_administrator_rights.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions lib/telegram/bot/types/chat_member_administrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/telegram/bot/types/write_access_allowed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 25 additions & 9 deletions spec/support/type_attributes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e58bdd7

Please sign in to comment.