from rubpy import Client, 
filters import json import 
os import asyncio 
OWNER_GUID = 
"GUID_خودت_اینجا" 
WELCOMED_FILE = 
"welcomed_users.json" 
CONFIG_FILE = 
"bot_config.json" 
DEFAULT_WELCOME = """✨ به 
ربات جریان خوش آمدید! ✨ 🌊 
جریان | Jaryane 
━━━━━━━━━━━━━━━━━━━━ 
اینترنت پایدار، بدون دردسر 
━━━━━━━━━━━━━━━━━━━━ ⚡ 
همین حالا شروع کن!""" 
DEFAULT_PHOTO = """📩 رسید 
دریافت شد ✅ بزودی بررسی و 
تأیید میشه 🦋 
@Supports_Jaryane""" if 
os.path.exists(CONFIG_FILE):
    with open(CONFIG_FILE, 
    'r', encoding='utf-8') 
    as f:
        config = 
        json.load(f) 
        WELCOME_TEXT = 
        config.get("welcome", 
        DEFAULT_WELCOME) 
        PHOTO_TEXT = 
        config.get("photo", 
        DEFAULT_PHOTO)
else: WELCOME_TEXT = 
    DEFAULT_WELCOME 
    PHOTO_TEXT = 
    DEFAULT_PHOTO
if 
os.path.exists(WELCOMED_FILE):
    with 
    open(WELCOMED_FILE, 
    'r', encoding='utf-8') 
    as f:
        welcomed_users = 
        set(json.load(f))
else: welcomed_users = 
    set()
def save_welcomed(): with 
    open(WELCOMED_FILE, 
    'w', encoding='utf-8') 
    as f:
        json.dump(list(welcomed_users), 
        f)
def save_config(): config = 
    {"welcome": 
    WELCOME_TEXT, "photo": 
    PHOTO_TEXT} with 
    open(CONFIG_FILE, 'w', 
    encoding='utf-8') as f:
        json.dump(config, 
        f, 
        ensure_ascii=False, 
        indent=4)
waiting_for = None async 
def main():
    global WELCOME_TEXT, 
    PHOTO_TEXT, waiting_for
    
    app = Client("my_bot")
    
    @app.on_message_updates(filters.text, 
    filters.private) async 
    def handler(update):
        global 
        WELCOME_TEXT, 
        PHOTO_TEXT, 
        waiting_for
        
        if update.is_me: 
            return
        
        user = 
        update.author_guid 
        text = update.text 
        or ""
        
        if user == 
        OWNER_GUID:
            if waiting_for 
            == "welcome":
                WELCOME_TEXT 
                = text 
                save_config() 
                waiting_for 
                = None 
                await 
                update.reply("✅ 
                متن 
                خوش‌آمدگویی 
                ذخیره شد!") 
                return
            
            if waiting_for 
            == "photo":
                PHOTO_TEXT 
                = text 
                save_config() 
                waiting_for 
                = None 
                await 
                update.reply("✅ 
                متن پاسخ به 
                عکس ذخیره 
                شد!") 
                return
            
            if text == 
            "/ping":
                await 
                update.reply("🏓 
                پونگ!") 
                return
            
            if text == 
            "/setwelcome":
                waiting_for 
                = "welcome" 
                await 
                update.reply("📝 
                متن جدید 
                بفرست:") 
                return
            
            if text == 
            "/setphoto":
                waiting_for 
                = "photo" 
                await 
                update.reply("📸 
                متن عکس 
                جدید 
                بفرست:") 
                return
            
            if text == 
            "/status":
                await 
                update.reply(f"✅ 
                آنلاین | 👥 
                {len(welcomed_users)} 
                کاربر") 
                return
            
            if text == 
            "/cancel":
                waiting_for 
                = None 
                await 
                update.reply("✅ 
                لغو شد") 
                return
            
            if text == 
            "/clear":
                welcomed_users.clear() 
                save_welcomed() 
                await 
                update.reply("✅ 
                حافظه پاک 
                شد") return
        
        if user not in 
        welcomed_users:
            await 
            update.reply(WELCOME_TEXT) 
            welcomed_users.add(user) 
            save_welcomed() 
            print(f"✅ 
            خوش‌آمد به 
            {user}")
    @app.on_message_updates(filters.photo, 
    filters.private) async 
    def 
    photo_handler(update):
        if update.is_me: 
            return
        await 
        update.reply(PHOTO_TEXT)
    
    a
