File size: 1,427 Bytes
14c1acb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from __future__ import annotations
from dataclasses import dataclass

@dataclass(frozen=True)
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
    )