personal queue

This commit is contained in:
indifferentketchup
2026-03-28 20:07:17 -05:00
parent 8a4e306f28
commit 6b4fd65d4b
8 changed files with 300 additions and 53 deletions

17
services/staffSettings.js Normal file
View File

@@ -0,0 +1,17 @@
const { mongoose } = require('../db-connection');
const StaffSettings = mongoose.model('StaffSettings');
async function getNotifyDm(userId) {
const doc = await StaffSettings.findOne({ userId }).lean();
return doc ? doc.notifyDm : false;
}
async function setNotifyDm(userId, guildId, value) {
await StaffSettings.findOneAndUpdate(
{ userId },
{ $set: { notifyDm: value, guildId, updatedAt: new Date() } },
{ upsert: true, new: true }
);
}
module.exports = { getNotifyDm, setNotifyDm };