Skip to content

Commit

Permalink
Fix max_quantity error if it is None
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Dec 28, 2023
1 parent 0a38392 commit 914a25f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pyrogram/types/bots_and_keyboards/request_channel_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class RequestChannelInfo(Object):
max_quantity(``int``, *optional*):
Max quantity of peers.
Defaults to None (One peer only).
user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
Privileged actions that an user administrator is able to take.
Expand All @@ -58,6 +59,6 @@ def __init__(
self.button_id = button_id
self.is_creator = is_creator
self.has_username = has_username
self.max_quantity = max_quantity
self.max_quantity = max_quantity or 1
self.user_privileges = user_privileges
self.bot_privileges = bot_privileges
3 changes: 2 additions & 1 deletion pyrogram/types/bots_and_keyboards/request_chat_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class RequestChatInfo(Object):
max_quantity(``int``, *optional*):
Max quantity of peers.
Defaults to None (One peer only).
user_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
Privileged actions that an user administrator is able to take.
Expand All @@ -68,6 +69,6 @@ def __init__(
self.is_bot_participant = is_bot_participant
self.has_username = has_username
self.has_forum = has_forum
self.max_quantity = max_quantity
self.max_quantity = max_quantity or 1
self.user_privileges = user_privileges
self.bot_privileges = bot_privileges
3 changes: 2 additions & 1 deletion pyrogram/types/bots_and_keyboards/request_user_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class RequestUserInfo(Object):
max_quantity(``int``, *optional*):
Max quantity of peers.
Defaults to None (One peer only).
"""

def __init__(
Expand All @@ -48,4 +49,4 @@ def __init__(
self.button_id = button_id
self.is_bot = is_bot
self.is_premium = is_premium
self.max_quantity = max_quantity
self.max_quantity = max_quantity or 1

0 comments on commit 914a25f

Please sign in to comment.