8

case "addprem" : {

if (isGroup) return reply('This command can only be used in private chat!')
if (args.length < 2) return reply(`Kirim perintah : ${command} number|total`)
if (!q.includes('|')) return reply(`Incorrect usage, use the | . symbol`)
var numb = q.split('|')[0]
var total = q.split('|')[1]
var number = numb.replace(/[+| |(|)|.|-]/gi, "")
if (isNaN(parseInt(number))) return reply('Thats not your numberšŸ˜„')
reply('Success')
let addprems = [];
var object_buy = {
ID: pushname,
number: number,
session: total
}
fs.writeFile(addprems, JSON.stringify(object_buy, null, 3))
break
}

Comments
  • 4
    What in the shitfuck?

    1) At least format it....
    2) is this some kind of flex or "what's wrong with my codez"
    3) what's a WhatsApp?
  • 6
    @C0D4 whatsapp case
  • 0
    1. const [numb, total] = q.split('|')
    2. Var is old, let it die
    3. Use curly braces, it's easier for git diff and more consistent
    4. Addprems is never written to
    5. Writefile has no callback and is never awaited, is it sync?
  • 0
    @alexbrooklyn
    fs.writeFile(name: string, data: any, callback: (e: Error|undefined) => void): void

    He really fucked that call up.

    Unless he imported fs/promises as fs which is bad form precisely because the API looks almost exactly like the callback hell variant except everything breaks if you try to use it that way.
  • 1
    Looks exactly how my old Whatsapp bots used to look ×_×
Add Comment