Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669442yWhat 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? -
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? -
@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.
Related Rants
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
}
rant
whatsapp