querybuilder intensifies

This commit is contained in:
Flummi
2021-05-16 13:24:31 +02:00
parent 3bc0a74932
commit 04d4787232
16 changed files with 244 additions and 410 deletions

View File

@@ -14,14 +14,14 @@ export default async bot => {
if(id <= 0)
return false;
const f0ck = await sql.query("select dest from items where id = ? limit 1", [ id ]);
const f0ck = await sql("items").select("dest").where("id", id).limit(1);
if(f0ck.length === 0)
return false;
await fs.unlink(`./public/b/${f0ck[0].dest}`).catch(_=>{});
await fs.unlink(`./public/t/${id}`).catch(_=>{});
await sql.query("delete from items where id = ? limit 1", [ id ]);
await sql("items").where("id", id).del().limit(1);
return id;
}))).filter(d => d);
@@ -29,7 +29,7 @@ export default async bot => {
if(ret.length > 0)
e.reply(`deleted ${ret.length}/${e.args.length} (${ret.join(",")}) f0cks`);
else
e.reply(`oof`)
e.reply(`oof`);
}
}]
};