From 9e147029d570a8984592f204c71540cbefccd805 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 20 Aug 2023 03:58:58 +0300 Subject: [PATCH] a much better approach to last commit --- files/helpers/alerts.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index dbb05fc110..563f772322 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -156,11 +156,7 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi cost = 0 coin_receivers = set() - groups = group_mention_regex.finditer(text) - if len(list(groups)) > 5: - abort(403, "You can only ping a maximum of 5 ping groups!") - - for i in groups: + for i in group_mention_regex.finditer(text): if oldtext and i.group(1) in oldtext: continue @@ -212,6 +208,9 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi if SITE == 'rdrama.net' and v.id in {256, 9287, 10489, 18701}: notify_users.discard(AEVANN_ID) + if len(notify_users) > 200: + abort(403, "You can only notify a maximum of 200 users.") + return notify_users - BOT_IDs - {v.id, 0} - v.all_twoway_blocks