Download core/kb.py from ABO3MR/df: direct link, hf CLI and curl.
- Browser
- Download file 897 Bytes
-
https://huggingface.co/spaces/ABO3MR/df/resolve/main/core/kb.py
- Command line
-
hf download hf://spaces/ABO3MR/df/core/kb.py
-
curl -L -o kb.py https://huggingface.co/spaces/ABO3MR/df/resolve/main/core/kb.py
897 Bytes
| """أزرار ملونة: تليجرام (من Bot API 9.4) بيدعم 3 ألوان للأزرار: | |
| primary (أزرق) / success (أخضر) / danger (أحمر). بتشتغل على النسخ الحديثة من التطبيق، | |
| والنسخ الأقدم بتعرض الأزرار عادية من غير لون (ومفيش أي مشكلة).""" | |
| from telegram import InlineKeyboardButton | |
| def btn(text, callback_data=None, url=None, style=None): | |
| kw = {} | |
| if callback_data is not None: | |
| kw["callback_data"] = callback_data | |
| if url is not None: | |
| kw["url"] = url | |
| if style: | |
| kw["style"] = style | |
| return InlineKeyboardButton(text, **kw) | |
| def rows(*pairs): | |
| """بتاخد tuples (زر, حجم_الصف...) — الأبسط: كل عنصر قائمة أزرار = صف.""" | |
| from telegram import InlineKeyboardMarkup | |
| return InlineKeyboardMarkup(list(pairs)) | |