aboutsummaryrefslogtreecommitdiff
path: root/db.js
diff options
context:
space:
mode:
Diffstat (limited to 'db.js')
-rw-r--r--db.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/db.js b/db.js
index 58673bc..26e3d97 100644
--- a/db.js
+++ b/db.js
@@ -50,6 +50,17 @@ class DB {
});
});
+ fs.readFile(__dirname + "/mottos.txt", "utf8", (err, data) => {
+ if (err) throw err;
+
+ const mottos = data.split("\n");
+ mottos.forEach(async (motto) => {
+ const [name, desc] = motto.split(" - ");
+ if (motto)
+ await this.query("INSERT INTO motto_votes (name, description) VALUES (?, ?)", [name, desc]);
+ });
+ });
+
const classes = data.split("--");
const userPasswords = {};
console.log("Generating users");