Added crop and loop, fixed database not properly adding new commands
This commit is contained in:
parent
10e934e722
commit
0ebd0a0cee
9 changed files with 115 additions and 14 deletions
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue