@bot.on(events.NewMessage(incoming=True))
async def on_new_private_message(event):
    if (event.from_id == bot.uid):
        return
    if (Var.PRIVATE_GROUP_ID is None):
        return
    if (not event.is_private):
        return
    message_text = event.message.message
    chat_id = event.from_id
    current_message_text = message_text.lower()
    if (USER_BOT_NO_WARN == message_text):
        return
    if (event.from_id in CACHE):
        sender = CACHE[event.from_id]
    else:
        sender = (await bot.get_entity(event.from_id))
        CACHE[event.from_id] = sender
    if (chat_id == bot.uid):
        return
    if sender.bot:
        return
    if sender.verified:
        return
    if any([(x in event.raw_text) for x in ('/start', '1', '2', '3', '4', '5')]):
        return
    if (not pmpermit_sql.is_approved(chat_id)):
        (await do_pm_permit_action(chat_id, event))
@bot.on(events.NewMessage(incoming=True))
async def on_new_private_message(event):
    if (event.from_id == bot.uid):
        return
    if (Var.PRIVATE_GROUP_ID is None):
        return
    if (not event.is_private):
        return
    message_text = event.message.message
    chat_id = event.from_id
    current_message_text = message_text.lower()
    if (USER_BOT_NO_WARN == message_text):
        return
    if (event.from_id in CACHE):
        sender = CACHE[event.from_id]
    else:
        sender = (await bot.get_entity(event.from_id))
        CACHE[event.from_id] = sender
    if (chat_id == bot.uid):
        return
    if sender.bot:
        return
    if sender.verified:
        return
    if any([(x in event.raw_text) for x in ('/start', '1', '2', '3', '4', '5')]):
        return
    if (not pmpermit_sql.is_approved(chat_id)):
        (await do_pm_permit_action(chat_id, event))