@command(pattern='^.block ?(.*)')
async def block_p_m(event):
    if event.fwd_from:
        return
    replied_user = (await event.client(GetFullUserRequest(event.chat_id)))
    firstname = replied_user.user.first_name
    reason = event.pattern_match.group(1)
    chat = (await event.get_chat())
    if event.is_private:
        if pmpermit_sql.is_approved(chat.id):
            pmpermit_sql.disapprove(chat.id)
            (await event.edit("\n Now You Can't Message Me..[{}](tg://user?id={})".format(firstname, chat.id)))
            (await asyncio.sleep(3))
            (await event.client(functions.contacts.BlockRequest(chat.id)))
@command(pattern='^.block ?(.*)')
async def block_p_m(event):
    if event.fwd_from:
        return
    replied_user = (await event.client(GetFullUserRequest(event.chat_id)))
    firstname = replied_user.user.first_name
    reason = event.pattern_match.group(1)
    chat = (await event.get_chat())
    if event.is_private:
        if pmpermit_sql.is_approved(chat.id):
            pmpermit_sql.disapprove(chat.id)
            (await event.edit("\n Now You Can't Message Me..[{}](tg://user?id={})".format(firstname, chat.id)))
            (await asyncio.sleep(3))
            (await event.client(functions.contacts.BlockRequest(chat.id)))