@command(pattern='^.approve ?(.*)')
async def approve_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 (not pmpermit_sql.is_approved(chat.id)):
            if (chat.id in PM_WARNS):
                del PM_WARNS[chat.id]
            if (chat.id in PREV_REPLY_MESSAGE):
                (await PREV_REPLY_MESSAGE[chat.id].delete())
                del PREV_REPLY_MESSAGE[chat.id]
            pmpermit_sql.approve(chat.id, reason)
            (await event.edit('Approved Nibba [{}](tg://user?id={})'.format(firstname, chat.id)))
            (await asyncio.sleep(3))
            (await event.delete())
@command(pattern='^.approve ?(.*)')
async def approve_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 (not pmpermit_sql.is_approved(chat.id)):
            if (chat.id in PM_WARNS):
                del PM_WARNS[chat.id]
            if (chat.id in PREV_REPLY_MESSAGE):
                (await PREV_REPLY_MESSAGE[chat.id].delete())
                del PREV_REPLY_MESSAGE[chat.id]
            pmpermit_sql.approve(chat.id, reason)
            (await event.edit('Approved Nibba [{}](tg://user?id={})'.format(firstname, chat.id)))
            (await asyncio.sleep(3))
            (await event.delete())