From 103ba1ec1851cc225b836d8bb375f273d88dd743 Mon Sep 17 00:00:00 2001 From: Lantium Date: Thu, 7 Apr 2022 22:55:32 +0200 Subject: [PATCH 1/6] add config example js --- .gitignore | 2 - commands/core/todo.js | 78 +++---- commands/core/todoMP.js | 2 +- config.example.js | 25 +++ config.js | 6 +- main.js | 10 + package-lock.json | 452 ++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 8 files changed, 524 insertions(+), 52 deletions(-) create mode 100644 config.example.js diff --git a/.gitignore b/.gitignore index 043b43c..f1c87a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ .nvmrc node_modules -config.js -config.js diff --git a/commands/core/todo.js b/commands/core/todo.js index 7cd61ff..d93d696 100644 --- a/commands/core/todo.js +++ b/commands/core/todo.js @@ -1,10 +1,16 @@ const ms = require("ms"); -const fs = require("fs"); -const path = require("path"); const uuid = require("uuid").v4; +const mongoose = require("mongoose"); -const dbFileName = path.resolve(".", "utils", "todo.json"); -let database = []; +const todoSchema = new mongoose.Schema({ + uuid: String, + author: String, + time: String, + channel: String, + guild: String, + message: String, +}); +const Todo = mongoose.model("Todo", todoSchema); module.exports = { name: "todo", @@ -12,9 +18,9 @@ module.exports = { utilisation: "{prefix}todo