Spaces:
Running
Running
Update join.py
Browse files325 unmodified lines326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356325 unmodified linesstats["errors"] += 1def handle_create_event(event_data):"""createイベントの処理(ユーザー参加など)"""try:entity = event_data.get("entity", {})log = entity.get("log", {})chat_id = entity.get("chatId")person_id = entity.get("personId")person_type = entity.get("personType")action = log.get("action", "unknown")print(f"create イベント: action={action}, chatId={chat_id}, "f"personId={person_id}, personType={person_type}")if action == "join":if chat_id == TARGET_GROUP_CHAT_ID2:print(f"ユーザーが対象グループに参加しました: personId={person_id}")else:print(f"ユーザーがグループに参加: chatId={chat_id}, personId={person_id}")elif action == "leave":print(f"ユーザーがグループから退出: chatId={chat_id}, personId={person_id}")else:print(f"その他のアクション: {action}")except Exception as e:print(f"create イベント処理エラー: {e}")print(traceback.format_exc())stats["errors"] += 1325 unmodified lines326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355325 unmodified linesstats["errors"] += 1def handle_create_event(event_data):"""createイベントの処理"""try:event = event_data.get("event")event_type = event_data.get("type")entity = event_data.get("entity", {})print(f"createイベント: event={event}, type={event_type}")# マネージャー作成(参加)if event_type == "manager":manager_id = entity.get("managerId") or entity.get("id")name = entity.get("name")email = entity.get("email")print("=== 新しいマネージャーが参加 ===")print(f"ID : {manager_id}")print(f"名前 : {name}")print(f"メール : {email}")else:print(f"未処理のcreateイベント: {event_type}")except Exception as e:print(f"createイベント処理エラー: {e}")print(traceback.format_exc())stats["errors"] += 1
join.py+20-21