Added crop and loop, fixed database not properly adding new commands

This commit is contained in:
TheEssem 2020-07-23 17:43:39 -05:00
parent 10e934e722
commit 0ebd0a0cee
9 changed files with 115 additions and 14 deletions

View file

@ -55,7 +55,7 @@ module.exports = async () => {
} else {
for (const command of collections.commands.keys()) {
const count = await database.query("SELECT * FROM counts WHERE command = $1", [command]);
if (!count) {
if (!count.rows[0]) {
await database.query("INSERT INTO counts (command, count) VALUES ($1, $2)", [command, 0]);
}
}