Spaces:
Running
Running
Update join.py
Browse files
join.py
CHANGED
|
@@ -155,33 +155,36 @@ def process():
|
|
| 155 |
)
|
| 156 |
|
| 157 |
join_targets = []
|
| 158 |
-
|
| 159 |
for m in messages:
|
| 160 |
log = m.get("log") or {}
|
| 161 |
if log.get("action") != "join":
|
| 162 |
continue
|
| 163 |
-
|
| 164 |
created_at = int(m.get("createdAt", 0))
|
| 165 |
person_id = str(m.get("personId", ""))
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
# ===== ブラックリスト判定(accountIdベース)=====
|
| 168 |
try:
|
| 169 |
account_id = get_manager_account_id(person_id)
|
| 170 |
except Exception as e:
|
| 171 |
print(f"[ERROR] manager取得失敗 personId={person_id} : {e}")
|
| 172 |
continue
|
| 173 |
-
|
| 174 |
if account_id and account_id in BLACKLIST_ACCOUNT_IDS:
|
| 175 |
try:
|
| 176 |
blacklist_manager(person_id)
|
| 177 |
except Exception as e:
|
| 178 |
print(f"[ERROR] 削除失敗 personId={person_id} : {e}")
|
| 179 |
continue
|
| 180 |
-
|
| 181 |
# ===== 通常処理 =====
|
| 182 |
-
|
| 183 |
-
join_targets.append(person_id)
|
| 184 |
-
|
| 185 |
if not join_targets:
|
| 186 |
return
|
| 187 |
|
|
|
|
| 155 |
)
|
| 156 |
|
| 157 |
join_targets = []
|
| 158 |
+
|
| 159 |
for m in messages:
|
| 160 |
log = m.get("log") or {}
|
| 161 |
if log.get("action") != "join":
|
| 162 |
continue
|
| 163 |
+
|
| 164 |
created_at = int(m.get("createdAt", 0))
|
| 165 |
person_id = str(m.get("personId", ""))
|
| 166 |
+
|
| 167 |
+
# ===== ここを追加 =====
|
| 168 |
+
# CHECK_PERSON_ID の最新発言より前なら無視
|
| 169 |
+
if created_at <= latest_check_person:
|
| 170 |
+
continue
|
| 171 |
+
|
| 172 |
# ===== ブラックリスト判定(accountIdベース)=====
|
| 173 |
try:
|
| 174 |
account_id = get_manager_account_id(person_id)
|
| 175 |
except Exception as e:
|
| 176 |
print(f"[ERROR] manager取得失敗 personId={person_id} : {e}")
|
| 177 |
continue
|
| 178 |
+
|
| 179 |
if account_id and account_id in BLACKLIST_ACCOUNT_IDS:
|
| 180 |
try:
|
| 181 |
blacklist_manager(person_id)
|
| 182 |
except Exception as e:
|
| 183 |
print(f"[ERROR] 削除失敗 personId={person_id} : {e}")
|
| 184 |
continue
|
| 185 |
+
|
| 186 |
# ===== 通常処理 =====
|
| 187 |
+
join_targets.append(person_id)
|
|
|
|
|
|
|
| 188 |
if not join_targets:
|
| 189 |
return
|
| 190 |
|