async def on_pm_s(client: Bot, message: Message):
    check_ban = check_is_black_list(message)
    if check_ban:
        await message.reply_text(text=IS_BLACK_LIST_ED_MESSAGE_TEXT.format(
            reason=check_ban.reason))
        return

    fwded_mesg = None
    if message.edit_date:
        ym = get_chek_dmid(message.message_id)
        reply_to_message_id = None
        if ym:
            reply_to_message_id = ym.message_id
        await message.copy(chat_id=AUTH_CHANNEL,
                           disable_notification=True,
                           reply_to_message_id=reply_to_message_id,
                           reply_markup=message.reply_markup)
    else:
        fwded_mesg = await message.forward(chat_id=AUTH_CHANNEL,
                                           disable_notification=True)

    if not fwded_mesg:
        return

    add_user_to_db(fwded_mesg.message_id, message.from_user.id,
                   message.message_id, 0, 0)
async def on_pm_s(client: Bot, message: Message):
    check_ban = check_is_black_list(message)
    if check_ban:
        await message.reply_text(text=IS_BLACK_LIST_ED_MESSAGE_TEXT.format(
            reason=check_ban.reason))
        return

    fwded_mesg = None
    if message.edit_date:
        ym = get_chek_dmid(message.message_id)
        reply_to_message_id = None
        if ym:
            reply_to_message_id = ym.message_id
        fwded_mesg = await message.copy(
            chat_id=AUTH_CHANNEL,
            disable_notification=True,
            reply_to_message_id=reply_to_message_id,
            reply_markup=message.reply_markup)
    else:
        fwded_mesg = await message.copy(chat_id=AUTH_CHANNEL,
                                        disable_notification=True,
                                        reply_markup=message.reply_markup)

    # just store, we don't need to SPAM users
    # mimick LiveGramBot, not @LimitatiBot ..!
    add_user_to_db(fwded_mesg.message_id, message.from_user.id,
                   message.message_id)
Exemple #3
0
async def on_pm_s(_, message: Message):
    check_ban = check_is_black_list(message)
    if check_ban:
        await message.reply_text(
            text=IS_BLACK_LIST_ED_MESSAGE_TEXT.format(
                reason=check_ban.reason
            )
        )
        return

    fwded_mesg = await message.forward(
        AUTH_CHANNEL
    )
    await _.send_message(
        AUTH_CHANNEL,
        f"From user_id: <code>{message.from_user.id}</code>"
    )
   
    # just store, we don't need to SPAM users
    # mimick LiveGramBot, not @LimitatiBot ..!
    add_user_to_db(
        fwded_mesg.message_id,
        message.from_user.id,
        message.message_id
    )
Exemple #4
0
async def on_pm_s(client: Client, message: Message):
    user_id, reply_message_id = get_user_id(
        message.reply_to_message.message_id)
    if not user_id:
        return
    try:
        s_m_ = await send_message_to_user(client, message, user_id,
                                          reply_message_id)
    except UserIsBlocked:
        await message.reply_text(BOT_WS_BLOCKED_BY_USER)
    else:
        if s_m_:
            add_user_to_db(reply_message_id, user_id, 0, s_m_.message_id,
                           message.message_id)
async def on_pm_s(client: Bot, message: Message):
    check_ban = check_is_black_list(message)
    if check_ban:
        await message.reply_text(
            text=IS_BLACK_LIST_ED_MESSAGE_TEXT.format(
                reason=check_ban.reason
            )
        )
        return
    if SUB_CHANNEL != -100:
      try:
        await client.get_chat_member(SUB_CHANNEL, message.from_user.id)
      except UserNotParticipant:
          chat = await client.get_chat(SUB_CHANNEL)
          username = f" [@{chat.username}] " if chat.username else ""
          return await message.reply_text(f"You Need to Join {chat.title}{username} in order to Use This Bot!.")
    fwded_mesg = None
    if message.edit_date:
        ym = get_chek_dmid(message.message_id)
        reply_to_message_id = None
        if ym:
            reply_to_message_id = ym.message_id
        await message.copy(
            chat_id=AUTH_CHANNEL,
            disable_notification=True,
            reply_to_message_id=reply_to_message_id,
            reply_markup=message.reply_markup
        )
    else:
        fwded_mesg = await message.forward(
            chat_id=AUTH_CHANNEL,
            disable_notification=True
        )

    if not fwded_mesg:
        return

    add_user_to_db(
        fwded_mesg.message_id,
        message.from_user.id,
        message.message_id,
        0,
        0
    )
Exemple #6
0
async def num_start_message(client: Client, message: Message):
    START_OTHER_USERS_TEXT = """⭕ Hello, {}! To get started, Send /mod and the name of the APK that you want MODDED. I will perform a search in moddingunited.xyz for you & give you the results quickly..\n\n⚠️ Make sure you Enter the name of the app correctly with no spelling mistakes 😁\n\n🥰You can also add me to your group and i'll send modded apps there!\nFor more info, type /help!""".format(
        message.from_user.first_name)
    await message.reply_text(START_OTHER_USERS_TEXT, quote=True)
    q = check_user_in_db(message.from_user.id)
    if q == False:
        add_user_to_db(message.from_user.id, message.from_user.first_name,
                       message.from_user.username)
        rows = int(SESSION.query(func.count(Users.chat_id)).scalar()) + 1753
        print(rows)
        await client.send_message(
            chat_id=-499255509,
            text="🆕 New User!\nTotal: {}\nName: {}".format(
                rows, message.from_user.first_name))
        print("🆕 New User!\nTotal: {}\nName: {}\nUsername: {}".format(
            rows, message.from_user.first_name, message.from_user.username))
        SESSION.close()
    else:
        print('User in DB.')
        SESSION.close()
async def on_pm_s(client: Client, message: Message):
    fwded_mesg = await message.forward(AUTH_USERS[0])
    # just store, we don't need to SPAM users
    # mimick LiveGramBot, not @LimitatiBot ..!
    add_user_to_db(fwded_mesg.message_id, message.from_user.id,
                   message.message_id)