async def unmute(unmot): if not unmot.text[0].isalpha() and unmot.text[0] not in ("/", "#", "@", "!"): from userbot.modules.sql_helper.spam_mute_sql import unmute unmute(unmot.chat_id, str((await unmot.get_reply_message()).sender_id)) await unmot.edit("```Unmuted Successfully```")
async def unmoot(unmot): if not unmot.text[0].isalpha() and unmot.text[0] \ not in ("/", "#", "@", "!"): rights = ChatBannedRights( until_date=None, send_messages=None, send_media=None, send_stickers=None, send_gifs=None, send_games=None, send_inline=None, embed_links=None, ) replymsg = await unmot.get_reply_message() from userbot.modules.sql_helper.spam_mute_sql import unmute unmute(unmot.chat_id, replymsg.sender_id) try: await unmot.client(EditBannedRequest( unmot.chat_id, replymsg.sender_id, rights )) await unmot.edit("```Unmuted Successfully```") except UserIdInvalidError: await unmot.edit("`Uh oh my unmute logic broke!`")
async def unmoot(unmot): if not unmot.text[0].isalpha() and unmot.text[0] \ not in ("/", "#", "@", "!"): rights = ChatBannedRights( until_date=None, send_messages=None, send_media=None, send_stickers=None, send_gifs=None, send_games=None, send_inline=None, embed_links=None, ) replymsg = await unmot.get_reply_message() from userbot.modules.sql_helper.spam_mute_sql import unmute unmute(unmot.chat_id, replymsg.sender_id) try: await unmot.client( EditBannedRequest(unmot.chat_id, replymsg.sender_id, rights)) await unmot.edit("```Ab Kar Le Bakwas```") if LOGGER: await unmot.client.send_message( LOGGER_GROUP, "#MUTE\n" + "ID: `" + str( (await unmot.get_reply_message()).sender_id) + "`", ) except UserIdInvalidError: await unmot.edit("`Uh oh my unmute logic broke!`")
async def unmoot(unmot): """ For .unmute command, unmute the target """ if not unmot.text[0].isalpha() and unmot.text[0] \ not in ("/", "#", "@", "!"): rights = ChatBannedRights( until_date=None, send_messages=None, send_media=None, send_stickers=None, send_gifs=None, send_games=None, send_inline=None, embed_links=None, ) # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit('```Unmuting...```') user = await get_user_from_event(unmot) if user: pass else: return unmute(unmot.chat_id, user.id) try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, rights)) await unmot.edit("```Unmuted Successfully```") except UserIdInvalidError: await unmot.edit("`Uh oh my unmute logic broke!`") return if LOGGER: await unmot.client.send_message( LOGGER_GROUP, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): if not unmot.text[0].isalpha() and unmot.text[0] not in ("/", "#", "@", "!"): rights = ChatBannedRights( until_date=None, send_messages=None, send_media=None, send_stickers=None, send_gifs=None, send_games=None, send_inline=None, embed_links=None, ) from userbot.modules.sql_helper.spam_mute_sql import unmute unmute(unmot.chat_id, str((await unmot.get_reply_message()).sender_id)) await bot(EditBannedRequest(unmot.chat_id, unmot.sender_id, rights)) await unmot.edit("```Unmuted Successfully```")
async def unmoot(unmot): """ For .unmute command, unmute the target """ if not unmot.text[0].isalpha() and unmot.text[0] \ not in ("/", "#", "@", "!"): # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit('```Unmuting...```') user = await get_user_from_event(unmot) if user: pass else: return unmute(unmot.chat_id, user.id) try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Unmuted Successfully by peru RubyRox!```") except UserIdInvalidError: await unmot.edit("`Uh oh my unmute logic broke!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(event): if event.fwd_from: return if not event.is_group: poppo = await edit_or_reply(event, "`I don't think this is a group.`") return """ For .unmute command, unmute the replied/tagged person """ # Admin or creator check chat = await event.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: poppo = await edit_or_reply(event, NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: poppo = await edit_or_reply(event, NO_SQL) return # If admin or creator, inform the user and start unmuting poppo = await edit_or_reply(event, "```Unmuting...```") user = await get_user_from_event(event) user = user[0] if user: pass else: return if unmute(event.chat_id, user.id) is False: return await poppo.edit("`Error! User probably already unmuted.`") else: try: await event.client( EditBannedRequest(event.chat_id, user.id, UNBAN_RIGHTS)) await poppo.edit("```Unmuted Successfully```") except UserIdInvalidError: await poppo.edit("`Uh oh my unmute logic broke!`") return if BOTLOG: await event.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {event.chat.title}(`{event.chat_id}`)", )
async def unmoot(unmot): #Prevent Channel Bug to unmute if unmot.is_channel and not unmot.is_group: await unmot.edit("`unmute Commad isn't permitted on channels`") return """ For .unmute command, unmute the replied/tagged person """ # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit('```Unmuting...```') user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Error! User probably already unmuted.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Unmuted Successfully```") await sleep(3) await unmot.delete() except UserIdInvalidError: await unmot.edit("`Uh oh my unmute logic broke!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): """ For .unmute command, unmute the replied/tagged person """ # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit("```Desmutando...```") user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit( "`Erro! O usuário provavelmente já está desmutado.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Desmutado com sucesso```") except UserIdInvalidError: await unmot.edit("`Oh oh, minha lógica para desmutar quebrou!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): """ Untuk Unmute Gunakan .unmute """ # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit("```Proses Unmute...```") user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Error! User sudah di unmute sebelumnya.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Sukses unmute```") except UserIdInvalidError: await unmot.edit("`Hmmmm. Tenaga unmute saya rusak!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): """ For .unmute command, unmute the replied/tagged person """ # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit('```Melepas lakban...```') user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit( "`Kesalahan! Pengguna mungkin sudah disuarakan.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Berhasil melepas lakban```") await sleep(3) await unmot.delete() except UserIdInvalidError: await unmot.edit("`Uh logika suaraku rusak!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): """For .unmute command, unmute the replied/tagged person""" # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: return await unmot.edit(NO_ADMIN) # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: return await unmot.edit(NO_SQL) # If admin or creator, inform the user and start unmuting await unmot.edit("`Menyuarakan kembali...`") user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit( f"**Kesalahan** : [{user.first_name}](tg://user?id={user.id}) mungkin sudah tidak dibisukan." ) else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("`Berhasil disuarakan`") except UserIdInvalidError: return await unmot.edit("`Logika saya untuk menyuarakan rusak!`") except UserAdminInvalidError: pass if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"PENGGUNA : [{user.first_name}](tg://user?id={user.id})\n" f"OBROLAN : {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): """ .unmute komutu belirlenin kişinin sesini açar (yani grupta tekrardan konuşabilir) """ # Yetki kontrolü chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # Yönetici değil ise geri dön if not admin and not creator: await unmot.edit(NO_ADMIN) return # Fonksiyonun SQL modu altında çalışıp çalışmadığını kontrol et try: from userbot.modules.sql_helper.spam_mute_sql import unmute except: await unmot.edit(NO_SQL) return await unmot.edit('```CeteBot Kullanıcıyı Sessizden çıkartıyor...```') user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Hata! Kullanıcı zaten sessizden çıkarıldı.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("`Konuşabilirsin bir daha dikkatli ol :)!`") except UserAdminInvalidError: await unmot.edit("`Konuşabilirsin bir daha dikkatli ol :)!`") except: await unmot.edit( "`Sanırım bu kişi sessizden çıkarma mantığım ile uyuşmuyor`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"KULLANICI: [{user.first_name}](tg://user?id={user.id})\n" f"GRUP: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): """ .unmute komutu belirlenin kişinin sesini açar (yani grupta tekrardan konuşabilir) """ # Yetki kontrolü chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # Yönetici değil ise geri dön if not admin and not creator: await unmot.edit(NO_ADMIN) return # Fonksiyonun SQL modu altında çalışıp çalışmadığını kontrol et try: from userbot.modules.sql_helper.spam_mute_sql import unmute except: await unmot.edit(NO_SQL) return await unmot.edit(LANG['UNMUTING']) user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit(LANG['ALREADY_UNMUTED']) else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit(LANG['UNMUTED']) except UserAdminInvalidError: await unmot.edit(LANG['UNMUTED']) except: await unmot.edit(LANG['WTF_MUTE']) return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"KULLANICI: [{user.first_name}](tg://user?id={user.id})\n" f"GRUP: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: return await unmot.edit(NO_ADMIN) # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: return await unmot.edit(NO_SQL) # If admin or creator, inform the user and start unmuting await unmot.edit("```➳ Melakukan Unmute... ```") user = await get_user_from_event(unmot) user = user[0] if not user: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit( "`➳ Kesalahan! Pengguna Sudah Tidak Dibisukan. ❧`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit( "```➳ Berhasil Melakukan Unmute! User Sudah Tidak Lagi Dibisukan ```" ) await sleep(3) await unmot.delete() except UserIdInvalidError: return await unmot.edit("`➳ Terjadi Kesalahan! `") if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"PENGGUNA: [{user.first_name}](tg://user?id={user.id})\n" f"GRUP: {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): """For .unmute command, unmute the replied/tagged person""" # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: return await unmot.edit(NO_ADMIN) # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: return await unmot.edit(NO_SQL) # If admin or creator, inform the user and start unmuting await unmot.edit("```Nimbrung sini deh...```") user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Error! User probably already unmuted.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit(f"```✓ {user.first_name} Berhasil Di Unmute!```") except UserIdInvalidError: return await unmot.edit("`Uh oh my unmute logic broke!`") except UserAdminInvalidError: pass if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"USER: [{user.first_name}](tg://user?id={user.id})\n" f"CHAT: {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): """Команда .unmute размутить реплайнутого/тэгнутого пользователя""" # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: await unmot.edit(NO_ADMIN) return # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: await unmot.edit(NO_SQL) return # If admin or creator, inform the user and start unmuting await unmot.edit('```Размут...```') user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Ошибка! Пользователь возможно уже размучен.`" ) else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Размут успешен```") except UserIdInvalidError: await unmot.edit("`Ох, моя логика размута сломалась!`") return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#РАЗМУТ\n" f"ПОЛЬЗОВАТЕЛЬ: [{user.first_name}](tg://user?id={user.id})\n" f"ЧАТ: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmoot(unmot): # Admin or creator check chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator # If not admin and not creator, return if not admin and not creator: return await unmot.edit(NO_ADMIN) # Check if the function running under SQL mode try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: return await unmot.edit(NO_SQL) # If admin or creator, inform the user and start unmuting await unmot.edit("```Membuka lakban...```") user = await get_user_from_event(unmot) user = user[0] if not user: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit("`Error! User probably already unmuted.`") else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit("```Membuka lakban sukses```") await sleep(3) await unmot.delete() except UserIdInvalidError: return await unmot.edit("`Uh oh my unmute logic broke!`") if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"PENGGUNA: [{user.first_name}](tg://user?id={user.id})\n" f"OBROLAN: {unmot.chat.title}(`{unmot.chat_id}`)", )
async def unmoot(unmot): chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator if not admin and not creator: return await edit_delete(unmot, NO_ADMIN) try: from userbot.modules.sql_helper.spam_mute_sql import unmute except AttributeError: return await unmot.edit(NO_SQL) man = await edit_or_reply(unmot, "`Processing...`") user = await get_user_from_event(unmot) user = user[0] if not user: return if unmute(unmot.chat_id, user.id) is False: return await edit_delete(unmot, "**ERROR! Pengguna Sudah Tidak Dibisukan.**") try: await unmot.client(EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await edit_delete(man, "**Berhasil Melakukan Unmute!**") except UserIdInvalidError: return await edit_delete(man, "**Terjadi ERROR!**")
async def unmoot(unmot): chat = await unmot.get_chat() admin = chat.admin_rights creator = chat.creator if not admin and not creator: await unmot.edit(NO_ADMIN) return try: from userbot.modules.sql_helper.spam_mute_sql import unmute except: await unmot.edit(NO_SQL) return await unmot.edit(LANG['UNMUTING']) user = await get_user_from_event(unmot) user = user[0] if user: pass else: return if unmute(unmot.chat_id, user.id) is False: return await unmot.edit(LANG['ALREADY_UNMUTED']) else: try: await unmot.client( EditBannedRequest(unmot.chat_id, user.id, UNBAN_RIGHTS)) await unmot.edit(LANG['UNMUTED'].format( id=user.id, username='******' + user.username if user.username else f"[{user.first_name}](tg://user?id={user.id})", first_name=user.first_name, last_name='' if not user.last_name else user.last_name, mention=f"[{user.first_name}](tg://user?id={user.id})", date=datetime.datetime.strftime(datetime.datetime.now(), '%c'), count=(chat.participants_count) if chat.participants_count else 'Bilinmir')) except UserAdminInvalidError: await unmot.edit(LANG['UNMUTED'].format( id=user.id, username='******' + user.username if user.username else f"[{user.first_name}](tg://user?id={user.id})", first_name=user.first_name, last_name='' if not user.last_name else user.last_name, mention=f"[{user.first_name}](tg://user?id={user.id})", date=datetime.datetime.strftime(datetime.datetime.now(), '%c'), count=(chat.participants_count) if chat.participants_count else 'Bilinmir')) except: await unmot.edit(LANG['WTF_MUTE']) return if BOTLOG: await unmot.client.send_message( BOTLOG_CHATID, "#UNMUTE\n" f"İSTİFADƏCİ: [{user.first_name}](tg://user?id={user.id})\n" f"QRUP: {unmot.chat.title}(`{unmot.chat_id}`)")
async def unmute(e): if not e.text[0].isalpha() and e.text[0] != "!" and e.text[ 0] != "/" and e.text[0] != "#" and e.text[0] != "@": from userbot.modules.sql_helper.spam_mute_sql import unmute unmute(e.chat_id, str((await e.get_reply_message()).sender_id)) await e.edit("```Unmuted Successfully```")