#!/usr/bin/env python3
"""Pasang carousel 3 slide ke IG TSC — 20:00 WIB 8 Sep (urutan: 1402 → ef62 → 8781)."""
import sys, json, urllib.request
sys.path.insert(0, "/home/mantapman/.hermes/profiles/atun/workspace")
from repliz_client import HEADERS, BASE

TSC_IG = "6a86a7e062caae1e04ff8244"
BASE_URL = "https://mantapserver.tail3947bb.ts.net/openclaw-img/"
AT = "2026-09-08T13:00:00.000Z"  # 20:00 WIB

SLIDES = [
    {"url": BASE_URL + "tsc_carousel_new_01.jpg", "type": "image", "alt": "tsc_slide_01"},
    {"url": BASE_URL + "tsc_carousel_new_02.jpg", "type": "image", "alt": "tsc_slide_02"},
    {"url": BASE_URL + "tsc_carousel_new_03.jpg", "type": "image", "alt": "tsc_slide_03"},
]

CAP = (
    "Kulit sehat itu bukan tentang produk paling mahal, tapi tentang perawatan yang tepat untuk kondisi kulitmu. ✨\n\n"
    "Di The Skin Code Clinic, setiap penanganan dimulai dari diagnosis dokter spesialis — bukan asumsi. Konsultasi yang nyaman, penanganan berbasis bukti, dan privasi yang terjaga.\n\n"
    "📲 Konsultasi & booking via WhatsApp: 0851-1744-4417\n\n"
    "Masalah kulit apa yang paling sering kamu alami? Cerita di komentar, yuk diskusi! 👇\n\n"
    "#theskincodeclinic #dokterkulit #klinikkulit #perawatankulit #kulitsehat #skinclinic #dermatology #estetikamedis"
)

payload = {
    "accountId": TSC_IG,
    "title": "The Skin Code Clinic — Carousel",
    "description": CAP,
    "topic": "Klinik Kulit",
    "type": "album",
    "medias": SLIDES,
    "scheduleAt": AT,
    "replies": [],
}
req = urllib.request.Request(f"{BASE}/public/schedule",
                             data=json.dumps(payload).encode(),
                             headers={**HEADERS, "Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=30) as r:
    res = json.load(r)
print("✅ Carousel 3 slide → IG TSC | 20:00 WIB 8 Sep | id:", res.get("_id") or res.get("id") or "?")
