async def nsfw_watch(event): if not event.is_group: await event.reply("You Can Only Nsfw Watch in Groups.") return input_str = event.pattern_match.group(1) if not await is_admin(event, BOT_ID): await event.reply("`I Should Be Admin To Do This!`") return if await is_admin(event, event.message.sender_id): if (input_str == "on" or input_str == "On" or input_str == "ON" or input_str == "enable"): if is_nsfwatch_indb(str(event.chat_id)): await event.reply("`This Chat Has Already Enabled Nsfw Watch.`" ) return add_nsfwatch(str(event.chat_id)) await event.reply( f"**Added Chat {event.chat.title} With Id {event.chat_id} To Database. This Groups Nsfw Contents Will Be Deleted**" ) elif (input_str == "off" or input_str == "Off" or input_str == "OFF" or input_str == "disable"): if not is_nsfwatch_indb(str(event.chat_id)): await event.reply("This Chat Has Not Enabled Nsfw Watch.") return rmnsfwatch(str(event.chat_id)) await event.reply( f"**Removed Chat {event.chat.title} With Id {event.chat_id} From Nsfw Watch**" ) else: await event.reply( "I undestand `/nsfwguardian on` and `/nsfwguardian off` only") else: await event.reply("`You Should Be Admin To Do This!`") return
async def ws(event): warner_starkz = get_all_nsfw_enabled_chat() if len(warner_starkz) == 0: return if not is_nsfwatch_indb(str(event.chat_id)): return if not (event.photo): return if not await is_admin(event, BOT_ID): return if await is_admin(event, event.message.sender_id): return sender = await event.get_sender() await event.client.download_media(event.photo, "nudes.jpg") img = "./nudes.jpg" f = {"file": (img, open(img, "rb"))} r = requests.post("https://starkapi.herokuapp.com/nsfw/", files=f).json() if r.get("success") is False: is_nsfw = False elif r.get("is_nsfw") is True: is_nsfw = True elif r.get("is_nsfw") is False: is_nsfw = False return is_nsfw if is_nsfw == True: await event.delete() st = sender.first_name hh = sender.id final = f"**NSFW DETECTED**\n\n[{st}](tg://user?id={hh}) your message contain NSFW content.. So, Daisy deleted the message\n\n **Nsfw Sender - User / Bot :** [{st}](tg://user?id={hh}) \n\n`⚔️Automatic Detections Powered By DaisyAI` \n**#GROUP_GUARDIAN** " dev = await event.respond(final) await asyncio.sleep(30) await dev.delete() os.remove("nudes.jpg")
async def ws(event): warner_starkz = get_all_nsfw_enabled_chat() if len(warner_starkz) == 0: return if not is_nsfwatch_indb(str(event.chat_id)): return if not (event.photo): return if not await is_admin(event, BOT_ID): return if await is_admin(event, event.message.sender_id): return sender = await event.get_sender() await event.client.download_media(event.photo, "nudes.jpg") if nude.is_nude("./nudes.jpg"): await event.delete() st = sender.first_name hh = sender.id final = f"**NSFW DETECTED**\n\n{st}](tg://user?id={hh}) your message contain NSFW content.. So, Daisy deleted the message\n\n **Nsfw Sender - User / Bot :** {st}](tg://user?id={hh}) \n\n`⚔️Automatic Detections Powered By DaisyAI` \n**#GROUP_GUARDIAN** " dev = await event.respond(final) await asyncio.sleep(10) await dev.delete() os.remove("nudes.jpg")