Skip to content

Commit

Permalink
Added the new administrator privileges can_post_stories, can_edit_sto…
Browse files Browse the repository at this point in the history
…ries and can_delete_stories to the classes ChatMemberAdministrator and ChatAdministratorRights.
  • Loading branch information
coder2020official committed Sep 22, 2023
1 parent aef5727 commit e904b91
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,7 @@ def __init__(self, user, status, custom_title=None, is_anonymous=None, can_be_ed
can_send_other_messages=None, can_add_web_page_previews=None,
can_manage_chat=None, can_manage_video_chats=None,
until_date=None, can_manage_topics=None,
can_post_stories=None, can_edit_stories=None, can_delete_stories=None,
**kwargs):
self.user: User = user
self.status: str = status
Expand Down Expand Up @@ -2919,6 +2920,9 @@ def __init__(self, user, status, custom_title=None, is_anonymous=None, can_be_ed
self.can_send_videos: bool = can_send_videos
self.can_send_video_notes: bool = can_send_video_notes
self.can_send_voice_notes: bool = can_send_voice_notes
self.can_post_stories: bool = can_post_stories
self.can_edit_stories: bool = can_edit_stories
self.can_delete_stories: bool = can_delete_stories



Expand Down Expand Up @@ -3006,6 +3010,15 @@ class ChatMemberAdministrator(ChatMember):
:param custom_title: Optional. Custom title for this user
:type custom_title: :obj:`str`
:param can_post_stories: Optional. True, if the administrator can post channel stories
:type can_post_stories: :obj:`bool`
:param can_edit_stories: Optional. True, if the administrator can edit stories
:type can_edit_stories: :obj:`bool`
:param can_delete_stories: Optional. True, if the administrator can delete stories of other users
:type can_delete_stories: :obj:`bool`
:return: Instance of the class
:rtype: :class:`telebot.types.ChatMemberAdministrator`
"""
Expand Down Expand Up @@ -7179,6 +7192,15 @@ class ChatAdministratorRights(JsonDeserializable, JsonSerializable, Dictionaryab
:param can_manage_topics: Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only
:type can_manage_topics: :obj:`bool`
:param can_post_stories: Optional. True, if the administrator can post channel stories
:type can_post_stories: :obj:`bool`
:param can_edit_stories: Optional. True, if the administrator can edit stories
:type can_edit_stories: :obj:`bool`
:param can_delete_stories: Optional. True, if the administrator can delete stories of other users
:type can_delete_stories: :obj:`bool`
:return: Instance of the class
:rtype: :class:`telebot.types.ChatAdministratorRights`
"""
Expand All @@ -7193,7 +7215,10 @@ def __init__(self, is_anonymous: bool, can_manage_chat: bool,
can_delete_messages: bool, can_manage_video_chats: bool, can_restrict_members: bool,
can_promote_members: bool, can_change_info: bool, can_invite_users: bool,
can_post_messages: bool=None, can_edit_messages: bool=None,
can_pin_messages: bool=None, can_manage_topics: bool=None) -> None:
can_pin_messages: bool=None, can_manage_topics: bool=None,
can_post_stories: bool=None, can_edit_stories: bool=None,
can_delete_stories: bool=None
) -> None:

self.is_anonymous: bool = is_anonymous
self.can_manage_chat: bool = can_manage_chat
Expand All @@ -7207,6 +7232,9 @@ def __init__(self, is_anonymous: bool, can_manage_chat: bool,
self.can_edit_messages: bool = can_edit_messages
self.can_pin_messages: bool = can_pin_messages
self.can_manage_topics: bool = can_manage_topics
self.can_post_stories: bool = can_post_stories
self.can_edit_stories: bool = can_edit_stories
self.can_delete_stories: bool = can_delete_stories

def to_dict(self):
json_dict = {
Expand All @@ -7227,6 +7255,13 @@ def to_dict(self):
json_dict['can_pin_messages'] = self.can_pin_messages
if self.can_manage_topics is not None:
json_dict['can_manage_topics'] = self.can_manage_topics
if self.can_post_stories is not None:
json_dict['can_post_stories'] = self.can_post_stories
if self.can_edit_stories is not None:
json_dict['can_edit_stories'] = self.can_edit_stories
if self.can_delete_stories is not None:
json_dict['can_delete_stories'] = self.can_delete_stories

return json_dict

def to_json(self):
Expand Down

0 comments on commit e904b91

Please sign in to comment.