AI Update: انجام بده و همیشه این اصل رو در پروژه حفظ کن
This commit is contained in:
+32
-32
@@ -45,17 +45,17 @@ def clamp_for_telegram(text: str, has_media: bool) -> str:
|
||||
|
||||
def get_persian_main_menu(is_paused: bool = False):
|
||||
return [
|
||||
[Button.text("📋 مدیریت محتوا (Copy)", resize=True), Button.text("🧠 هوش مصنوعی (AI)", resize=True)],
|
||||
[Button.text("🤖 کانالها و وب (Bots)", resize=True), Button.text("📊 مانیتورینگ (Monitor)", resize=True)],
|
||||
[Button.text("⚙️ مدیریت سیستم (System)", resize=True)]
|
||||
[Button.text("📋 مدیریت محتوا", resize=True), Button.text("🧠 هوش مصنوعی", resize=True)],
|
||||
[Button.text("🤖 کانالها و منابع", resize=True), Button.text("📊 مانیتورینگ", resize=True)],
|
||||
[Button.text("⚙️ تنظیمات و سیستم", resize=True)]
|
||||
]
|
||||
|
||||
|
||||
def get_persian_inline_hub_menu():
|
||||
return [
|
||||
[Button.inline("📋 مدیریت محتوا (Copy)", data="hub_copy"), Button.inline("🧠 هوش مصنوعی (AI)", data="ai_menu")],
|
||||
[Button.inline("🤖 کانالها و وب (Bots)", data="hub_bots"), Button.inline("📊 مانیتورینگ (Monitor)", data="hub_monitor")],
|
||||
[Button.inline("⚙️ مدیریت سیستم (System)", data="hub_system")]
|
||||
[Button.inline("📋 مدیریت محتوا", data="hub_copy"), Button.inline("🧠 هوش مصنوعی", data="ai_menu")],
|
||||
[Button.inline("🤖 کانالها و منابع", data="hub_bots"), Button.inline("📊 مانیتورینگ", data="hub_monitor")],
|
||||
[Button.inline("⚙️ تنظیمات و سیستم", data="hub_system")]
|
||||
]
|
||||
|
||||
|
||||
@@ -421,17 +421,17 @@ class AdminBotService:
|
||||
|
||||
buttons = [
|
||||
[
|
||||
Button.inline("🔌 لیست و تغییر سرویسدهندهها", data="ai_prov_list"),
|
||||
Button.inline("➕ ثبت سرویسدهنده جدید", data="ai_add_prov"),
|
||||
Button.inline("🔌 لیست سرویسدهندهها", data="ai_prov_list"),
|
||||
Button.inline("➕ ثبت سرویسدهنده", data="ai_add_prov"),
|
||||
],
|
||||
[
|
||||
Button.inline(f"🔍 بررسی مجدد ({'فعال' if double_check.lower() in ('true', '1', 'yes') else 'غیرفعال'})", data="ai_toggle_dc"),
|
||||
Button.inline("🧪 تست سریع اتصال AI", data="ai_test"),
|
||||
Button.inline("🧪 تست اتصال AI", data="ai_test"),
|
||||
],
|
||||
[
|
||||
Button.inline("📜 مشاهده ۱۰ لاگ اخیر AI", data="ai_logs:10")
|
||||
Button.inline("📜 ۱۰ لاگ اخیر AI", data="ai_logs:10")
|
||||
],
|
||||
[Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")]
|
||||
[Button.inline("🔙 منوی اصلی", data="back_to_main")]
|
||||
]
|
||||
return text, buttons
|
||||
|
||||
@@ -1051,8 +1051,8 @@ class AdminBotService:
|
||||
"شما میتوانید هر وبسایت، خبرگزاری یا وبلاگی را به عنوان مبدا ثبت کنید تا هوش مصنوعی بهطور خودکار ساختار آن را تحلیل و محتوای جدید را استخراج کند."
|
||||
)
|
||||
buttons = [
|
||||
[Button.inline("➕ افزودن وبسایت مبدا جدید", data="add_web")],
|
||||
[Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")]
|
||||
[Button.inline("➕ افزودن وبسایت", data="add_web")],
|
||||
[Button.inline("🔙 منوی اصلی", data="back_to_main")]
|
||||
]
|
||||
return text, buttons
|
||||
|
||||
@@ -1061,8 +1061,8 @@ class AdminBotService:
|
||||
for s in sites:
|
||||
status_icon = "🔴" if s.last_error else "🟢"
|
||||
buttons.append([Button.inline(f"{status_icon} {s.name} ({s.check_interval_min}m)", data=f"web_view:{s.id}")])
|
||||
buttons.append([Button.inline("➕ افزودن وبسایت مبدا جدید", data="add_web")])
|
||||
buttons.append([Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")])
|
||||
buttons.append([Button.inline("➕ افزودن وبسایت", data="add_web")])
|
||||
buttons.append([Button.inline("🔙 منوی اصلی", data="back_to_main")])
|
||||
return text, buttons
|
||||
|
||||
async def _render_website_config(self, site_id: int) -> Tuple[str, List[List[Button]]]:
|
||||
@@ -1181,15 +1181,15 @@ class AdminBotService:
|
||||
)
|
||||
buttons = [
|
||||
[
|
||||
Button.inline(f"📨 ارسال پستهای بررسینشده ({len(unreviewed)})", data="hub_pending"),
|
||||
Button.inline(f"📬 وضعیت صفهای انتشار ({total_queued})", data="hub_queues")
|
||||
Button.inline(f"📨 بررسینشده ({len(unreviewed)})", data="hub_pending"),
|
||||
Button.inline(f"📬 صف انتشار ({total_queued})", data="hub_queues")
|
||||
],
|
||||
[
|
||||
Button.inline("📂 دستهبندی موضوعی کانالها", data="hub_cats"),
|
||||
Button.inline("🗑 پاکسازی پیامهای کانالهای ادمین", data="purge_adm_menu")
|
||||
Button.inline("📂 دستهبندیها", data="hub_cats"),
|
||||
Button.inline("🗑 پاکسازی پیامها", data="purge_adm_menu")
|
||||
],
|
||||
[
|
||||
Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")
|
||||
Button.inline("🔙 منوی اصلی", data="back_to_main")
|
||||
]
|
||||
]
|
||||
return text, buttons
|
||||
@@ -1209,24 +1209,24 @@ class AdminBotService:
|
||||
)
|
||||
buttons = [
|
||||
[
|
||||
Button.inline(f"📡 کانالهای مبدا ({len(sources)})", data="list_src"),
|
||||
Button.inline(f"📡 مبداها ({len(sources)})", data="list_src"),
|
||||
Button.inline("➕ افزودن مبدا", data="hub_add_src")
|
||||
],
|
||||
[
|
||||
Button.inline(f"🎯 کانالهای مقصد ({len(targets)})", data="list_trg"),
|
||||
Button.inline(f"🎯 مقصدها ({len(targets)})", data="list_trg"),
|
||||
Button.inline("➕ افزودن مقصد", data="hub_add_trg")
|
||||
],
|
||||
[
|
||||
Button.inline(f"🌐 وبسایتهای مبدا ({len(websites)})", data="list_web"),
|
||||
Button.inline(f"🌐 وبسایتها ({len(websites)})", data="list_web"),
|
||||
Button.inline("➕ افزودن وبسایت", data="add_web")
|
||||
],
|
||||
[
|
||||
Button.inline("📋 کانالهای نظارت ادمین", data="list_adm_channels"),
|
||||
Button.inline("📂 مدیریت دستهبندیها", data="list_cat")
|
||||
Button.inline("📋 نظارت ادمین", data="list_adm_channels"),
|
||||
Button.inline("📂 دستهبندیها", data="list_cat")
|
||||
],
|
||||
[
|
||||
Button.inline("🔑 احراز هویت یوزربات", data="hub_req_code"),
|
||||
Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")
|
||||
Button.inline("🔑 لاگین یوزربات", data="hub_req_code"),
|
||||
Button.inline("🔙 منوی اصلی", data="back_to_main")
|
||||
]
|
||||
]
|
||||
return text, buttons
|
||||
@@ -1234,7 +1234,7 @@ class AdminBotService:
|
||||
async def _render_system_hub(self) -> Tuple[str, List[List[Button]]]:
|
||||
is_paused = await self.repo.is_system_paused()
|
||||
st_icon = "🛑 متوقف (Paused)" if is_paused else "🟢 فعال و در حال کار (Running)"
|
||||
pause_btn_text = "▶️ راهاندازی و ادامه سیستم" if is_paused else "🛑 توقف اضطراری سیستم"
|
||||
pause_btn_text = "▶️ راهاندازی سیستم" if is_paused else "🛑 توقف سیستم"
|
||||
pause_cb = "sys_resume" if is_paused else "sys_pause"
|
||||
text = (
|
||||
f"⚙️ <b>بخش کنترل و مدیریت سیستم (System Hub):</b>\n\n"
|
||||
@@ -1246,10 +1246,10 @@ class AdminBotService:
|
||||
[Button.inline(pause_btn_text, data=pause_cb)],
|
||||
[
|
||||
Button.inline("📝 گزارش تغییرات", data="sys_changes"),
|
||||
Button.inline("❓ راهنمای سیستم", data="sys_help")
|
||||
Button.inline("❓ راهنما", data="sys_help")
|
||||
],
|
||||
[
|
||||
Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")
|
||||
Button.inline("🔙 منوی اصلی", data="back_to_main")
|
||||
]
|
||||
]
|
||||
return text, buttons
|
||||
@@ -1441,7 +1441,7 @@ class AdminBotService:
|
||||
buttons = [
|
||||
[
|
||||
Button.inline("🔄 بروزرسانی آمار", data="rep_refresh"),
|
||||
Button.inline("⚠️ بررسی خطاهای سیستم", data="hub_errors")
|
||||
Button.inline("⚠️ خطاهای سیستم", data="hub_errors")
|
||||
],
|
||||
[
|
||||
Button.inline("⏱ نمودار ۱۵ دقیقه", data="rep_gr:15m"),
|
||||
@@ -1449,7 +1449,7 @@ class AdminBotService:
|
||||
],
|
||||
[
|
||||
Button.inline("⏱ نمودار ۲۴ ساعت", data="rep_gr:24h"),
|
||||
Button.inline("🔙 بازگشت به منوی اصلی", data="back_to_main")
|
||||
Button.inline("🔙 منوی اصلی", data="back_to_main")
|
||||
]
|
||||
]
|
||||
return rep, buttons
|
||||
|
||||
Reference in New Issue
Block a user