mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 05:17:51 +08:00
added bot dao
This commit is contained in:
parent
9926c561ac
commit
116d7c8cdb
1 changed files with 11 additions and 0 deletions
11
backend/dao/botDAO.js
Normal file
11
backend/dao/botDAO.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
const MonkeyError = require("../handlers/error");
|
||||
const { mongoDB } = require("../init/mongodb");
|
||||
class BotDAO {
|
||||
static async addCommand(command, arguments) {
|
||||
return await mongoDB()
|
||||
.collection("bot-commands")
|
||||
.insertOne({ command, arguments, executed: false, requestTimestamp: Date.now() });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = BotDAO;
|
Loading…
Reference in a new issue