change psql-lib from knex to postgres.js

This commit is contained in:
Flummi
2022-03-31 13:34:51 +02:00
parent f750a9a60f
commit c498a33cbe
20 changed files with 689 additions and 973 deletions

View File

@ -1,4 +1,4 @@
import sql from "../sql.mjs";
import db from "../sql.mjs";
import lib from "../lib.mjs";
import cfg from "../config.mjs";
@ -7,10 +7,10 @@ export default async bot => {
return [{
name: "f0ckrand",
call: /^gib f0ck/i,
active: true,
active: false,
f: async e => {
let args = e.args.slice(1);
let rows = sql("items").select("id", "username", "mime", "size");
/*let rows = sql("items").select("id", "username", "mime", "size");
for(let i = 0; i < args.length; i++) {
if(args[i].charAt(0) === "!")
@ -19,7 +19,7 @@ export default async bot => {
rows = rows.where("username", "ilike", args[i]);
}
rows = await rows.orderByRaw("random()").limit(1);
rows = await rows.orderByRaw("random()").limit(1);*/
if(rows.length === 0)
return e.reply("nothing found, f0cker");