async def handler(tele): if tele.user_joined or tele.user_added: try: from userbot.plugins.sql_helper.gmute_sql import is_gmuted guser = await tele.get_user() gmuted = is_gmuted(guser.id) except BaseException: return if gmuted: for i in gmuted: if i.sender == str(guser.id): chat = await tele.get_chat() admin = chat.admin_rights creator = chat.creator if admin or creator: try: await client.edit_permissions(tele.chat_id, guser.id, view_messages=False) await tele.reply( f"** Gbanned User Joined!!** \n" f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n" f"**Action ** : `Banned`") except BaseException: return
async def handler(h1m4n5hu0p): if h1m4n5hu0p.user_joined or h1m4n5hu0p.user_added: try: from userbot.plugins.sql_helper.gmute_sql import is_gmuted guser = await h1m4n5hu0p.get_user() gmuted = is_gmuted(guser.id) except: return if gmuted: for i in gmuted: if i.sender == str(guser.id): chat = await h1m4n5hu0p.get_chat() admin = chat.admin_rights creator = chat.creator if admin or creator: try: await client.edit_permissions(h1m4n5hu0p.chat_id, guser.id, view_messages=False) await h1m4n5hu0p.reply( f"⚠️⚠️**Warning**⚠️⚠️\n\n`Gbanned User Joined the chat!!`\n" f"**⚜️ Victim Id ⚜️**:\n[{guser.id}](tg://user?id={guser.id})\n" f"**🔥 Action 🔥** :\n`Banned this piece of shit....` **AGAIN!**" ) except: h1m4n5hu0p.reply( "`Shit!! No permission to ban users.\n@admins ban this retard.\nGlobally Banned User And A Potential Spammer`\n**Make your group a safe place by cleaning this shit**" ) return
async def muter(moot): """ Used for deleting the messages of muted people """ try: from userbot.plugins.sql_helper.mute_sql import is_muted from userbot.plugins.sql_helper.gmute_sql import is_gmuted except AttributeError: return muted = is_muted(moot.chat_id) gmuted = is_gmuted(moot.sender_id) rights = ChatBannedRights( until_date=None, send_messages=True, send_media=True, send_stickers=True, send_gifs=True, send_games=True, send_inline=True, embed_links=True, ) if muted: for i in muted: if str(i.sender) == str(moot.sender_id): await moot.delete() await moot.client( EditBannedRequest(moot.chat_id, moot.sender_id, rights)) for i in gmuted: if i.sender == str(moot.sender_id): await moot.delete()
async def endgmute(event): private = False if event.is_private: await eor(event, "`Trying to ungmute !!`") await asyncio.sleep(2) private = True reply = await event.get_reply_message() if event.pattern_match.group(1) is not None: userid = event.pattern_match.group(1) elif reply is not None: userid = reply.sender_id elif private is True: userid = event.chat_id else: return await eod( event, "Please reply to a user or add their into the command to ungmute them.", ) name = (await event.client.get_entity(userid)).first_name event.chat_id if not gsql.is_gmuted(userid, "gmute"): return await eod(event, "I don't remember I gmuted him...") try: gsql.ungmute(userid, "gmute") except Exception as e: await eod(event, "Error occured!\nError is " + str(e)) else: await eor(event, f"**Unmuted [{name}](tg://user?id={userid}) Globally !!**")
async def handler(rkG): if rkG.user_joined or rkG.user_added: try: from userbot.plugins.sql_helper.gmute_sql import is_gmuted guser = await rkG.get_user() gmuted = is_gmuted(guser.id) except: return if gmuted: for i in gmuted: if i.sender == str(guser.id): chat = await rkG.get_chat() admin = chat.admin_rights creator = chat.creator if admin or creator: try: await client.edit_permissions(rkG.chat_id, guser.id, view_messages=False) await rkG.reply( f"**Gbanned User(the ultimate nub nibba) Joined the chat!!** \n" f"**Victim Id**: [{guser.id}](tg://user?id={guser.id})\n" f"**Action ** : `Banned this nub nibba again...Sed`" ) except: rkG.reply( "`No Permission To Ban.. @admins please ban him he is a globally banned user and a potential spammer...!`" ) return
async def gm(event): private = False if event.fwd_from: return elif event.is_private: await eor(event, "`Trying to gmute user...`") await asyncio.sleep(2) private = True reply = await event.get_reply_message() if event.pattern_match.group(1) is not None: userid = event.pattern_match.group(1) elif reply is not None: userid = reply.sender_id elif private is True: userid = event.chat_id else: return await eod( event, "Need a user to gmute. Reply or give userid to gmute them..") name = (await event.client.get_entity(userid)).first_name event.chat_id await event.get_chat() if gsql.is_gmuted(userid, "gmute"): return await eod(event, "This kid is already Gmuted.") try: if str(userid) in DEVLIST: return await eod(event, "**Sorry I'm not going to gmute them..**") except: pass try: gsql.gmute(userid, "gmute") except Exception as e: await eod(event, "Error occured!\nError is " + str(e)) else: if Config.ABUSE == "ON": await bot.send_file( event.chat_id, chup_pic, caption= f"**(~‾▿‾)~ Ab Chup Rah[GMUTE](tg://user?id={userid}) ....**", reply_to=reply, ) await event.delete() else: await eor( event, f"**Globally Muted [{name}](tg://user?id={userid}) !!**\n\n__Kid struggling to speak__ ♪~(´ε` )", )
async def watcher(event): try: if gsql.is_gmuted(event.sender_id, "gmute"): await event.delete() except Exception as e: LOGS.info(str(e))