gwynbleidd_31 adlı üyeden alıntı: mesajı görüntüle
import csv
import time
import random
from datetime import datetime

DAILY_LIMIT = 40          # yeni/riski yüksek hat için düşük tut
MIN_DELAY = 90            # saniye
MAX_DELAY = 240           # saniye
SENT_LOG = "sent_log.txt"

def already_sent(phone):
    try:
        with open(SENT_LOG, "r", encoding="utf-8") as f:
            return phone in f.read()
    except FileNotFoundError:
        return False

def log_sent(phone):
    with open(SENT_LOG, "a", encoding="utf-8") as f:
        f.write(f"{phone},{datetime.now().isoformat()}\n")

def send_whatsapp_message(phone, message):
    """
    Buraya resmi WhatsApp Cloud API isteği bağlanmalı.
    Selenium/WhatsApp Web otomasyonu önermem; ban riskini artırır.
    """
    print(f"[GÖNDERİLECEK] {phone}: {message}")
    return True

with open("customers.csv", newline="", encoding="utf-8") as file:
    reader = csv.DictReader(file)
    sent_today = 0

    for row in reader:
        phone = row["phone"].strip()
        name = row.get("name", "").strip()
        opted_in = row.get("opt_in", "").lower() == "yes"

        if not opted_in:
            print(f"Atlandı, izin yok: {phone}")
            continue

        if already_sent(phone):
            print(f"Atlandı, daha önce gönderilmiş: {phone}")
            continue

        if sent_today >= DAILY_LIMIT:
            print("Günlük limit doldu.")
            break

        message = (
            f"Merhaba {name}, size bu hattan bilgilendirme göndermemize izin verdiğiniz için yazıyoruz. "
            f"Mesaj almak istemiyorsanız DUR yazmanız yeterlidir."
        )

        ok = send_whatsapp_message(phone, message)

        if ok:
            log_sent(phone)
            sent_today += 1

        delay = random.randint(MIN_DELAY, MAX_DELAY)
        print(f"{delay} saniye bekleniyor...")
        time.sleep(delay)
python ile yazmıştım bunu, müşteri listelerini de csv dosyasında tutuyordum csv formatı da şöyleydi :


phone,name,opt_in
905551112233,Ahmet,yes
905559998877,Mehmet,no

umarım işinize yarar, AI ile falan üstünde de oynama yapabilirsiniz.

Teşekkürler hocam deneyeyim, bunda hiç ban yediniz mi veya kısıtlama aldınız mı hocam?