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 fd23e5c commit f4d5bbb
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions plugins/owner-banuser.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
// import db from '../lib/database.js'

let handler = async (m, { conn, text }) => {
if (!text) throw 'Siapa yang mau di banned?🗿'
let who
if (m.isGroup) who = m.mentionedJid[0]
else who = m.chat
if (!who) throw 'Tag salah satu bang'
let users = db.data.users
users[who].banned = true
conn.reply(m.chat, `mampos dibanned awowkwkowkw`, m)
if (!text) throw 'Siapa yang mau di banned?🗿';
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 = true;
conn.reply(m.chat, `Pengguna dengan nomor ${who} telah dibanned!`, m);
}
handler.help = ['ban @user']

handler.help = ['ban <nomor>']
handler.tags = ['owner']
handler.command = /^ban$/i
handler.rowner = true

export default handler
export default handler;

0 comments on commit f4d5bbb

Please sign in to comment.