forked from BOTCAHX/RTXZY-MD
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
let handler = async (m, { conn, args }) => { | ||
let chats = global.db.data.chats; | ||
|
||
let mutedChats = Object.entries(chats).filter(([_, chat]) => chat.isBanned); | ||
if (args[0]) { | ||
let index = parseInt(args[0]) - 1; | ||
if (isNaN(index) || index < 0 || index >= mutedChats.length) { | ||
return m.reply('Nomor yang kamu masukkan tidak valid.'); | ||
} | ||
|
||
let [chatId] = mutedChats[index]; | ||
chats[chatId].isBanned = false; | ||
m.reply(`Berhasil meng-unmute grup dengan ID: ${chatId}`); | ||
} else { | ||
if (mutedChats.length === 0) { | ||
m.reply('Tidak ada grup yang sedang di-mute.'); | ||
} else { | ||
let list = mutedChats.map(([id], i) => `${i + 1}. ${id}`).join('\n'); | ||
m.reply(`Daftar grup yang di-mute:\n\n${list}\n\nKetik *listmute [nomor]* untuk meng-unmute.`); | ||
} | ||
} | ||
}; | ||
|
||
handler.help = ['listmute']; | ||
handler.tags = ['owner']; | ||
handler.command = ['listmute']; | ||
handler.owner = true; | ||
|
||
module.exports = handler; |