4.7.1 remove @deleted-roles on view

This commit is contained in:
SowinskiBraeden committed 2023-02-09 16:34:38 -08:00
1 parent ba27ca573f
commit b0f3130825
2 files changed
+11 -2

No files matched your search

+10 -1
View File
@@ -45,7 +45,16 @@ module.exports = {
for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) {
const guild = client.guilds.cache.get(GuildDB.serverID);
const role = guild.roles.cache.find(role => role.id == factionID);
console.log(role);
if (!role) {
let query = {
$pull: { 'server.usedArmbands': data.armband },
$unset: { [`server.factionArmbands.${factionID}`]: "" },
};
client.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, query, function (err, res) {
if (err) return client.sendInternalError(interaction, err);
});
continue;
}
if (description == "") description += `> <@&${factionID}> - ${data.armband}`;
else description += `\n> <@&${factionID}> - *${data.armband}*`;
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "dayz-armbands",
"version": "4.7.0",
"version": "4.7.1",
"description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.",
"main": "index.js",
"nodemonConfig": {