import json

def read_setting_value(key):
    try:
        with open('seting.json', 'r') as f:
            settings = json.load(f)
        return settings.get(key)
    except FileNotFoundError:
        print(f"Lỗi: File seting.json không tồn tại.")
        return None
    except json.JSONDecodeError as e:
        print(f"Lỗi: File seting.json có định dạng không hợp lệ - {e}")
        return None

def read_prefix():
    return read_setting_value('prefix')

def read_admin():
    return read_setting_value('adm')

IMEI = "dfaa5954-cdf1-4266-98fc-d856b5b78120-5b2ba492da1bf8b88f5f71b161575820"
SESSION_COOKIES = {"_ga":"GA1.2.411666556.1751538498","ozi":"2000.QOBlzDCV2uGerkFzm09Hrc7GuFFD3rNT9Tddz80BKT0WrEtwE3K.1","app.event.zalo.me":"5501101339071264478","__zi":"3000.SSZzejyD6zOgdh2mtnLQWYQN_RAG01ICFjIXe9fEM8WzdkkbcK1NYt6MvQBKH5E6T9llh3Wr.1","__zi-legacy":"3000.SSZzejyD6zOgdh2mtnLQWYQN_RAG01ICFjIXe9fEM8WzdkkbcK1NYt6MvQBKH5E6T9llh3Wr.1","_zlang":"vn","_gid":"GA1.2.197531265.1754811741","zpsid":"Zvn9.437610992.20.RMIN5H--GlJlrrVk4xv2z6hDCC0iYNJ5BuTxnWJwOWyJMQcX7ZOOR7U-GlG","zpw_sek":"bR4k.437610992.a0.ahPXRca2D5IPQo5EI08qL18WKJzBE1OPC6XkDqPGMXuvOtuJM7iV30TpN3WuFmbs51bmT98Eqxyy0xmEyMeqL0"}

API_KEY = 'api_key'
SECRET_KEY = 'secret_key'
PREFIX = read_prefix() or "."
ADMIN = read_admin()
if ADMIN is None:
    ADMIN = []
elif not isinstance(ADMIN, list):
    ADMIN = [ADMIN]