Skip to content

Commit 5853e34

Browse files
committed
v0.1.15.18 - Account.last_multiuser_flood_err_time
1 parent 7cba6e5 commit 5853e34

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

FunPayAPI/account.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def __init__(self, golden_key: str, user_agent: str | None = None,
7373
"""Время последнего возникновения 429 ошибки"""
7474
self.last_flood_err_time: float = 0
7575
"""Время последнего возникновения ошибки \"Нельзя отправлять сообщения слишком часто.\""""
76+
self.last_multiuser_flood_err_time: float = 0
77+
"""Время последнего возникновения ошибки \"Нельзя слишком часто отправлять сообщения разным пользователям.\""""
7678
self.__locale: Literal["ru", "en", "uk"] | None = None
7779
"""Текущий язык аккаунта."""
7880
self.__default_locale: Literal["ru", "en", "uk"] | None = locale
@@ -720,6 +722,10 @@ def send_message(self, chat_id: int | str, text: Optional[str] = None, chat_name
720722
"You cannot send messages too frequently.",
721723
"Не можна надсилати повідомлення занадто часто."):
722724
self.last_flood_err_time = time.time()
725+
elif error_text in ("Нельзя слишком часто отправлять сообщения разным пользователям.",
726+
"Не можна надто часто надсилати повідомлення різним користувачам.",
727+
"You cannot message multiple users too frequently."):
728+
self.last_multiuser_flood_err_time = time.time()
723729
raise exceptions.MessageNotDeliveredError(response, error_text, chat_id)
724730
if leave_as_unread:
725731
message_text = text
@@ -1394,9 +1400,11 @@ def get_sales(self, start_from: str | None = None, include_paid: bool = True, in
13941400
html_response = response.content.decode()
13951401

13961402
parser = BeautifulSoup(html_response, "lxml")
1397-
check_user = parser.find("div", {"class": "content-account content-account-login"})
1398-
if check_user:
1399-
raise exceptions.UnauthorizedError(response)
1403+
1404+
if not start_from:
1405+
username = parser.find("div", {"class": "user-link-name"})
1406+
if not username:
1407+
raise exceptions.UnauthorizedError(response)
14001408

14011409
next_order_id = parser.find("input", {"type": "hidden", "name": "continue"})
14021410
next_order_id = next_order_id.get("value") if next_order_id else None

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
......................','.",`............ ..................
5757
............................................................"""
5858

59-
VERSION = "0.1.15.17"
59+
VERSION = "0.1.15.18"
6060

6161
Utils.cardinal_tools.set_console_title(f"FunPay Cardinal v{VERSION}")
6262

0 commit comments

Comments
 (0)