Skip to content

Commit

Permalink
Tag/Nomor?
Browse files Browse the repository at this point in the history
  • Loading branch information
ImYanXiao authored Oct 8, 2024
1 parent f4d5bbb commit c18991e
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions plugins/owner-unbanuser.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
let handler = async (m, { conn, text }) => {
if (!text) throw 'Who wants to be unbanned?'
let who
if (m.isGroup) who = m.mentionedJid[0]
else who = m.chat
if (!who) throw 'Tag??'
let users = global.db.data.users
users[who].banned = false
conn.reply(m.chat, 'sᴜᴄᴄᴇs!', m)
let who;
if (m.isGroup) {
if (m.mentionedJid.length > 0) {
who = m.mentionedJid[0];
} else {
let cleanedNumber = text.replace(/\D/g, '');
who = `${cleanedNumber}@s.whatsapp.net`;
}
} else {
let cleanedNumber = text.replace(/\D/g, '');
who = `${cleanedNumber}@s.whatsapp.net`;
}

let users = db.data.users;
if (!users[who]) throw 'Pengguna tidak ditemukan';

users[who].banned = false;
conn.reply(m.chat, `Pengguna dengan nomor ${who} telah diunban!`, m);
}
handler.help = ['unban']

handler.help = ['unban <nomor>']
handler.tags = ['owner']
handler.command = /^unban(user)?$/i
handler.rowner = true
Expand Down

0 comments on commit c18991e

Please sign in to comment.