|
|
|
@ -345,7 +345,6 @@ exports.updateFeed = (bot)=>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.strikeDashboard = (bot)=>
|
|
|
|
|
{
|
|
|
|
|
return async (req, res)=>
|
|
|
|
@ -373,7 +372,7 @@ exports.strikeDashboard = (bot)=>
|
|
|
|
|
strikes.push(aux);
|
|
|
|
|
}));
|
|
|
|
|
// console.log(strikes)
|
|
|
|
|
res.render('strikesDashboard.ejs', {strikes, guild, moderator})
|
|
|
|
|
res.render('strikesDashboard.ejs', {strikes, guild, moderator, params:req.params})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.updateStrikes = (bot)=>
|
|
|
|
@ -382,8 +381,27 @@ exports.updateStrikes = (bot)=>
|
|
|
|
|
{
|
|
|
|
|
const moderator = req.params.userid;
|
|
|
|
|
const strike = await STRIKES.findByIdAndUpdate(req.params.strikeid, {validated:true, validatedBy:moderator});
|
|
|
|
|
const strikes = await STRIKES.find({guildID:req.params.id})
|
|
|
|
|
res.render('strikelist.ejs', {strikes, moderator})
|
|
|
|
|
const guild = bot.guilds.cache.get(req.params.id);
|
|
|
|
|
const strikeList = await STRIKES.find({guildID:req.params.id})
|
|
|
|
|
var strikes = [];
|
|
|
|
|
await Promise.all(strikeList.map(async (strike) => {
|
|
|
|
|
var aux = {...strike._doc }
|
|
|
|
|
if(strike.validated)
|
|
|
|
|
{
|
|
|
|
|
if(strike.validatedBy)
|
|
|
|
|
{
|
|
|
|
|
const user = bot.users.cache.get(strike.validatedBy);
|
|
|
|
|
const moderator = {
|
|
|
|
|
username:user.username,
|
|
|
|
|
avatar:user.avatar,
|
|
|
|
|
id:user.id
|
|
|
|
|
};
|
|
|
|
|
aux = {...aux, moderator};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
strikes.push(aux);
|
|
|
|
|
}));
|
|
|
|
|
res.render('strikelist.ejs', {strikes, guild, moderator, params:req.params})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.deleteStrikes = (bot)=>
|
|
|
|
@ -391,8 +409,27 @@ exports.deleteStrikes = (bot)=>
|
|
|
|
|
return async (req,res)=>
|
|
|
|
|
{
|
|
|
|
|
await STRIKES.findByIdAndDelete(req.params.strikeid);
|
|
|
|
|
const strikes = await STRIKES.find({guildID:req.params.id})
|
|
|
|
|
const guild = bot.guilds.cache.get(req.params.id);
|
|
|
|
|
const strikeList = await STRIKES.find({guildID:req.params.id})
|
|
|
|
|
const moderator = req.params.userid;
|
|
|
|
|
res.render('strikelist.ejs', {strikes, moderator})
|
|
|
|
|
var strikes = [];
|
|
|
|
|
await Promise.all(strikeList.map(async (strike) => {
|
|
|
|
|
var aux = {...strike._doc }
|
|
|
|
|
if(strike.validated)
|
|
|
|
|
{
|
|
|
|
|
if(strike.validatedBy)
|
|
|
|
|
{
|
|
|
|
|
const user = bot.users.cache.get(strike.validatedBy);
|
|
|
|
|
const moderator = {
|
|
|
|
|
username:user.username,
|
|
|
|
|
avatar:user.avatar,
|
|
|
|
|
id:user.id
|
|
|
|
|
};
|
|
|
|
|
aux = {...aux, moderator};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
strikes.push(aux);
|
|
|
|
|
}));
|
|
|
|
|
res.render('strikelist.ejs', {strikes, guild, moderator, params:req.params})
|
|
|
|
|
}
|
|
|
|
|
}
|