Skip to content

Commit 74f0b2b

Browse files
Added the field allows_users_to_create_topics to the class User.
1 parent bc4374f commit 74f0b2b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

telebot/types.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ class User(JsonDeserializable, Dictionaryable, JsonSerializable):
515515
:param has_topics_enabled: Optional. True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.
516516
:type has_topics_enabled: :obj:`bool`
517517

518+
:param allows_users_to_create_topics: Optional. True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.
519+
:type allows_users_to_create_topics: :obj:`bool`
520+
518521
:return: Instance of the class
519522
:rtype: :class:`telebot.types.User`
520523
"""
@@ -528,7 +531,7 @@ def de_json(cls, json_string):
528531
def __init__(self, id, is_bot, first_name, last_name=None, username=None, language_code=None,
529532
can_join_groups=None, can_read_all_group_messages=None, supports_inline_queries=None,
530533
is_premium=None, added_to_attachment_menu=None, can_connect_to_business=None,
531-
has_main_web_app=None, has_topics_enabled=None, **kwargs):
534+
has_main_web_app=None, has_topics_enabled=None, allows_users_to_create_topics=None, **kwargs):
532535
self.id: int = id
533536
self.is_bot: bool = is_bot
534537
self.first_name: str = first_name
@@ -543,6 +546,7 @@ def __init__(self, id, is_bot, first_name, last_name=None, username=None, langua
543546
self.can_connect_to_business: Optional[bool] = can_connect_to_business
544547
self.has_main_web_app: Optional[bool] = has_main_web_app
545548
self.has_topics_enabled: Optional[bool] = has_topics_enabled
549+
self.allows_users_to_create_topics: Optional[bool] = allows_users_to_create_topics
546550

547551
@property
548552
def full_name(self) -> str:
@@ -570,7 +574,10 @@ def to_dict(self):
570574
'is_premium': self.is_premium,
571575
'added_to_attachment_menu': self.added_to_attachment_menu,
572576
'can_connect_to_business': self.can_connect_to_business,
573-
'has_main_web_app': self.has_main_web_app}
577+
'has_main_web_app': self.has_main_web_app,
578+
'has_topics_enabled': self.has_topics_enabled,
579+
'allows_users_to_create_topics': self.allows_users_to_create_topics
580+
}
574581

575582

576583
# noinspection PyShadowingBuiltins

0 commit comments

Comments
 (0)