from pyrogram import Client
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram.errors import UserIsBlocked, PeerIdInvalid


@Client.on_chat_join_request()
async def accept_request(client, r):

    rm = InlineKeyboardMarkup([[
        InlineKeyboardButton("â�¤ï¸�â€�ğŸ”¥ ğ�–¡ğ�–«ğ�– ğ�–²ğ�–³ğ�–¤ğ�–± ğ�–§ğ�–´ğ�–¡ â�¤ï¸�â€�ğŸ”¥", url=f"https://t.me/blaster_hub"),
        InlineKeyboardButton("âš¡ğ�–´ğ�—‰ğ�–½ğ�–ºğ�—�ğ�–¾ğ�—Œ âš¡", url=f"https://t.me/piroxbots")
    ]])
    
    try:
        await client.send_photo(
            r.from_user.id,
            'https://graph.org/file/5cb80fa6096997b7226b3.jpg',
            f"**ğ�–§ğ�–¾ğ�—…ğ�—…ğ�—ˆ {r.from_user.mention} ğŸ‘», ğ�–¶ğ�–¾ğ�—…ğ�–¼ğ�—ˆğ�—†ğ�–¾ ğ�–³ğ�—ˆ {r.chat.title}\nğ�–¸ğ�—ˆğ�—�ğ�—‹ ğ�–±ğ�–¾ğ�—Šğ�—�ğ�–¾ğ�—Œğ�—� ğ�–§ğ�–ºğ�—Œ ğ�–¡ğ�–¾ğ�–¾ğ�—‡ ğ�– ğ�—‰ğ�—‰ğ�—‹ğ�—ˆğ�—�ğ�–¾ğ�–½...!!!**",
            reply_markup=rm)

    except UserIsBlocked:
        print("User blocked the bot")
    except PeerIdInvalid:
        print("Err")
    except Exception as e:
        print(f"#Error\n{str(e)}")

    await r.approve()
