Implement limbomode command

This commit is contained in:
2026-08-22 18:22:27 -04:00
parent 20465abcaa
commit a744a95307
2 changed files with 21 additions and 2 deletions
+10 -2
View File
@@ -1,7 +1,7 @@
import type { Guild, GuildMember, Collection, RoleCreateOptions } from "discord.js";
export default abstract class RoleService {
static readonly ROLES: Record<string, RoleCreateOptions> = {
static readonly ROLES = {
// Main
"ROBOT": {
name: "robot",
@@ -47,10 +47,12 @@ export default abstract class RoleService {
"LIMBO": {
name: "limbo",
}
};
} satisfies Record<string, RoleCreateOptions>;
static readonly STARTER_ROLES = [RoleService.ROLES["LURKER"], RoleService.ROLES["NEWFAG"]];
public static limboMode = false;
static validate(guilds: Collection<string, Guild>): void {
guilds.forEach(guild => {
const missing = Object.values(RoleService.ROLES).filter(role => !this.getRoleByName(guild, role.name));
@@ -83,6 +85,12 @@ export default abstract class RoleService {
console.error(`Failed to add starter role: ${role.name}`, err);
}
}
if (this.limboMode) {
const limboRole = this.getRoleByName(guildMember.guild, this.ROLES["LIMBO"].name)
if (!limboRole) return;
await guildMember.roles.add(limboRole);
}
}
static getRoleByName(guild: Guild, roleName?: string) {