async def monito_p_m_s(event): global PM_WARNS global PREV_REPLY_MESSAGE sender = await event.get_sender() current_message_text = event.message.message.lower() BAALAJI_TG_USER_BOT = "Hi! I will answer to your message soon. Please wait for my response and don't spam my PM. Thanks" TG_COMPANION_USER_BOT = "Please wait for his response and don't spam his PM." UNIBORG_USER_BOT_WARN_ZERO = "I F*****G TOLD U TO F*****G NOT DO F*****G ANYTHING.😡\n!!!BLOCKAGE ACTIVATED!!!" UNIBORG_USER_BOT_NO_WARN = "Hi! My Master has not yet taken note of you in his OFFICE!\nLet me call him and wait right over here and don't do anything😊.\nDoing anything will result in blockage of chat.👿" if current_message_text == BAALAJI_TG_USER_BOT or current_message_text == TG_COMPANION_USER_BOT or current_message_text == UNIBORG_USER_BOT_NO_WARN or current_message_text == UNIBORG_USER_BOT_WARN_ZERO: # userbot's should not reply to other userbot's # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots return False if Config.NO_P_M_SPAM and not sender.bot: chat = await event.get_chat() if not is_approved(chat.id) and chat.id != borg.uid: logger.info(chat.stringify()) logger.info(PM_WARNS) if chat.id not in PM_WARNS: PM_WARNS.update({chat.id: 0}) if PM_WARNS[chat.id] == Config.MAX_FLOOD_IN_P_M_s: r = await event.reply(UNIBORG_USER_BOT_WARN_ZERO) await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id)) if chat.id in PREV_REPLY_MESSAGE: await PREV_REPLY_MESSAGE[chat.id].delete() PREV_REPLY_MESSAGE[chat.id] = r return r = await event.reply(UNIBORG_USER_BOT_NO_WARN) PM_WARNS[chat.id] += 1 if chat.id in PREV_REPLY_MESSAGE: await PREV_REPLY_MESSAGE[chat.id].delete() PREV_REPLY_MESSAGE[chat.id] = r
async def monito_p_m_s(event): sender = await event.get_sender() current_message_text = event.message.message.lower() PREVIOUS_MSG = current_message_text if Config.NO_P_M_SPAM and not sender.bot: chat = await event.get_chat() if not is_approved(chat.id) and chat.id != borg.uid: logger.info(chat.stringify()) logger.info(borg.storage.PM_WARNS) if chat.id in SUDO_USERS: print("Welcome Master.") approve(chat.id, "SUDO USER") return if chat.id not in borg.storage.PM_WARNS: borg.storage.PM_WARNS.update({chat.id: 0}) if borg.storage.PM_WARNS[chat.id] == Config.MAX_FLOOD_IN_P_M_s: r = await event.reply(UNIBORG_USER_BOT_WARN_ZERO) await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id)) if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() borg.storage.PREV_REPLY_MESSAGE[chat.id] = r return if borg.storage.PM_WARNS[chat.id] < 2: r = await event.reply(UNIBORG_USER_BOT_NO_WARN) if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() borg.storage.PREV_REPLY_MESSAGE[chat.id] = r borg.storage.PM_WARNS[chat.id] += 1
async def monito_p_m_s(event): sender = await event.get_sender() current_message_text = event.message.message.lower() if current_message_text == BAALAJI_TG_USER_BOT or \ current_message_text == TG_COMPANION_USER_BOT or \ current_message_text == UNIBORG_USER_BOT_NO_WARN: # userbot's should not reply to other userbot's # https://core.telegram.org/bots/faq#why-doesn-39t-my-bot-see-messages-from-other-bots return False if Config.NO_P_M_SPAM and not sender.bot: chat = await event.get_chat() if not is_approved(chat.id) and chat.id != borg.uid: logger.info(chat.stringify()) logger.info(borg.storage.PM_WARNS) if chat.id not in borg.storage.PM_WARNS: borg.storage.PM_WARNS.update({chat.id: 0}) if borg.storage.PM_WARNS[chat.id] == Config.MAX_FLOOD_IN_P_M_s: r = await event.reply(UNIBORG_USER_BOT_WARN_ZERO) await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id)) if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() borg.storage.PREV_REPLY_MESSAGE[chat.id] = r return r = await event.reply(UNIBORG_USER_BOT_NO_WARN) borg.storage.PM_WARNS[chat.id] += 1 if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() borg.storage.PREV_REPLY_MESSAGE[chat.id] = r
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit("Dissapproved PM")
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("`PM's Blocked Successfully`") await asyncio.sleep(40)
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit( f"I have denied [you](tg://user?id={chat.id}) to PM me.")
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit(".................../´¯/) \n.................,/¯../ \n................/..../ \n........../´¯/'...'/´¯¯`·¸ \n....../'/.../..../......./¨¯\ \n.....('(...´...´.... ¯~/'...') \n......\.................'...../ \n.......''...\.......... _.·´ \n.........\..............( \n...........\.............\...\n\nFuck Off Bitch") await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("[──███▅▄▄▄▄▄▄▄▄▄\n─██▐████████████\n▐█▀████████████▌▌\n▐─▀▀▀▐█▌▀▀███▀█─▌\n▐▄───▄█───▄█▌▄█](t.me/RoyalBoyPriyanshu) \n\n My Master Has disapproved You To PM him...") await asyncio.sleep(30) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("███████▄▄███████████▄ \n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓███░░░░░░░░░░░░█\n██████▀▀▀█░░░░██████▀ \n░░░░░░░░░█░░░░█ \n░░░░░░░░░░█░░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░░▀▀ \n\nYOU MESSAGED AND SPAMMED MY INBOX WITH MESSAGES AS A RESULT U ARE BLOCKED BY MY BOT .THIS IS A AUTOMATIC RESPONSE...") await asyncio.sleep(30) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit("You are blocked") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit("Blocked PM") await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit("███████▄▄███████████▄ \n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓███░░░░░░░░░░░░█\n██████▀▀▀█░░░░██████▀ \n░░░░░░░░░█░░░░█ \n░░░░░░░░░░█░░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░░▀▀ \n\nFuck Off Bitch, Now You Can't Message Me...") await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("Blocked PM") await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("███████▄▄███████████▄ \n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓███░░░░░░░░░░░░█\n██████▀▀▀█░░░░██████▀ \n░░░░░░░░░█░░░░█ \n░░░░░░░░░░█░░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░░▀▀ \n\nFuck Off Bitch, Now You Can't Message Me...") await asyncio.sleep(30) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("███████▄▄███████████▄ \n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓█░░░░░░░░░░░░░░█\n▓▓▓▓▓▓███░░░░░░░░░░░░█\n██████▀▀▀█░░░░██████▀ \n░░░░░░░░░█░░░░█ \n░░░░░░░░░░█░░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░█░░█ \n░░░░░░░░░░░░▀▀ \n\nOhh, Now You Can't Message My Master cause you flooded His PM...") await asyncio.sleep(10) await borg(functions.contacts.BlockRequest(chat.id)) await event.edit("`For your Irriting Behaviour...\ni Blocked You..\nNow wait till my Master unblocks you`")
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if is_approved(chat.id): disapprove(chat.id) await event.edit( "IT: Fanculo puttanella, ora non puoi mandarmi messaggi.\n\nEN: F**k Off Bitch, Now You Can't Message Me." ) await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] approve(chat.id, reason) await event.edit("Private Message Accepted") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("F**k Off Bitch, Now You Can't Message Me...") await asyncio.sleep(10) await borg(functions.contacts.BlockRequest(chat.id)) await event.edit( "`For your Irriting Behaviour...\nI Blocked You..\nNow Go To HELL`" )
async def approve_p_m(event): if event.fwd_from: return global replied_user 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 Config.PM_LOGGR_BOT_API_ID is not None: if event.is_private: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit("Blocked User [{}](tg://user?id={})".format( firstname, chat.id)) await asyncio.sleep(3) await borg(functions.contacts.BlockRequest(chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit( f"I have allowed [you](tg://user?id={chat.id}) to PM me.")
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: 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( "[──███▅▄▄▄▄▄▄▄▄▄\n─██▐████████████\n▐█▀████████████▌▌\n▐─▀▀▀▐█▌▀▀███▀█─▌\n▐▄───▄█───▄█▌▄█](t.me/AyushChatterjee) \n\n My Master Has Approved You To PM him..." )
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.reply("Haye, I'm **αℓℓυкα Zᴏʟᴅʏᴄᴋ™** 👨🏻💻\nTo get more info about me `.info` and for help `.help`") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit("Private Message Accepted Don’t Show Me Attitude 😒") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit("[──███▅▄▄▄▄▄▄▄▄▄\n─██▐████████████\n▐█▀████████████▌▌\n▐─▀▀▀▐█▌▀▀███▀█─▌\n▐▄───▄█───▄█▌▄█](t.me/iamomkarofficial) \n\n My Master Has Approved You To PM Me...") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit("`This bitch can msg you Now!`") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.PM_LOGGR_BOT_API_ID is not None: 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("Private Message Accepted") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return global PM_WARNS global PREV_REPLY_MESSAGE reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not 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] approve(chat.id, reason) await event.edit("Private Message Accepted") await asyncio.sleep(3) await event.delete()
async def approve_p_m(event): if event.fwd_from: return global replied_user 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 Config.PM_LOGGR_BOT_API_ID is not None: 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 User [{}](tg://user?id={})".format( firstname, chat.id))
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit( "Private Message Accepted Now You can Talk to me ... #Dil bda hai na mera" ) await asyncio.sleep(10) await event.delete()
async def approve_p_m(event): if event.fwd_from: return reason = event.pattern_match.group(1) chat = await event.get_chat() if Config.NO_P_M_SPAM: if event.is_private: if not is_approved(chat.id): if chat.id in borg.storage.PM_WARNS: del borg.storage.PM_WARNS[chat.id] if chat.id in borg.storage.PREV_REPLY_MESSAGE: await borg.storage.PREV_REPLY_MESSAGE[chat.id].delete() del borg.storage.PREV_REPLY_MESSAGE[chat.id] approve(chat.id, reason) await event.edit( "IT: Bene. Hai ricevuto il permesso di messaggiare con il mio Capo!\n\nEN: Well. You have received permission to send messages with my Leader!" ) await asyncio.sleep(3) await event.delete()