personal queue
This commit is contained in:
17
services/staffSettings.js
Normal file
17
services/staffSettings.js
Normal 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 };
|
||||
Reference in New Issue
Block a user