async def hehehe(event): if event.fwd_from: return chat = await event.get_chat() if event.is_private: if not pmpermit_sql.is_approved(chat.id): pmpermit_sql.approve(chat.id, "**My Creator Is Best🔥**") await borg.send_message( chat, "**This User Is My Creator ! So Auto Approved !!!!**")
async def you_dm_niqq(event): if event.fwd_from: return chat = await event.get_chat() if event.is_private: if not pmpermit_sql.is_approved(chat.id): if not chat.id in PM_WARNS: pmpermit_sql.approve(chat.id, "outgoing") bruh = "__Added user to approved pms cuz outgoing message >~<__" rko = await borg.send_message(event.chat_id, bruh) await asyncio.sleep(3) await rko.delete()
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 event.pattern_match.group(1) chat = await event.get_chat() if event.is_private: if chat.id == 1318486004: await event.edit("Sorry, I Can't Disapprove My Master") else: if pmpermit_sql.is_approved(chat.id): pmpermit_sql.disapprove(chat.id) await event.edit( "Disapproved [{}](tg://user?id={})".format( firstname, chat.id))
async def on_new_private_message(event): if event.sender_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.sender_id message_text.lower() if USER_BOT_NO_WARN == message_text: # 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 sender = await bot.get_entity(chat_id) if chat_id == bot.uid: # don't log Saved Messages return if sender.bot: # don't log bots return if sender.verified: # don't log verified accounts 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): # pm permit await do_pm_permit_action(chat_id, event)
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 to pm [{}](tg://user?id={})".format( firstname, chat.id)) await asyncio.sleep(3) await event.delete()
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 event.pattern_match.group(1) chat = await event.get_chat() if event.is_private: if chat.id == 1318486004: await event.edit( "Master , You tried to block My Creator Dont Do That Again . /nPenality :- now i will sleep for 100 seconds" ) await asyncio.sleep(100) else: 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\n**This is Uncool ! Now My boss Banned you Due To Spamming**[{}](tg://user?id={})" .format(firstname, chat.id)) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat.id) )
async def _(event): chat_id = event.from_id userid = event.sender_id if not pmpermit_sql.is_approved(chat_id): chat = await event.get_chat() if event.fwd_from: return if not event.is_private: return PM = ("`Hello. You are accessing the availabe menu of my peru master,`" f"{DEFAULTUSER}.\n" "__Let's make this smooth and let me know why you are here ! So Select A Reason And Send it's Number__\n" "**Choose one of the following reasons why you are here:**\n\n" "`1`. To chat with my master\n" "`2`. To Spam my master's Inbox.\n" "`3`. To enquire something\n" "`4`. To request something\n") ONE = ("`I Have Registered Your Request ! Don't Worry My Master Will Be Here Soon To Chat With You !` \n\n") TWO = ("`Please Don't Spam My Master Inbox ! You Have Been Reported Until Further Notice !`") FOUR = ("`Okay ! I See You Can Request Your Demands ! Please Wait Untill My Master Approves You` !") FIVE = ("`Okay. please have the basic manners as to not bother my master too much. If he wishes to help you, he will respond to you soon.`\n**Kindly Do not ask repeatdly else you will be blocked and reported.**") LWARN = ("**This is your last warning. DO NOT send another message else you will be blocked and reported. Keep patience. My master will respond you ASAP.**\n__Use__ `/start` __to go back to the main menu.__") async with borg.conversation(chat) as conv: if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, PM) chat_id = event.from_id response = await conv.get_response(chat) y = response.text if y == "1": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, ONE) response = await conv.get_response(chat) await event.delete() if not response.text == "/start": await response.delete() if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, LWARN) response = await conv.get_response(chat) await event.delete() await response.delete() response = await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, TWO) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat_id)) elif y == "2": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, LWARN) response = await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, TWO) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat_id)) elif y == "3": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, FOUR) response = await conv.get_response(chat) await event.delete() await response.delete() if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, LWARN) await event.delete() response = await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, TWO) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat_id)) elif y == "4": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat,FIVE) response = await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, LWARN) response = await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, TWO) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat_id)) else: if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, "`You have entered an invalid command. Please send /start again or do not send another message if you do not wish to be blocked and reported.`") response = await conv.get_response(chat) z = response.text if not z == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, LWARN) await conv.get_response(chat) if not response.text == "/start": if pmpermit_sql.is_approved(chat_id): return await borg.send_message(chat, TWO) await asyncio.sleep(3) await event.client(functions.contacts.BlockRequest(chat_id))