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 = "4c394068-2c24-40d6-a466-dd95d68bc08c-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":"KiYb.437610992.24.2m47r5Wx1N6eKX1hL3i5SIr8TqLh33D0Q08yGqD_8aPKtEuaMKwNqp0x1N4","zpw_sek":"jIjy.437610992.a0.DiK8JN8yBsg2LJfmKpmlQWaUIW5G1Wq06sL5111MOmz7Qc4D91T08IDJ00SL0H983oThJKKmo84dFLhuq5GlQW"}

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]