"""التسلية والتحشيش والخدمات الشاملة: - 30+ لقب تحشيش وقوائمها ومسحها (التاج، الملوك، الملكات، الثولان، الجلاب، المطايه، الصخول، البقرات، الزواحف، اللوكيه، الاغبياء، الطليان، الطامسين، العسل، الكيك، قلبي، الهطوف، البثرين، الحمير، الكلاب، الكلبات، العتوين، العتويات، اللحوج، اللحجيات، الخرفان، الخفيفين، الخفيفات) - شنو رايك بهذا/بهاي، انطي هديه، بوسه/بوسني، صيحه، رزله، حضن، كف، قول - زوجني، تتزوجني، ثنائي اليوم، اسمي، معرفي، تفاعلي/تفاعله، جهاتي/جهاته، نبذه، الوقت، نداء، نزلني - البوت السحري، معنى اسم، حساب العمر، قوقل، قصص/ثريد، مقالات، زخرفة (16 شكل)، ترجمة (عربي/انقليزي)، أبراج، غنيلي.""" import random import hashlib from datetime import datetime from urllib.parse import quote_plus from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.ext import CallbackQueryHandler from core.router import exact, prefix, norm from core import content from core import ranks as R from core.store import ( settings, ranks_db, stats, users_db, get_counter, activity_label, find_user_by_username, ) from modules.toggles import tg_on from strings_ar import S def _name(u): return u.first_name if u else "" def _fun_ok(update): return tg_on(update.effective_chat.id, "fun") def _pct(update, what): t = update.message.reply_to_message.from_user if update.message.reply_to_message else update.effective_user h = int(hashlib.md5(f"{what}{t.id}".encode()).hexdigest(), 16) % 101 return t, h def _mk_pct(what, emoji): async def h(update, ctx, arg=""): if not _fun_ok(update): await update.message.reply_text(S["feature_off"]) return t, p = _pct(update, what) await update.message.reply_text(S["percent"].format(what=what, name=_name(t), pct=p, emoji=emoji)) return h for w, e in ( ("نسبه الحب", "❤️"), ("نسبه الغباء", "🤪"), ("نسبه الانوثه", "💅"), ("نسبه الرجوله", "💪"), ("نسبه الذكاء", "🧠"), ("نسبه الكدب", "🤥"), ("نسبه الجمال", "🌟"), ("نسبه الحظ", "🍀"), ("نسبه الصدق", "😇"), ("نسبه الكره", "😤"), ("نسبه العصبيه", "🔥"), ): exact(w)(_mk_pct(w, e)) exact("نسبه الرجولة", "نسبه رجولته")(_mk_pct("نسبه الرجوله", "💪")) exact("نسبه انوثتها")(_mk_pct("نسبه الانوثه", "💅")) @exact("تحبه") async def toheb(update, ctx, arg=""): if not _fun_ok(update): await update.message.reply_text(S["feature_off"]) return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return a = update.effective_user pct = int(hashlib.md5(f"love{a.id}{t.id}".encode()).hexdigest(), 16) % 101 await update.message.reply_text(S["toheb"].format(a=a.first_name, b=t.first_name, pct=pct)) # ---------- قوائم رتب التحشيش ومسحها ---------- FUN_PLURALS = { "قائمه التاج": ("تاج", "التاج 👑"), "الملوك": ("ملك", "الملوك 👑"), "الملكات": ("ملكه", "الملكات 👸"), "الطامسين": ("طامس", "الطامسين 🫥"), "الثولان": ("اثول", "الثولان 🤪"), "الجلاب": ("جلب", "الجلاب 🐕"), "المطايه": ("مطي", "المطايه 🐴"), "الصخول": ("صخل", "الصخول 🐐"), "البقرات": ("بقره", "البقرات 🐄"), "الزواحف": ("زاحف", "الزواحف 🦎"), "اللوكيه": ("لوكي", "اللوكيه 😅"), "الاغبياء": ("غبي", "الاغبياء 🤡"), "العسل": ("عسل", "العسل 🍯"), "الكيك": ("كيك", "الكيك 🍰"), "الطليان": ("طلي", "الطليان 🐑"), "قائمه كلبي": ("بكلبي", "القلوب ❤️"), "قائمه القلوب": ("قلبي", "القلوب ❤️"), "قائمه ازواجي": ("زوجي", "الأزواج 💍"), "قائمه زوجاتي": ("زوجتي", "الزوجات 💍"), "قائمه الوتك": ("وتكه", "الوتك ✨"), "قائمه القرده": ("قرد", "القردة 🐒"), "الهطوف": ("هطف", "الهطوف 😹"), "البثرين": ("بثر", "البثرين 😂"), "الحمير": ("حمار", "الحمير 🐴"), "الكلاب": ("كلب", "الكلاب 🐕"), "الكلبات": ("كلبه", "الكلبات 🐕"), "العتوين": ("عتوي", "العتوين 🐈"), "العتويات": ("عتويه", "العتويات 🐈"), "اللحوج": ("لحجي", "اللحوج 🤠"), "اللحجيات": ("لحجيه", "اللحجيات 🤠"), "الخرفان": ("خروف", "الخرفان 🐑"), "الخفيفين": ("خفيف", "الخفيفين 🪶"), "الخفيفات": ("خفيفه", "الخفيفات 🪶"), } def _mk_fun_list(rk, title): async def h(update, ctx, arg=""): chat = update.effective_chat fun = ranks_db.get(chat.id, "f", {}) uids = [int(u) for u, r in fun.items() if norm(r) == norm(rk)] if not uids: await update.message.reply_text(f"✧︙لا يوجد أحد في قائمة {title} حالياً.") return names = [] for i in uids: try: m = await chat.get_member(i) names.append(m.user.first_name) except Exception: names.append(str(i)) await update.message.reply_text(f"✧︙قائمة {title} ({len(names)}):\n" + "\n".join("• " + n for n in names)) return h def _mk_fun_clear(rk, title): async def h(update, ctx, arg=""): if await R.effective_level(update) < R.level("مدير"): await update.message.reply_text(S["need_rank"]) return chat = update.effective_chat.id fun = ranks_db.get(chat, "f", {}) new_fun = {u: r for u, r in fun.items() if norm(r) != norm(rk)} ranks_db.set(chat, "f", new_fun) await update.message.reply_text(f"✧︙تم مسح قائمة {title} ✅") return h for _pl_cmd, (_rk, _title) in FUN_PLURALS.items(): exact(_pl_cmd)(_mk_fun_list(_rk, _title)) exact("مسح " + _pl_cmd)(_mk_fun_clear(_rk, _title)) @exact("رتب التسليه") async def fun_ranks_all(update, ctx, arg=""): fun = ranks_db.get(update.effective_chat.id, "f", {}) if not fun: await update.message.reply_text("✧︙لا توجد رتب تسلية مسجلة حالياً.") return lines = ["🎭 رتب التسلية في المجموعه:"] for u, r in list(fun.items())[:30]: lines.append(f"• `{u}` ← {r}") await update.message.reply_text("\n".join(lines), parse_mode="Markdown") @exact("مسح رتب التسليه") async def clear_all_fun_ranks(update, ctx, arg=""): if await R.effective_level(update) < R.level("مدير"): await update.message.reply_text(S["need_rank"]) return ranks_db.set(update.effective_chat.id, "f", {}) await update.message.reply_text("✧︙تم مسح جميع رتب التسلية ✅") @exact("رفع بقلبي", "رفع بكلبي") async def lift_in_heart(update, ctx, arg=""): r = update.message.reply_to_message if not r or not r.from_user: await update.message.reply_text(S["need_reply"]) return d = ranks_db.get(update.effective_chat.id, "f", {}) d[str(r.from_user.id)] = "بكلبي" ranks_db.set(update.effective_chat.id, "f", d) await update.message.reply_text(f"❤️ تم رفع {r.from_user.first_name} بقلبك!") @exact("تنزيل من قلبي", "تنزيل من كلبي") async def drop_from_heart(update, ctx, arg=""): r = update.message.reply_to_message if not r or not r.from_user: await update.message.reply_text(S["need_reply"]) return d = ranks_db.get(update.effective_chat.id, "f", {}) d.pop(str(r.from_user.id), None) ranks_db.set(update.effective_chat.id, "f", d) await update.message.reply_text(f"💔 تم تنزيل {r.from_user.first_name} من قلبك!") # ---------- أوامر التحشيش بالرد ---------- OPINIONS = [ "🔥 شخص فخم وذوقه عالي جداً!", "😂 طيب ودمه خفيف ومنوّر الجروب!", "👑 شخصية هيبة وكل الجروب بيحبه!", "✨ رايق وهادي وملوش في المشاكل!", "⚡ مجنون شوية بس عسل الصراحة!", ] @exact("شنو رايك بهذا", "شنو رايك بهاي", "رايك فيه", "رايك فيها") async def opinion_cmd(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else update.effective_user await update.message.reply_text(f"💬 رأيي في {t.first_name}: {random.choice(OPINIONS)}") @exact("انطي هديه", "اهديه") async def ahdiya(update, ctx, arg=""): if not _fun_ok(update): await update.message.reply_text(S["feature_off"]) return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None l = content.lines("ahdiya.txt") gift = random.choice(l) if l else "وردة 🌹" to = f" إلى {_name(t)}" if t else "" await update.message.reply_text(f"🎁 {update.effective_user.first_name} أهدى{to}: {gift}") @prefix("بوس", "بوسه") async def boss_p(update, ctx, arg): if _fun_ok(update): await update.message.reply_text(f"😘 {update.effective_user.first_name} بعت بوسة لـ {arg} 💋") @exact("بوس", "بوسه", "بوسني") async def boss_e(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else update.effective_user await update.message.reply_text(f"😘 {update.effective_user.first_name} بعت بوسة لـ {t.first_name} 💋") @exact("حضن") async def hug(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return await update.message.reply_text(f"🫂 {update.effective_user.first_name} حضن {t.first_name} بقوة ❤️") @exact("كف", "صفع") async def slap(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return await update.message.reply_text(f"👋 {update.effective_user.first_name} ادّى {t.first_name} كف طيّر نضارته 😂") @exact("صيحه") async def call_out(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return await update.message.reply_text(f"📢 يا {t.first_name}!! {update.effective_user.first_name} بينادي عليك تعال بسرعة!") @exact("رزله") async def roast_light(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return await update.message.reply_text(f"😂 يا {t.first_name} اهدى شوية وخليك عاقل عشان محدش يزعلك!") @prefix("قول", "قل", "كول") async def say_cmd(update, ctx, arg): if _fun_ok(update) and arg: await update.message.reply_text(arg) # ---------- زوجني / تتزوجني / ثنائي اليوم / اسمي / معرفي / تفاعلي / نبذه / نداء / نزلني ---------- @exact("زوجني", "تتزوجني") async def marry_random(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "marryme"): await update.message.reply_text(S["feature_off"]) return u_map = users_db.get(update.effective_chat.id, "u", {}) others = [v for k, v in u_map.items() if int(k) != update.effective_user.id] if not others: await update.message.reply_text("💍 مفيش أعضاء متفاعلين كفاية نختارلك منهم حالياً 😅") return pick = random.choice(others) await update.message.reply_text(f"💍 مبروك! تم اختيار {pick.get('first') or pick.get('name')} شريك حياتك اليوم 😂❤️") @exact("ثنائي اليوم") async def couple_today(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "couple"): await update.message.reply_text(S["feature_off"]) return u_map = list(users_db.get(update.effective_chat.id, "u", {}).values()) if len(u_map) < 2: await update.message.reply_text("💑 محتاجين عضوين متفاعلين على الأقل!") return a, b = random.sample(u_map, 2) pct = random.randint(65, 100) await update.message.reply_text(f"💑 ثنائي اليوم في المجموعه:\n❤️ {a.get('first')} + {b.get('first')}\n💘 نسبة الانسجام: {pct}%") @exact("اسمي") async def my_name(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "myname"): return await update.message.reply_text(f"✧︙اسمك: {update.effective_user.full_name}") @exact("معرفي") async def my_user(update, ctx, arg=""): u = update.effective_user await update.message.reply_text(f"✧︙معرفك: @{u.username}" if u.username else "✧︙ليس لديك معرف (username).") @exact("تفاعلي") async def my_act(update, ctx, arg=""): n = get_counter(update.effective_chat.id, update.effective_user.id, "msgs") await update.message.reply_text(f"🔥 تفاعلك: {activity_label(n)} ({n} رسالة)") @exact("تفاعله") async def his_act_e(update, ctx, arg=""): await his_act_p(update, ctx, "") @prefix("تفاعله") async def his_act_p(update, ctx, arg): r = update.message.reply_to_message if r and r.from_user: uid, nm = r.from_user.id, r.from_user.first_name else: info = find_user_by_username(update.effective_chat.id, arg) if not info: await update.message.reply_text(S["need_reply"]) return uid, nm = info["id"], info.get("first") or info.get("name") n = get_counter(update.effective_chat.id, uid, "msgs") await update.message.reply_text(f"🔥 تفاعل {nm}: {activity_label(n)} ({n} رسالة)") @exact("جهاتي") async def my_invites(update, ctx, arg=""): n = get_counter(update.effective_chat.id, update.effective_user.id, "invites") await update.message.reply_text(f"👥 عدد الأعضاء الذين أضفتهم: {n}") @exact("جهاته") async def his_invites(update, ctx, arg=""): r = update.message.reply_to_message if not r or not r.from_user: await update.message.reply_text(S["need_reply"]) return n = get_counter(update.effective_chat.id, r.from_user.id, "invites") await update.message.reply_text(f"👥 عدد إضافات {r.from_user.first_name}: {n}") @exact("نبذه", "نبذة") async def about_me(update, ctx, arg=""): u = update.effective_user chat = update.effective_chat.id msgs = get_counter(chat, u.id, "msgs") pts = get_counter(chat, u.id, "pts") await update.message.reply_text( f"📋 نبذة عن {u.first_name}:\n" f"✧︙الرتبة: {R.get_custom_rank_label(chat, u.id)}\n" f"✧︙الرسائل: {msgs} | النقاط: {pts}\n" f"✧︙التفاعل: {activity_label(msgs)}" ) @exact("انا مين", "مين انا") async def who_am_i(update, ctx, arg=""): await about_me(update, ctx, arg) @exact("موقعي") async def my_pos(update, ctx, arg=""): d = stats.get(update.effective_chat.id, "msgs", {}) if not d: await update.message.reply_text(S["top_empty"]) return ordered = sorted(d.items(), key=lambda x: -x[1]) uid = str(update.effective_user.id) for idx, (k, v) in enumerate(ordered, 1): if k == uid: await update.message.reply_text(f"📍 موقعك في المتفاعلين: المركز #{idx} من {len(ordered)} ({v} رسالة) 🔥") return await update.message.reply_text("📍 لم تُسجّل لك رسائل بعد.") @exact("نداء") async def nida_cmd(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "mention"): await update.message.reply_text(S["feature_off"]) return u_map = list(users_db.get(update.effective_chat.id, "u", {}).values()) if not u_map: await update.message.reply_text("📢 لا يوجد أعضاء مسجلون حالياً.") return pick = random.choice(u_map) uname = ("@" + pick["user"]) if pick.get("user") else pick.get("first", "عضو") await update.message.reply_text(f"📢 نداء عشوائي إلى: {uname} — تعال شاركنا في الدردشة! ✨") @exact("نزلني") async def demote_me(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "demoteme"): await update.message.reply_text(S["feature_off"]) return R.set_rank(update.effective_chat.id, update.effective_user.id, "عضو") await update.message.reply_text("✧︙تم تنزيل رتبتك في البوت إلى (عضو) ✅") @exact("الوقت") async def time_alias(update, ctx, arg=""): await update.message.reply_text("🕒 الوقت الآن: " + datetime.now().strftime("%I:%M %p")) @exact("رابط الحذف", "اريد رابط الحذف", "اريد رابط حذف", "رابط حذف") async def del_acc_link(update, ctx, arg=""): await update.message.reply_text("⚠️ رابط حذف حساب تليجرام الرسمي:\nhttps://my.telegram.org/auth?to=delete") @exact("افتاره", "صورته") async def his_avatar(update, ctx, arg=""): r = update.message.reply_to_message if not r or not r.from_user: await update.message.reply_text(S["need_reply"]) return ph = await ctx.bot.get_user_profile_photos(r.from_user.id, limit=1) if ph.total_count: await update.message.reply_photo(ph.photos[0][-1].file_id) else: await update.message.reply_text("✧︙لا توجد صورة بروفايل.") @exact("لقبه") async def his_title(update, ctx, arg=""): r = update.message.reply_to_message if not r or not r.from_user: await update.message.reply_text(S["need_reply"]) return fun = ranks_db.get(update.effective_chat.id, "f", {}).get(str(r.from_user.id)) await update.message.reply_text(f"✧︙لقب {r.from_user.first_name}: {fun or 'لا يوجد لقب'}") # ---------- البوت السحري + معنى اسم + العمر + قوقل + قصص/ثريد/مقالات ---------- MAGIC_ANS = [ "🔮 أكيد طبعاً وبنسبة 100% ✅", "🔮 كل المؤشرات بتقول أيوه ✨", "🔮 غالباً أيوه، توكل على الله 👍", "🔮 اسألني تاني بعد شوية ⏳", "🔮 مش واضح دلوقتي، استنى وشوف 🤔", "🔮 مظنش الصراحة 😅", "🔮 لأ خالص، شوف غيرها ❌", "🔮 ممكن جداً لو اجتهدت 💪", ] @prefix("البوت السحري") async def magic_p(update, ctx, arg): if _fun_ok(update): await update.message.reply_text(random.choice(MAGIC_ANS)) @exact("البوت السحري") async def magic_e(update, ctx, arg=""): if _fun_ok(update): await update.message.reply_text("🔮 اسألني سؤال! مثال: البوت السحري هنجح السنة دي؟") @prefix("معنى", "معني") async def name_meaning(update, ctx, arg): q = norm(arg.strip()) if not q: await update.message.reply_text("✧︙اكتب: معنى + الاسم") return for line in content.lines("meanings.txt"): if ":" in line: k, v = line.split(":", 1) if norm(k.strip()) == q: await update.message.reply_text(f"✨ معنى اسم ({k.strip()}):\n{v.strip()}") return await update.message.reply_text(f"✧︙الاسم ({arg.strip()}) غير مسجل في القاموس حالياً.") @prefix("العمر", "عمري") async def calc_age(update, ctx, arg): try: val = int(arg.strip()) except Exception: await update.message.reply_text("✧︙اكتب سنة ميلادك أو عمرك، مثال: العمر 2002") return now_year = datetime.now().year if 1920 <= val <= now_year: age, birth = now_year - val, val elif 1 <= val <= 110: age, birth = val, now_year - val else: await update.message.reply_text("✧︙اكتب سنة ميلاد صحيحة.") return await update.message.reply_text(f"🎂 سنة الميلاد: {birth}\n✧︙العمر: {age} سنة (~{age*12:,} شهر / ~{age*365:,} يوم)") @prefix("قوقل", "جوجل") async def google_link(update, ctx, arg): if not arg.strip(): return url = f"https://www.google.com/search?q={quote_plus(arg.strip())}" kb = InlineKeyboardMarkup([[InlineKeyboardButton(f"🔍 بحث: {arg.strip()[:30]}", url=url)]]) await update.message.reply_text(f"🌐 رابط البحث في جوجل:", reply_markup=kb) @exact("شرايك في افتاري", "رايك في افتاري") async def rate_avatar(update, ctx, arg=""): if _fun_ok(update): await update.message.reply_text(random.choice(["🔥 أفتارك فخم 10/10!", "😍 ذوقك عالي 9/10!", "👑 هيبة وفخامة 10/10!", "🌟 أطلق صورة في الجروب!"])) @exact("شبيهي", "شبيهتي") async def shabih(update, ctx, arg=""): if _fun_ok(update): l = content.lines("shabih.txt") await update.message.reply_text(f"شبيهك: {random.choice(l)}" if l else S["no_content"]) @exact("توافق") async def tawafuq(update, ctx, arg=""): if not _fun_ok(update): return t = update.message.reply_to_message.from_user if update.message.reply_to_message else None if not t: await update.message.reply_text(S["need_reply"]) return a = update.effective_user pct = int(hashlib.md5(f"tawafuq{min(a.id, t.id)}{max(a.id, t.id)}".encode()).hexdigest(), 16) % 101 await update.message.reply_text(S["tawafuq"].format(a=a.first_name, b=t.first_name, pct=pct)) @exact("عقوبه", "عقوبة") async def oqoba(update, ctx, arg=""): if _fun_ok(update): t = update.message.reply_to_message.from_user if update.message.reply_to_message else update.effective_user l = content.lines("oqobat.txt") await update.message.reply_text(S["oqoba"].format(name=t.first_name, o=random.choice(l)) if l else S["no_content"]) @exact("بايوات", "بايو عشوائي") async def bios(update, ctx, arg=""): l = content.lines("bios.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("نكته", "نكتة") async def joke(update, ctx, arg=""): l = content.lines("jokes.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("حكمه", "حكمة") async def wisdom(update, ctx, arg=""): l = content.lines("hekma.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("دعاء", "ادعيه") async def dua(update, ctx, arg=""): l = content.lines("adiya.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("اذكار") async def azkar(update, ctx, arg=""): l = content.lines("azkar.txt") await update.message.reply_text(random.choice(l) if l else S["azkar_none"]) @exact("شعر", "قصائد", "اقتباسات") async def poems(update, ctx, arg=""): l = content.lines("quotes.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("قصص", "ثريد", "كتب") async def stories(update, ctx, arg=""): l = content.lines("stories.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("مقالات") async def maqalat(update, ctx, arg=""): l = content.lines("maqalat.txt") await update.message.reply_text(random.choice(l) if l else S["no_content"]) @exact("غنيلي", "اطربني", "اغاني", "اغنيه") async def ghanili(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "ghanili"): await update.message.reply_text(S["feature_off"]) return l = content.lines("ghanili.txt") await update.message.reply_text("🎶 " + random.choice(l) if l else S["no_content"]) # ---------- الأبراج ---------- BRAJ = ["الحمل", "الثور", "الجوزاء", "السرطان", "الأسد", "العذراء", "الميزان", "العقرب", "القوس", "الجدي", "الدلو", "الحوت"] @exact("ابراج", "الابراج") async def abraj(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "abraj"): await update.message.reply_text(S["feature_off"]) return rows = [[InlineKeyboardButton(b, callback_data=f"brj:{i}", style="primary") for i, b in enumerate(BRAJ[r:r + 3], r)] for r in range(0, 12, 3)] await update.message.reply_text("✧︙اختار برجك:", reply_markup=InlineKeyboardMarkup(rows)) # دعم كتابة اسم البرج مباشرة (مثل: الحمل، الأسد، العقرب...) for _bi, _bname in enumerate(BRAJ): def _mk_brj(idx, nm): async def _h(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "abraj"): return lines = content.lines("abraj.txt") txt = lines[idx] if idx < len(lines) else "يومك حلو إن شاء الله ✨" await update.message.reply_text(f"♈︙برج {nm}:\n{txt}") return _h exact(_bname, "برج " + _bname)(_mk_brj(_bi, _bname)) async def brj_cb(update, ctx): q = update.callback_query await q.answer() i = int(q.data.split(":")[1]) lines = content.lines("abraj.txt") text = lines[i] if i < len(lines) else "يومك حلو إن شاء الله ✨" await q.edit_message_text(f"♈︙ برج {BRAJ[i]}:\n{text}") @exact("حظر محدود") async def fakeban(update, ctx, arg=""): if not tg_on(update.effective_chat.id, "fakeban"): await update.message.reply_text(S["feature_off"]) return t = update.message.reply_to_message.from_user if update.message.reply_to_message else update.effective_user await update.message.reply_text(S["fakeban"].format(name=_name(t))) # ---------- زخرفة + ترجمة ---------- DECOR = {"ا": "آ", "ب": "بـ", "ت": "تـ", "ن": "نـ", "ي": "يـ", "م": "مـ", "ك": "كـ", "ل": "لـ", "س": "سـ", "ع": "عـ"} def _zhrf_styles(t): spaced = " ".join(t) return [ "".join(DECOR.get(c, c) for c in t), "༺ " + t + " ༻", "『 " + spaced + " 』", "۝ " + t + " ۝", "⌁ " + t + " ⌁", "ـ".join(t), "⋆ " + spaced + " ⋆", "✧︙" + t + "︙✧", "⌁〔 " + t + " 〕⌁", "◈ " + " ◈ ".join(t.split()) + " ◈", "⟬ " + t + " ⟭", "•°• " + spaced + " •°•", "⪼ " + t + " ⪻", "✦。 " + t + " 。✦", "╰─ " + t + " ─╯", "꧁ " + t + " ꧂", ] @prefix("زخرف", "زخرفه") async def zakhraf(update, ctx, arg): if not arg: await update.message.reply_text(S["zakhraf_usage"]) return await update.message.reply_text("\n\n".join(f"{i+1}- {s}" for i, s in enumerate(_zhrf_styles(arg)))) async def _do_translate(update, text, target=None): if not text: await update.message.reply_text("✧︙اكتب النص بعد أمر الترجمة أو رد على رسالة.") return try: from deep_translator import GoogleTranslator if not target: ar = any("؀" <= c <= "ۿ" for c in text) target = "en" if ar else "ar" out = GoogleTranslator(source="auto", target=target).translate(text) await update.message.reply_text(out) except Exception: await update.message.reply_text("✧︙تعذّرت الترجمة حالياً.") @prefix("ترجم عربي") async def tr_ar(update, ctx, arg): await _do_translate(update, arg or (update.message.reply_to_message.text if update.message.reply_to_message else ""), "ar") @prefix("ترجم انقليزي", "ترجم انجليزي") async def tr_en(update, ctx, arg): await _do_translate(update, arg or (update.message.reply_to_message.text if update.message.reply_to_message else ""), "en") @prefix("ترجم") async def translate(update, ctx, arg): await _do_translate(update, arg or (update.message.reply_to_message.text if update.message.reply_to_message else ""), None) # ---------- زواج ---------- @exact("زواج") async def marry(update, ctx, arg=""): if not _fun_ok(update): return chat, r, a = update.effective_chat.id, update.message.reply_to_message, update.effective_user mar = settings.get(chat, "marry", {}) if not r or r.from_user.id == a.id or str(a.id) in mar or str(r.from_user.id) in mar: await update.message.reply_text(S["marry_no"]) return b = r.from_user mar[str(a.id)] = {"p": b.id, "n": b.first_name} mar[str(b.id)] = {"p": a.id, "n": a.first_name} settings.set(chat, "marry", mar) await update.message.reply_text(S["marry_ok"].format(a=a.first_name, b=b.first_name)) @exact("طلاق") async def divorce(update, ctx, arg=""): chat, a = update.effective_chat.id, update.effective_user mar = settings.get(chat, "marry", {}) me = mar.pop(str(a.id), None) if not me: await update.message.reply_text(S["no_partner"]) return mar.pop(str(me["p"]), None) settings.set(chat, "marry", mar) await update.message.reply_text(S["divorce_ok"].format(a=a.first_name, b=me["n"])) @exact("زوجي", "زوجتي") async def partner(update, ctx, arg=""): me = settings.get(update.effective_chat.id, "marry", {}).get(str(update.effective_user.id)) await update.message.reply_text(S["partner_is"].format(role="شريكك", name=me["n"]) if me else S["no_partner"]) HANDLERS = [CallbackQueryHandler(brj_cb, pattern=r"^brj:")]