replace pg-promise with pg

This commit is contained in:
Flummi
2019-08-22 09:56:16 +00:00
parent 1f194e8267
commit 8c5fb99cd3
10 changed files with 60 additions and 73 deletions

View File

@@ -6,12 +6,10 @@ const data = {
};
export default async bot => {
Object.keys(data).forEach(cur => {
sql.any("select data from useless where trigger = $1 limit 1", [cur])
.then(rows => {
data[cur] = JSON.parse(rows[0].data);
});
});
for(const cur in data) {
const rows = (await sql.query("select data from useless where trigger = $1 limit 1", [cur])).rows[0];
data[cur] = JSON.parse(rows.data);
}
return [{
name: "dope",