-
Notifications
You must be signed in to change notification settings - Fork 685
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
22 additions
and
12 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 |
---|---|---|
@@ -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; |