async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if not PM_AUTO_BAN: return self_user = await event.client.get_me() sender = await event.get_sender() if (event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not sender.bot and not sender.contact): try: from userbot.modules.sql_helper.globals import gvarstatus from userbot.modules.sql_helper.pm_permit_sql import is_approved except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # Use user custom unapproved message getmsg = gvarstatus("unapproved_msg") UNAPPROVED_MSG = getmsg if getmsg is not None else DEF_UNAPPROVED_MSG # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user="******", search=UNAPPROVED_MSG): await message.delete() await event.reply(f"`{UNAPPROVED_MSG}`") else: await event.reply(f"`{UNAPPROVED_MSG}`") LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`Você estava spammando o chat privado do meu mestre, o que eu não gostei.`\n" "`Você foi bloqueado e denunciado como spam, até segunda ordem.`" ) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "O contador de PMs está aparentemente ficando lento, plis reinicie o bot!", ) return LOGS.info("Contador de PMs está louco!") await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " estava enviando spam para o seu PM, então ele foi bloqueado.", )
async def gspider(userbot): lol = userbot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning User..") else: friday = await lol.edit("Wait Processing.....") me = await userbot.client.get_me() await friday.edit(f"**Global Ban user..**") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) else: userbot.chat.title try: user, reason = await get_full_user(userbot) except BaseException: pass try: if not reason: reason = "Private" except BaseException: return await friday.edit(f"**Terjadi Kesalahan!!**") if user: if user.id == 1411273575: return await friday.edit( f"**Didn't , Your Father Teach You ? That You Cant Gban your creator🖕**" ) try: from userbot.modules.sql_helper.gmute_sql import gmute except BaseException: pass try: await userbot.client(BlockRequest(user)) except BaseException: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await friday.edit( f"**GBANNED // Total Affected Chats **: `{a}`") except BaseException: b += 1 else: await friday.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await friday.edit(f"**Error! User telah di gbanned.**") except BaseException: pass return await friday.edit( f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Dari : {a} Group**" ) if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "#GBANNED\n" f"USER: [{user.first_name}](tg://user?id={user.id})")
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): await message.delete() await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`Stavi spammando la chat del mio maestro.`\n" "`Sei stato bloccato e segnalato come spam.`") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "L'userbot sta andando male per colpa delle persone che ne abusano, riavvialo", ) LOGS.info("L'userbot sta andando male, riavvialo") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " era solo un altro ritardato", )
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): await message.delete() await event.reply(UNAPPROVED_MSG) LASTMSG.update({eve"`Kau ini Sudah dibilangin masih aja susah gtd .`\n" "`You have been BLOCKED and reported as SPAM, until further notice.`" ) nt.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`Halah Ieu Budak Teu Ngarti Pisan?.`\n" "`SIA NGGEUS DI BLOKIR KU AING, Tunggu We Sampe Aing Unblok!.`" ) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, plis restart bot!", ) LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def gspider(ULTRA): lol = ULTRA sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("GBanning This Retard DumbAss😁😁") else: friday = await lol.edit("Wait Processing.....") me = await ULTRA.client.get_me() await friday.edit(f"Global Ban Is Coming ! Wait And Watch You bitch😎🔥") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await ULTRA.get_chat() a = b = 0 if ULTRA.is_private: user = ULTRA.chat reason = ULTRA.pattern_match.group(1) else: ULTRA.chat.title try: user, reason = await get_full_user(ULTRA) except: pass try: if not reason: reason = "Private" except: return await friday.edit(f"**Something W3NT Wrong 🤔**") if user: if user.id in devs: return await friday.edit( f"**Didn't, Your Father Teach You ? That You Can't Gban My Creator😑😑🖕**" ) try: from ULTRA.modules.sql_helper.gmute_sql import gmute except: pass try: await ULTRA.client(BlockRequest(user)) except: pass testULTRA = [ d.entity.id for d in await ULTRA.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testULTRA: try: await ULTRA.client.edit_permissions(i, user, view_messages=False) a += 1 await friday.edit( f"**GBANNING [{user.first_name}](tg://user?id={user.id})**\n\n__Please be Patient..This process takes time.__" ) except: b += 1 else: await friday.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await friday.edit( f"**Error! User probably already gbanned.**") except: pass POST(user=user.id, msg=ULTRA.text[5:]) await friday.edit( f"**Successfully GBanned [{user.first_name}](tg://user?id={user.id}) // Total Affected Chats :** `{a}` " ) return
async def permitpm(event): """ Permits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: if event.is_private and not (await event.get_sender()).bot: if not is_mongo_alive() or not is_redis_alive(): return apprv = await approval(event.chat_id) # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: # Searches for previously sent UNAPPROVED_MSGs async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): # ... and deletes them !! await message.delete() await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if await notif_state() is False: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond("`You were spamming my master's PM, " " which I don't like.`" " `I'mma Report Spam.`") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, " "plis restart bot!", ) LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def gben(userbot): dc = userbot sender = await dc.get_sender() me = await dc.client.get_me() if not sender.id == me.id: dark = await dc.reply( "`Lord Ingin Mengaktifkan Perintah Global Banned!`") else: dark = await dc.edit("`Memproses Global Banned Pengguna Ini ヅ`") me = await userbot.client.get_me() await dark.edit( f"`Global Banned Akan Segera Aktif, Anda Akan Dibanned Secara Global Oleh Lord ヅ`" ) my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) else: userbot.chat.title try: user, reason = await get_full_user(userbot) except: pass try: if not reason: reason = "Private" except: return await dark.edit(f"`Terjadi Kesalahan ヅ`") if user: if user.id == 1353102497: return await dark.edit( f"`Anda Tidak Bisa Melakukan Global Banned Ke Lord Alvin, Dia Adalah Pembuatku ヅ`" ) try: from userbot.modules.sql_helper.gmute_sql import gmute except: pass try: await userbot.client(BlockRequest(user)) except: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await dark.edit( f"`Global Banned Telah Aktif ✅`\n`Global Bannned Sedang Dalam Proses......`\n`Orang Ini Akan Terbanned Digrup Jika Anda Seorang Admin Grup ヅ`" ) except: b += 1 else: await dark.edit(f"`Mohon Balas Ke Pesan Lord`") try: if gmute(user.id) is False: return await dark.edit( f"**Kesalahan! Pengguna Ini Sudah Kena Perintah Global Banned Lord.**" ) except: pass return await dark.edit( f"**♛ Perintah Lord:** `{ALIVE_NAME}`\n**✣ Pengguna:** [{user.first_name}](tg://user?id={user.id})\n**✣ Aksi:** `Global Banned`" )
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if not PM_AUTO_BAN: return self_user = await event.client.get_me() sender = await event.get_sender() if (event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not sender.bot and not sender.contact): try: from userbot.modules.sql_helper.globals import gvarstatus from userbot.modules.sql_helper.pm_permit_sql import is_approved except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # Use user custom unapproved message getmsg = gvarstatus("unapproved_msg") UNAPPROVED_MSG = getmsg if getmsg is not None else DEF_UNAPPROVED_MSG # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user="******", search=UNAPPROVED_MSG): await message.delete() await event.reply(f"{UNAPPROVED_MSG}") else: await event.reply(f"{UNAPPROVED_MSG}") LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > PM_LIMIT: await event.respond( "**Maaf Anda Telah Di Blokir Karna Melakukan Spam Chat**") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "**Terjadi Error Saat Menghitung Private Message, Mohon Restart Bot!**", ) return LOGS.info("Gagal menghitung PM yang diterima") await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " **Telah Diblokir Karna Melakukan Spam Ke Room Chat**", )
async def permitpm(event): user = await event.get_chat() if user.bot or user.is_self or user.verified: return if str(user.id) in DEVLIST: return apprv = is_approved(user.id) if not apprv and event.text != UND: name = user.first_name fullname = (user.first_name, user.last_name) username = user.username mention = f"[{get_display_name(user)}](tg://user?id={user.id})" count = len(get_approved()) try: wrn = COUNT_PM[user.id] + 1 except KeyError: wrn = 1 if user.id in LASTMSG: prevmsg = LASTMSG[user.id] if event.text != prevmsg: async for message in event.client.iter_messages( user.id, search=UND): await message.delete() async for message in event.client.iter_messages( user.id, search=UNS): await message.delete() await event.client.send_file( user.id, PMPIC, caption=UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ), ) elif event.text == prevmsg: async for message in event.client.iter_messages( user.id, search=UND): await message.delete() await event.client.send_file( user.id, PMPIC, caption=UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ), ) LASTMSG.update({user.id: event.text}) else: async for message in event.client.iter_messages(user.id, search=UND): await message.delete() await event.client.send_file( user.id, PMPIC, caption=UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ), ) LASTMSG.update({user.id: event.text}) if user.id not in COUNT_PM: COUNT_PM.update({user.id: 1}) else: COUNT_PM[user.id] = COUNT_PM[user.id] + 1 if COUNT_PM[user.id] >= WARNS: async for message in event.client.iter_messages(user.id, search=UND): await message.delete() await event.respond(UNS) try: del COUNT_PM[user.id] del LASTMSG[user.id] except KeyError: if Var.LOG_CHANNEL: await event.client.send_message( Var.LOG_CHANNEL, "PMPermit is messed! Pls restart the bot!!", ) return LOGS.info("COUNT_PM is messed.") await event.client(BlockRequest(user.id)) await event.client(ReportSpamRequest(peer=user.id)) if Var.LOG_CHANNEL: name = await event.client.get_entity(user.id) name0 = str(name.first_name) await event.client.send_message( Var.LOG_CHANNEL, f"[{name0}](tg://user?id={user.id}) was blocked for spamming.", )
COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`You were spamming my master's PM, which I don't like.`" " `I'mma Report Spam.`" ) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if LOGGER: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( LOGGER_GROUP, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def gspider(userbot): lol = userbot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning This User !") else: friday = await lol.edit("Wait Processing.....") me = await userbot.client.get_me() await friday.edit(f"Global Ban Is Coming ! Wait And Watch You N***a") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) my_username = f"@{me.username}" if me.username else my_mention chat = await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) chat_title = 'PM' else: chat_title = userbot.chat.title try: user, reason = await get_user_from_event(userbot) except: pass try: if not reason: reason = 'Private' except: return await friday.edit(f"**You Cant Use In Pvt Chats // Group!**") if user: if user.id == 1263617196: return await friday.edit( f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**") try: from userbot.modules.sql_helper.gmute_sql import gmute except: pass try: await userbot.client(BlockRequest(user)) block = 'True' except: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await friday.edit( f"**GBANNED // Total Affected Chats **: `{a}`") except: b += 1 else: await friday.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await friday.edit( f"**Error! User probably already gbanned.**") except: pass return await friday.edit( f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **" )
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): await message.delete() await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`Mohon jangan melakukan spam, bot akan otomatis blokir anda jika melakukan spam ðŸ˜.`\n" "`Anda sekarang kami BLOKIR, dikarenakan melakukan spam berulang kali.. silahkan menunggu sampai Owner Buka BLOKIR untuk anda.. maaf`" ) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, plis restart bot!", ) return LOGS.info("CountPM wen't rarted boi") await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 724495167 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): await message.delete() LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] == 3: await event.respond( f"`{KYNE_NNAME}`: ** Dont spam my owner's pm this is your last warning!!**") if COUNT_PM[event.chat_id] > 4: await event.respond( f"`{KYNE_NNAME}`: ** {BLOCK_MMSG} **") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, please restart bot!", ) LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " blocked for spam your PM", )
async def block_pm(e): if BLOCK_PM: chat = await e.get_chat() if chat.id not in ACCEPTED_USERS: await client(BlockRequest(chat.id))
"`You have been BLOCKED and reported as SPAM, until further notice.`" ) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, plis restart bot!", ) LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", ) @register(disable_edited=True, outgoing=True, disable_errors=True) async def auto_accept(event):
async def _(e): xx = await e.eor("`Gbanning...`") reason = "" if e.reply_to_msg_id: userid = (await e.get_reply_message()).sender_id try: reason = e.text.split(" ", maxsplit=1)[1] except IndexError: pass elif e.pattern_match.group(1).strip(): usr = e.text.split(maxsplit=2)[1] try: userid = await e.client.parse_id(usr) except ValueError: userid = usr try: reason = e.text.split(maxsplit=2)[2] except IndexError: pass elif e.is_private: userid = e.chat_id try: reason = e.text.split(" ", maxsplit=1)[1] except IndexError: pass else: return await xx.eor("`Reply to some msg or add their id.`", time=5) user = None try: user = await e.client.get_entity(userid) name = inline_mention(user) except BaseException: userid = int(userid) name = str(userid) chats = 0 if userid == ultroid_bot.uid: return await xx.eor("`I can't gban myself.`", time=3) elif userid in DEVLIST: return await xx.eor("`I can't gban my Developers.`", time=3) elif is_gbanned(userid): return await eod( xx, "`User is already gbanned and added to gbanwatch.`", time=4, ) if e.client._dialogs: dialog = e.client._dialogs else: dialog = await e.client.get_dialogs() e.client._dialogs.extend(dialog) for ggban in dialog: if ggban.is_group or ggban.is_channel: try: await e.client.edit_permissions(ggban.id, userid, view_messages=False) chats += 1 except FloodWaitError as fw: LOGS.info( f"[FLOOD_WAIT_ERROR] : on GBAN Command\nSleeping for {fw.seconds+10}" ) await asyncio.sleep(fw.seconds + 10) try: await e.client.edit_permissions(ggban.id, userid, view_messages=False) chats += 1 except BaseException as er: LOGS.exception(er) except (ChatAdminRequiredError, ValueError): pass except BaseException as er: LOGS.exception(er) gban(userid, reason) if isinstance(user, User): await e.client(BlockRequest(int(userid))) gb_msg = f"**#Gbanned** {name} `in {chats} chats and added to gbanwatch!`" if reason: gb_msg += f"\n**Reason** : {reason}" await xx.edit(gb_msg)
async def gspider(rk): lazy = rk sender = await lazy.get_sender() me = await lazy.client.get_me() if not sender.id == me.id: rkp = await lazy.reply("`processing...`") else: rkp = await lazy.edit("`processing...`") me = await rk.client.get_me() await rkp.edit(f"`{JAVES_NNAME}:` **Requesting to gban user!**") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) my_username = f"@{me.username}" if me.username else my_mention chat = await rk.get_chat() a = b = 0 if rk.is_private: user = rk.chat reason = rk.pattern_match.group(1) chat_title = 'PM' else: chat_title = rk.chat.title try: user, reason = await get_user_from_event(rk) except: pass try: if not reason: reason = 'Private' except: return await rkp.edit(f"`{JAVES_NNAME}:`**Error! Unknown user.**") if user: if user.id == 929138153: return await rkp.edit(f"`{JAVES_NNAME}:`**HEY THAT'S MY DEV**") try: from userbot.modules.sql_helper.gmute_sql import gmute except: pass try: await rk.client(BlockRequest(user)) block = 'True' except: pass testrk = [ d.entity.id for d in await rk.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testrk: try: await rk.client.edit_permissions(i, user, view_messages=False) a += 1 await rkp.edit( f"`{JAVES_NNAME}:` **Requesting to gban user!\nGbanned {a} chats.....**" ) except: b += 1 else: await rkp.edit(f"`{JAVES_NNAME}:` **Reply to a user !! **") try: if gmute(user.id) is False: return await rkp.edit( f"`{JAVES_NNAME}:`**Error! User probably already gbanned.**") except: pass return await rkp.edit( f"`{JAVES_NNAME}:` **Gbanned [{user.first_name}](tg://user?id={user.id}) in {a} chat(s) , Blocked user and added to Gban watch **" )
async def permitpm(event): user = await event.get_chat() if user.bot or user.is_self or user.verified: return if str(user.id) in DEVLIST: return apprv = is_approved(user.id) if not apprv and event.text != UND: if Redis("MOVE_ARCHIVE") == "True": try: await ultroid.edit_folder(user.id, folder=1) except BaseException: pass if event.media: await event.delete() name = user.first_name if user.last_name: fullname = f"{name} {user.last_name}" else: fullname = name username = f"@{user.username}" mention = f"[{get_display_name(user)}](tg://user?id={user.id})" count = len(get_approved()) try: wrn = COUNT_PM[user.id] + 1 await asst.edit_message( int(udB.get("LOG_CHANNEL")), _not_approved[user.id], f"Incoming PM from {mention} with {wrn}/{WARNS} warning!", buttons=[ Button.inline("Approve PM", data=f"approve_{user.id}"), Button.inline("Block PM", data=f"block_{user.id}"), ], ) except KeyError: _not_approved[user.id] = await asst.send_message( int(udB.get("LOG_CHANNEL")), f"Incoming PM from {mention} with 1/{WARNS} warning!", buttons=[ Button.inline("Approve PM", data=f"approve_{user.id}"), Button.inline("Block PM", data=f"block_{user.id}"), ], ) wrn = 1 if user.id in LASTMSG: prevmsg = LASTMSG[user.id] if event.text != prevmsg: if "PMSecurity" in event.text: return async for message in ultroid.iter_messages( user.id, search=UND, ): await message.delete() async for message in ultroid.iter_messages( user.id, search=UNS, ): await message.delete() message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) await ultroid.send_file( user.id, PMPIC, caption=message_, ) elif event.text == prevmsg: async for message in ultroid.iter_messages( user.id, search=UND, ): await message.delete() message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) await ultroid.send_file( user.id, PMPIC, caption=message_, ) LASTMSG.update({user.id: event.text}) else: async for message in ultroid.iter_messages(user.id, search=UND): await message.delete() message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) await ultroid.send_file( user.id, PMPIC, caption=message_, ) LASTMSG.update({user.id: event.text}) if user.id not in COUNT_PM: COUNT_PM.update({user.id: 1}) else: COUNT_PM[user.id] = COUNT_PM[user.id] + 1 if COUNT_PM[user.id] >= WARNS: async for message in ultroid.iter_messages(user.id, search=UND): await message.delete() await event.respond(UNS) try: del COUNT_PM[user.id] del LASTMSG[user.id] except KeyError: await asst.send_message( int(udB.get("LOG_CHANNEL")), "PMPermit is messed! Pls restart the bot!!", ) return LOGS.info("COUNT_PM is messed.") await ultroid(BlockRequest(user.id)) await ultroid(ReportSpamRequest(peer=user.id)) name = await ultroid.get_entity(user.id) name0 = str(name.first_name) await asst.edit_message( int(udB.get("LOG_CHANNEL")), _not_approved[user.id], f"[{name0}](tg://user?id={user.id}) was Blocked for spamming.", )
async def gban(userbot): if userbot.fwd_from: return ids = userbot sender = await ids.get_sender() hum = await ids.client.get_me() if not sender.id == hum.id: hellbot = await edit_or_reply(ids, "Trying to gban this retard!") else: hellbot = await edit_or_reply(ids, "`Ok! Gbaning this piece of shit....`") hum = await userbot.client.get_me() await hellbot.edit(f"`🔥Global Ban Iz Cumin'💦.... Wait and watch n***a🚶`") my_mention = "[{}](tg://user?id={})".format(hum.first_name, hum.id) f"@{hum.username}" if hum.username else my_mention await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) else: userbot.chat.title try: user, reason = await get_full_user(userbot) except: pass try: if not reason: reason = "Private" except: return await hellbot.edit(f"**Something W3NT Wrong 🤔**") if user: if user.id == 924138714: return await hellbot.edit( f"`First Grow Some Balls To Gban My Creater🤫🚶`") try: from userbot.modules.sql_helper.gmute_sql import gmute except: pass try: await userbot.client(BlockRequest(user)) except: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await hellbot.edit( f"Gbaning This retard🚶\n\nTotal Chats :- `{a}`") except: b += 1 else: await hellbot.edit(f"`Either reply to a user or gib me user id/name`") try: if gmute(user.id) is False: return await hellbot.edit(f"**Error! User already gbanned.**") except: pass return await hellbot.edit( f"[{user.first_name}](tg://user?id={user.id}) Beta majdur ko khodna aur [{HELLBOY}](tg://user?id={papa}) ko chodna kabhi sikhana nhi.\n\n**Gban Successful 🔥\nAffected Chats😏 : {a} **" )
async def permitpm(event): """ İzniniz olmadan size PM gönderenleri yasaklamak içindir. \ Yazmaya devam eden kullanıcıları engeller. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") reply_user = await event.get_sender() id = reply_user.id first_name = str(reply_user.first_name) if reply_user.last_name: last_name = str(reply_user.last_name) else: last_name = '' username = '******' + reply_user.username if reply_user.username else f'[{first_name} {last_name}](tg://user?id={id})' mention = f'[{first_name} {last_name}](tg://user?id={id})' # Bu bölüm basitçe akıl sağlığı kontrolüdür. # Eğer mesaj daha önceden onaylanmamış olarak gönderildiyse # flood yapmayı önlemek için unapprove mesajı göndermeyi durdurur. if not apprv and event.text != PLUGIN_MESAJLAR['pm']: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # Eğer önceden gönderilmiş mesaj farklıysa unapprove mesajı tekrardan gönderilir. if event.text != prevmsg: if type(PLUGIN_MESAJLAR['afk']) is str: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=PLUGIN_MESAJLAR['pm'].format( id=id, username=username, mention=first_name, first_name=first_name, last_name=last_name)): await message.delete() await event.reply(PLUGIN_MESAJLAR['pm'].format( id=id, username=username, mention=mention, first_name=first_name, last_name=last_name)) else: async for message in event.client.iter_messages( event.chat_id, from_user='******', limit=PM_AUTO_BAN_LIMIT + 1): await message.delete() if not PLUGIN_MESAJLAR['pm'].text == '': PLUGIN_MESAJLAR['pm'].text = PLUGIN_MESAJLAR[ 'pm'].text.format(id=id, username=username, mention=mention, first_name=first_name, last_name=last_name) await event.reply(PLUGIN_MESAJLAR['pm']) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(PLUGIN_MESAJLAR['pm'].format( id=id, username=username, mention=mention, first_name=first_name, last_name=last_name)) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > PM_AUTO_BAN_LIMIT: await event.respond(LANG['BLOCKED']) try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, LANG['ERROR'], ) LOGS.info(LANG['ERROR']) return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + LANG['BOTLOG_BLOCKED'], )
async def gspider(userbot): lol = userbot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning This Retard DumbAss😁😁") else: friday = await lol.edit("Wait Processing.....") me = await userbot.client.get_me() await friday.edit(f"Global Ban Is Coming ! Wait And Watch You bitch😎🔥") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) else: userbot.chat.title try: user, reason = await get_full_user(userbot) except: pass try: if not reason: reason = "Private" except: return await friday.edit(f"**Something W3NT Wrong 🤔**") if user: if user.id == 1137511834: return await friday.edit( f"**Didn't , Your Father Teach You ? That You Cant Gban your creator😑😑🖕**" ) try: from userbot.modules.sql_helper.gmute_sql import gmute except: pass try: await userbot.client(BlockRequest(user)) except: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await friday.edit( f"**GBANNED // Total Affected Chats **: `{a}`") except: b += 1 else: await friday.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await friday.edit( f"**Error! User probably already gbanned.**") except: pass return await friday.edit( f"**Gbanned [{user.first_name}](tg://user?id={user.id}) Affected Chats : {a} **" )
async def block_pm(event): sender = await event.get_sender() if BLOCK_PM and not sender.bot: chat = await event.get_chat() if chat.id not in ACCEPTED_USERS: await client(BlockRequest(chat.id))
async def gben(userbot): dc = userbot sender = await dc.get_sender() me = await dc.client.get_me() if not sender.id == me.id: dark = await dc.reply( "`Saya Sedang Mengaktifkan Perintah Global Banned!`") else: dark = await dc.edit("`Memproses Global Banned Pengguna Ini ヅ`") me = await userbot.client.get_me() await dark.edit( f"`Global Banned Akan Segera Aktif, Anda Akan Dibanned Secara Global Oleh Saya ヅ`" ) my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await userbot.get_chat() a = b = 0 if userbot.is_private: user = userbot.chat reason = userbot.pattern_match.group(1) else: userbot.chat.title try: user, reason = await get_full_user(userbot) except BaseException: pass try: if not reason: reason = "Private" except BaseException: return await dark.edit(f"`Terjadi Kesalahan ヅ`") if user: if user.id == 1448477501: return await dark.edit( f"`Anda Tidak Bisa Melakukan Global Banned Ke Lord Axel, Dia Adalah Pembuat Saya ヅ`" ) try: from userbot.modules.sql_helper.gmute_sql import gmute except BaseException: pass try: await userbot.client(BlockRequest(user)) except BaseException: pass testuserbot = [ d.entity.id for d in await userbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testuserbot: try: await userbot.client.edit_permissions(i, user, view_messages=False) a += 1 await dark.edit(f"`Global Banned Aktif ✅`") except BaseException: b += 1 else: await dark.edit(f"`Mohon Balas Ke Pesan Yang Mulia`") try: if gmute(user.id) is False: return await dark.edit( f"**Kesalahan! Pengguna Ini Sudah Kena Perintah Global Banned.**" ) except BaseException: pass return await dark.edit( f"**⊙ Perintah :** `{ALIVE_NAME}`\n**⊙ Pengguna :** [{user.first_name}](tg://user?id={user.id})\n**⊙ Aksi :** `Global Banned`" ) if BOTLOG: await dc.client.send_message( BOTLOG_CHATID, "#GBAN\n" f"**⊙ Perintah :** `{ALIVE_NAME}`\n" f"**⊙ Pengguna :** [{user.first_name}](tg://user?id={user.id})\n" "**⊙ Aksi :** `Global Banned`\n" f"**⊙ Group :** {userbot.chat.tittle}(`{userbot.chat_id}`)\n", )
async def permitpm(event): """ Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: self_user = await event.client.get_me() if event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not ( await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user='******', search=UNAPPROVED_MSG): await message.delete() await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "You're spamming my PM, " "which I don't like. Reporting as spam.") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is f*****g up, " "please restart the bot!", ) LOGS.info("CountPM f****d up") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another idiot", )
async def permitpm(event): """Prohibits people from PMing you without approval. \ Will block retarded nibbas automatically.""" if not PM_AUTO_BAN: return self_user = await event.client.get_me() if (event.is_private and event.chat_id != 777000 and event.chat_id != self_user.id and not (await event.get_sender()).bot): try: from userbot.modules.sql_helper.globals import gvarstatus from userbot.modules.sql_helper.pm_permit_sql import is_approved except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # Use user custom unapproved message getmsg = gvarstatus("unapproved_msg") if getmsg is not None: UNAPPROVED_MSG = getmsg else: UNAPPROVED_MSG = DEF_UNAPPROVED_MSG # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: async for message in event.client.iter_messages( event.chat_id, from_user="******", search=UNAPPROVED_MSG): await message.delete() await event.reply(f"`{UNAPPROVED_MSG}`") else: await event.reply(f"`{UNAPPROVED_MSG}`") LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 4: await event.respond( "`You were spamming my PM, which I didn't like.`\n" "`I Wouldn't let you to chat me again until further notice`\n" "`Bye`") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, plis restart bot!", ) return LOGS.info("CountPM wen't rarted boi") await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def gspider(fridaybot): lol = fridaybot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: friday = await lol.reply("Gbanning This User!") else: friday = await lol.edit("Wait Processing.....") me = await fridaybot.client.get_me() await friday.edit(f"Global Ban Is Coming! \nWait And Watch You N***a") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await fridaybot.get_chat() a = b = 0 if fridaybot.is_private: user = fridaybot.chat reason = fridaybot.pattern_match.group(1) else: fridaybot.chat.title try: user, reason = await get_full_user(fridaybot) except: pass try: if not reason: reason = "Private" except: return await friday.edit(f"**Something W3NT Wrong 🤔**") if user: if user.id == 1412254339: return await friday.edit(f"**Sorry Boss But, You Cant Gban Divu**") try: from fridaybot.modules.sql_helper.gmute_sql import gmute except: pass try: await fridaybot.client(BlockRequest(user)) except: pass testfridaybot = [ d.entity.id for d in await fridaybot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testfridaybot: try: await fridaybot.client.edit_permissions(i, user, view_messages=False) a += 1 await friday.edit( f"**GBANNED! \nTotal Affected Chats **: `{a}`") except: b += 1 else: await friday.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await friday.edit( f"**Error! User Probably Already Gbanned.**") except: pass return await friday.edit( f"#Gbanned! \n\n**User - [{user.first_name}](tg://user?id={user.id}) \nAffected Chats : {a} **" )
async def permitpm(event): """ Permits people from PMing you without approval. \ Will block retarded nibbas automatically. """ if PM_AUTO_BAN: if event.sender_id in BRAIN_CHECKER: return if event.is_private and not (await event.get_sender()).bot: try: from userbot.modules.sql_helper.pm_permit_sql import is_approved from userbot.modules.sql_helper.globals import gvarstatus except AttributeError: return apprv = is_approved(event.chat_id) notifsoff = gvarstatus("NOTIF_OFF") # This part basically is a sanity check # If the message that sent before is Unapproved Message # then stop sending it again to prevent FloodHit if not apprv and event.text != UNAPPROVED_MSG: if event.chat_id in LASTMSG: prevmsg = LASTMSG[event.chat_id] # If the message doesn't same as previous one # Send the Unapproved Message again if event.text != prevmsg: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) else: await event.reply(UNAPPROVED_MSG) LASTMSG.update({event.chat_id: event.text}) if notifsoff: await event.client.send_read_acknowledge(event.chat_id) if event.chat_id not in COUNT_PM: COUNT_PM.update({event.chat_id: 1}) else: COUNT_PM[event.chat_id] = COUNT_PM[event.chat_id] + 1 if COUNT_PM[event.chat_id] > 5: await event.respond( "`You were spamming my master's PM, which I don't like.`" " `I'mma Report Spam.`") try: del COUNT_PM[event.chat_id] del LASTMSG[event.chat_id] except KeyError: if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "Count PM is seemingly going retard, plis restart bot!", ) LOGS.info("CountPM wen't rarted boi") return await event.client(BlockRequest(event.chat_id)) await event.client(ReportSpamRequest(peer=event.chat_id)) if BOTLOG: name = await event.client.get_entity(event.chat_id) name0 = str(name.first_name) await event.client.send_message( BOTLOG_CHATID, "[" + name0 + "](tg://user?id=" + str(event.chat_id) + ")" + " was just another retarded nibba", )
async def permitpm(event): inline_pm = False if Redis("INLINE_PM") and Redis("INLINE_PM") == "True": inline_pm = not inline_pm user = await event.get_sender() if user.bot or user.is_self or user.verified: return if user.id in DEVLIST: return if not is_approved(user.id) and event.text != UND: if Redis("MOVE_ARCHIVE") == "True": try: await ultroid_bot.edit_folder(user.id, folder=1) except BaseException as er: LOGS.info(er) if event.media: await event.delete() name = user.first_name fullname = get_display_name(user) username = f"@{user.username}" mention = f"[{get_display_name(user)}](tg://user?id={user.id})" count = len(get_approved()) try: wrn = COUNT_PM[user.id] + 1 await asst.edit_message( int(udB.get("LOG_CHANNEL")), _not_approved[user.id], f"Incoming PM from **{mention}** [`{user.id}`] with **{wrn}/{WARNS}** warning!", buttons=[ Button.inline("Approve PM", data=f"approve_{user.id}"), Button.inline("Block PM", data=f"block_{user.id}"), ], ) except KeyError: _not_approved[user.id] = await asst.send_message( int(udB.get("LOG_CHANNEL")), f"Incoming PM from **{mention}** [`{user.id}`] with **1/{WARNS}** warning!", buttons=[ Button.inline("Approve PM", data=f"approve_{user.id}"), Button.inline("Block PM", data=f"block_{user.id}"), ], ) wrn = 1 if user.id in LASTMSG: prevmsg = LASTMSG[user.id] if event.text != prevmsg: if "PMSecurity" in event.text or "**PMSecurity" in event.text: return await delete_pm_warn_msgs(user.id) message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) update_pm(user.id, message_, wrn) if inline_pm: results = await ultroid_bot.inline_query( my_bot, f"ip_{user.id}") try: _to_delete[user.id] = await results[0].click( user.id, reply_to=event.id, hide_via=True) except Exception as e: LOGS.info(str(e)) elif PMPIC: _to_delete[user.id] = await ultroid_bot.send_file( user.id, PMPIC, caption=message_, ) else: _to_delete[user.id] = await ultroid_bot.send_message( user.id, message_) else: await delete_pm_warn_msgs(user.id) message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) update_pm(user.id, message_, wrn) if inline_pm: try: results = await ultroid_bot.inline_query( my_bot, f"ip_{user.id}") _to_delete[user.id] = await results[0].click( user.id, reply_to=event.id, hide_via=True) except Exception as e: LOGS.info(str(e)) elif PMPIC: _to_delete[user.id] = await ultroid_bot.send_file( user.id, PMPIC, caption=message_, ) else: _to_delete[user.id] = await ultroid_bot.send_message( user.id, message_) LASTMSG.update({user.id: event.text}) else: await delete_pm_warn_msgs(user.id) message_ = UNAPPROVED_MSG.format( ON=OWNER_NAME, warn=wrn, twarn=WARNS, UND=UND, name=name, fullname=fullname, username=username, count=count, mention=mention, ) update_pm(user.id, message_, wrn) if inline_pm: try: results = await ultroid_bot.inline_query( my_bot, f"ip_{user.id}") _to_delete[user.id] = await results[0].click( user.id, reply_to=event.id, hide_via=True) except Exception as e: LOGS.info(str(e)) elif PMPIC: _to_delete[user.id] = await ultroid_bot.send_file( user.id, PMPIC, caption=message_, ) else: _to_delete[user.id] = await ultroid_bot.send_message( user.id, message_) LASTMSG.update({user.id: event.text}) if user.id not in COUNT_PM: COUNT_PM.update({user.id: 1}) else: COUNT_PM[user.id] = COUNT_PM[user.id] + 1 if COUNT_PM[user.id] >= WARNS: await delete_pm_warn_msgs(user.id) await event.respond(UNS) try: del COUNT_PM[user.id] del LASTMSG[user.id] except KeyError: await asst.send_message( int(udB.get("LOG_CHANNEL")), "PMPermit is messed! Pls restart the bot!!", ) return LOGS.info("COUNT_PM is messed.") await ultroid_bot(BlockRequest(user.id)) await ultroid_bot(ReportSpamRequest(peer=user.id)) name = await ultroid_bot.get_entity(user.id) name0 = str(name.first_name) await asst.edit_message( int(udB.get("LOG_CHANNEL")), _not_approved[user.id], f"**[{name0}](tg://user?id={user.id})** [`{user.id}`] was Blocked for spamming.", )
async def gspider(rk): lazy = rk sender = await lazy.get_sender() me = await lazy.client.get_me() if not sender.id == me.id: rkp = await lazy.reply("`processing...`") else: rkp = await lazy.edit("`processing...`") me = await rk.client.get_me() await rkp.edit(f"**Global Banning User!!**") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await rk.get_chat() a = b = 0 if rk.is_private: user = rk.chat reason = rk.pattern_match.group(1) else: rk.chat.title try: user, reason = await get_user_from_event(rk) except BaseException: pass try: if not reason: reason = "Private" except BaseException: return await rkp.edit("**Error! Unknown user.**") if user: if user.id == 719195224: return await rkp.edit("**Error! cant gban this user.**") try: from telebot.plugins.sql_helper.gmute_sql import gmute except BaseException: pass try: await rk.client(BlockRequest(user)) except BaseException: pass testrk = [ d.entity.id for d in await rk.client.get_dialogs() if (d.is_group or d.is_channel) ] await rkp.edit(f"**Gbanning user!\nIn progress...**") for i in testrk: try: await rk.client.edit_permissions(i, user, view_messages=False) a += 1 except BaseException: b += 1 else: await rkp.edit(f"**Reply to a user !! **") try: if gmute(user.id) is False: return await rkp.edit(f"**Error! User probably already gbanned.**") except BaseException: pass return await rkp.edit( f"**Gbanned** [{user.first_name}](tg://user?id={user.id}) **\nChats affected - {a}\nBlocked user and added to Gban watch **" )
async def gspider(FreakyUserbot): lol = FreakyUserbot sender = await lol.get_sender() me = await lol.client.get_me() if not sender.id == me.id: Freaky = await lol.reply("Gbanning This User !") else: Freaky = await lol.edit("Wait Processing.....") me = await FreakyUserbot.client.get_me() await Freaky.edit(f"Global Banning!") my_mention = "[{}](tg://user?id={})".format(me.first_name, me.id) f"@{me.username}" if me.username else my_mention await FreakyUserbot.get_chat() a = b = 0 if FreakyUserbot.is_private: user = FreakyUserbot.chat reason = FreakyUserbot.pattern_match.group(1) else: FreakyUserbot.chat.title try: user, reason = await get_full_user(FreakyUserbot) except: pass try: if not reason: reason = "Private" except: return await Freaky.edit(f"**Something W3NT Wrong 🤔**") if user: if user.id == 1228116248: return await Freaky.edit( f"**Didn't , Your Father Teach You ? That You Cant Gban Dev**") try: from FreakyUserbot.modules.sql_helper.gmute_sql import gmute except: pass try: await FreakyUserbot.client(BlockRequest(user)) except: pass testFreakyUserbot = [ d.entity.id for d in await FreakyUserbot.client.get_dialogs() if (d.is_group or d.is_channel) ] for i in testFreakyUserbot: try: await FreakyUserbot.client.edit_permissions( i, user, view_messages=False) a += 1 await Freaky.edit( f"**GBANNED // Total Affected Chats **: `{a}`") except: b += 1 else: await Freaky.edit(f"**Reply to a user !!**") try: if gmute(user.id) is False: return await Freaky.edit( f"**Error! User probably already gbanned.**") except: pass return await Freaky.edit( f"**Freaky Gbanned [{user.first_name}](tg://user?id={user.id}) And Added To SpamWatch In The Chats Where Me Is Admin/Owner : {a} **" )