Spaces:
Running
Running
Download core/sections/controls.py from Alialdlfy1/Teleautoadminbot: direct link, hf CLI and curl.
- Browser
- Download file 1.43 kB
-
https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/sections/controls.py
- Command line
-
hf download hf://spaces/Alialdlfy1/Teleautoadminbot/core/sections/controls.py
-
curl -L -o controls.py https://huggingface.co/spaces/Alialdlfy1/Teleautoadminbot/resolve/main/core/sections/controls.py
1.43 kB
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| class SectionButton: | |
| key: str | |
| label: str | |
| callback: str | |
| COMMON_SECTION_BUTTONS = ( | |
| SectionButton("settings", "⚙️ الإعدادات", "{section}:settings"), | |
| SectionButton("sources", "📡 المصادر", "{section}:sources"), | |
| SectionButton("blocked", "🚫 الكلمات المحظورة", "{section}:blocked"), | |
| SectionButton("duplicates", "♻️ منع التكرار", "{section}:duplicates"), | |
| SectionButton("ai", "🤖 إعدادات الذكاء الاصطناعي", "{section}:ai"), | |
| SectionButton("queue", "📋 الطابور", "{section}:queue"), | |
| SectionButton("metrics", "📈 الإحصائيات", "{section}:metrics"), | |
| SectionButton("health", "🩺 الصحة", "{section}:health"), | |
| SectionButton("dead", "☠️ المهام الفاشلة", "{section}:dead"), | |
| SectionButton("status", "📊 الحالة", "{section}:status"), | |
| SectionButton("enable", "▶️ تشغيل القسم", "{section}:enable"), | |
| SectionButton("disable", "⛔ إيقاف القسم", "{section}:disable"), | |
| SectionButton("repair", "🛠️ الإصلاح التلقائي", "{section}:repair"), | |
| ) | |
| def build_section_buttons(section: str): | |
| return tuple( | |
| SectionButton(x.key, x.label, x.callback.format(section=section)) | |
| for x in COMMON_SECTION_BUTTONS | |
| ) | |