generated from nhcarrigan/template
feat: update roles with new server structure
This commit is contained in:
@@ -10,10 +10,6 @@
|
|||||||
"start": "node -r dotenv/config prod/index.js",
|
"start": "node -r dotenv/config prod/index.js",
|
||||||
"test": "echo 'No tests yet!' && exit 0"
|
"test": "echo 'No tests yet!' && exit 0"
|
||||||
},
|
},
|
||||||
"engines": {
|
|
||||||
"node": "22",
|
|
||||||
"pnpm": "9"
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/nhcarrigan/oogie-woogie-boostie-woostie.git"
|
"url": "git+https://github.com/nhcarrigan/oogie-woogie-boostie-woostie.git"
|
||||||
|
|||||||
+21
-7
@@ -1,12 +1,26 @@
|
|||||||
export const colourRoles = [
|
export const colourRoles = [
|
||||||
"883281643098484736",
|
"917603859977867335",
|
||||||
"883283836887261204",
|
"917604691897090079",
|
||||||
"883282544655753268",
|
"917604599790202961",
|
||||||
"883283096378683402",
|
"917604517854470175",
|
||||||
"883283115265642547",
|
"917604326447386634",
|
||||||
"883283650794360852",
|
"917604175792201828",
|
||||||
|
"917604101863407677",
|
||||||
|
"917603791694606356",
|
||||||
"883284117343584298",
|
"883284117343584298",
|
||||||
|
"883283836887261204",
|
||||||
|
"883283650794360852",
|
||||||
|
"883283115265642547",
|
||||||
|
"883283096378683402",
|
||||||
"883284381937065984",
|
"883284381937065984",
|
||||||
|
"883282544655753268",
|
||||||
|
"883281643098484736",
|
||||||
|
"1398924100734287902",
|
||||||
];
|
];
|
||||||
|
|
||||||
export const boosterRole = "712431541531181177";
|
export const qualifiedRoles = [
|
||||||
|
"1398917977641975899",
|
||||||
|
"1457603068391592169",
|
||||||
|
"1458312645009735680",
|
||||||
|
"712431541531181177"
|
||||||
|
]
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { GuildMember } from "discord.js";
|
import { GuildMember } from "discord.js";
|
||||||
|
|
||||||
import { boosterRole, colourRoles } from "../config/roles";
|
import { colourRoles, qualifiedRoles } from "../config/roles";
|
||||||
import { errorHandler } from "../utils/errorHandler";
|
import { errorHandler } from "../utils/errorHandler";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -12,7 +12,7 @@ import { errorHandler } from "../utils/errorHandler";
|
|||||||
*/
|
*/
|
||||||
export const manageRoles = async (newMember: GuildMember): Promise<void> => {
|
export const manageRoles = async (newMember: GuildMember): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
if (!newMember.roles.cache.has(boosterRole)) {
|
if (!qualifiedRoles.some((role) => newMember.roles.cache.has(role))) {
|
||||||
for (const roleId of colourRoles) {
|
for (const roleId of colourRoles) {
|
||||||
const target = newMember.roles.cache.find((role) => role.id === roleId);
|
const target = newMember.roles.cache.find((role) => role.id === roleId);
|
||||||
if (target) {
|
if (target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user