From d486fe3c6cf1e1f24487e479591dfc915f20eed0 Mon Sep 17 00:00:00 2001 From: SoClose <33631880+SoClosee@users.noreply.github.com> Date: Wed, 4 Mar 2026 03:25:11 +0100 Subject: [PATCH] fix: prioritize active friends during group invite automation --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index b06eec4..e30a29d 100644 --- a/main.py +++ b/main.py @@ -286,7 +286,9 @@ def _select_friends(self, target_count): if not friend_el.find("div", attrs={"role": "checkbox"}): idx += 1 continue - + # Sort friends by activity level (example heuristic) + friend_activity = get_friend_activity(friend_el) + friends.sort(key=lambda x: get_friend_activity(x), reverse=True) try: xpath = xpath_soup(friend_el) sel_el = self.driver.find_element(By.XPATH, xpath)