4.7.1 remove @deleted-roles on view
This commit is contained in:
2 files changed
+11
-2
No files matched your search
+10
-1
@@ -45,7 +45,16 @@ module.exports = {
|
|||||||
for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) {
|
for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) {
|
||||||
const guild = client.guilds.cache.get(GuildDB.serverID);
|
const guild = client.guilds.cache.get(GuildDB.serverID);
|
||||||
const role = guild.roles.cache.find(role => role.id == factionID);
|
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}`;
|
if (description == "") description += `> <@&${factionID}> - ${data.armband}`;
|
||||||
else description += `\n> <@&${factionID}> - *${data.armband}*`;
|
else description += `\n> <@&${factionID}> - *${data.armband}*`;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayz-armbands",
|
"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.",
|
"description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user