Instructions to use nvidia/Cosmos3-Edge-Policy-DROID with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Cosmos
How to use nvidia/Cosmos3-Edge-Policy-DROID with Cosmos:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Create Bthoon
#13
by HafedhQaid - opened
Bthoon
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import re
|
| 2 |
+
from telethon import TelegramClient, events
|
| 3 |
+
|
| 4 |
+
# --- بياناتك التقنية ---
|
| 5 |
+
api_id = 37844073
|
| 6 |
+
api_hash = '9d6fa709fe5ffdb4ed46dc6b0b95803a'
|
| 7 |
+
|
| 8 |
+
# --- إعدادات المجموعات ---
|
| 9 |
+
# 1. المجموعات التي تريد النقل منها (ضع أسماءها أو أرقامها هنا)
|
| 10 |
+
# مثال: ['Group1', 'Group2'] أو [-100123, -100456]
|
| 11 |
+
source_groups = ['اسم_المجموعة_التي_تريد_مراقبتها']
|
| 12 |
+
|
| 13 |
+
# 2. مجموعتك أنت (التي سيصل إليها النقل)
|
| 14 |
+
destination_group = 'Hafedh7818870'
|
| 15 |
+
|
| 16 |
+
# --- الكلمات المفتاحية ---
|
| 17 |
+
keywords = ['ابى', 'واجب', 'بحث', 'اختبار', 'مساعده', 'مساعدة', 'حل']
|
| 18 |
+
|
| 19 |
+
def normalize_arabic(text):
|
| 20 |
+
"""لضمان العثور على الكلمات مهما كانت طريقة كتابتها"""
|
| 21 |
+
if not text: return ""
|
| 22 |
+
text = re.sub("[إأآا]", "ا", text)
|
| 23 |
+
text = re.sub("ة", "ه", text)
|
| 24 |
+
return text.lower()
|
| 25 |
+
|
| 26 |
+
client = TelegramClient('hafidh_session', api_id, api_hash)
|
| 27 |
+
|
| 28 |
+
@client.on(events.NewMessage(chats=source_groups))
|
| 29 |
+
async def handler(event):
|
| 30 |
+
try:
|
| 31 |
+
if event.message.text:
|
| 32 |
+
text = normalize_arabic(event.message.text)
|
| 33 |
+
|
| 34 |
+
# فحص الكلمات المفتاحية
|
| 35 |
+
if any(normalize_arabic(k) in text for k in keywords):
|
| 36 |
+
chat = await event.get_chat()
|
| 37 |
+
title = getattr(chat, 'title', 'مصدر خارجي')
|
| 38 |
+
|
| 39 |
+
# تنسيق الرسالة
|
| 40 |
+
msg = f"🎯 **رسالة مطابقة للبحث!**\n"
|
| 41 |
+
msg += f"📍 **من مجموعة:** {title}\n"
|
| 42 |
+
msg += "--- --- --- --- ---\n\n"
|
| 43 |
+
msg += event.message.text
|
| 44 |
+
|
| 45 |
+
await client.send_message(destination_group, msg)
|
| 46 |
+
print(f"✅ تم نقل رسالة بنجاح إلى مجموعتك {destination_group}")
|
| 47 |
+
|
| 48 |
+
except Exception as e:
|
| 49 |
+
print(f"❌ خطأ بسيط: {e}")
|
| 50 |
+
|
| 51 |
+
print(f"🚀 البوت يعمل الآن ويراقب المجموعات ويرسل إلى {destination_group}...")
|
| 52 |
+
client.start()
|
| 53 |
+
client.run_until_disconnected()
|