Fix max_quantity error if it is None

This commit is contained in:
KurimuzonAkuma 2023-12-29 00:34:17 +03:00
parent 0a383924f9
commit 914a25f326
3 changed files with 6 additions and 3 deletions

View File

@ -36,6 +36,7 @@ class RequestChannelInfo(Object):
max_quantity(``int``, *optional*): max_quantity(``int``, *optional*):
Max quantity of peers. Max quantity of peers.
Defaults to None (One peer only).
user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*): user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
Privileged actions that an user administrator is able to take. Privileged actions that an user administrator is able to take.
@ -58,6 +59,6 @@ class RequestChannelInfo(Object):
self.button_id = button_id self.button_id = button_id
self.is_creator = is_creator self.is_creator = is_creator
self.has_username = has_username self.has_username = has_username
self.max_quantity = max_quantity self.max_quantity = max_quantity or 1
self.user_privileges = user_privileges self.user_privileges = user_privileges
self.bot_privileges = bot_privileges self.bot_privileges = bot_privileges

View File

@ -42,6 +42,7 @@ class RequestChatInfo(Object):
max_quantity(``int``, *optional*): max_quantity(``int``, *optional*):
Max quantity of peers. Max quantity of peers.
Defaults to None (One peer only).
user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*): user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
Privileged actions that an user administrator is able to take. Privileged actions that an user administrator is able to take.
@ -68,6 +69,6 @@ class RequestChatInfo(Object):
self.is_bot_participant = is_bot_participant self.is_bot_participant = is_bot_participant
self.has_username = has_username self.has_username = has_username
self.has_forum = has_forum self.has_forum = has_forum
self.max_quantity = max_quantity self.max_quantity = max_quantity or 1
self.user_privileges = user_privileges self.user_privileges = user_privileges
self.bot_privileges = bot_privileges self.bot_privileges = bot_privileges

View File

@ -34,6 +34,7 @@ class RequestUserInfo(Object):
max_quantity(``int``, *optional*): max_quantity(``int``, *optional*):
Max quantity of peers. Max quantity of peers.
Defaults to None (One peer only).
""" """
def __init__( def __init__(
@ -48,4 +49,4 @@ class RequestUserInfo(Object):
self.button_id = button_id self.button_id = button_id
self.is_bot = is_bot self.is_bot = is_bot
self.is_premium = is_premium self.is_premium = is_premium
self.max_quantity = max_quantity self.max_quantity = max_quantity or 1