import { Guild } from 'discord.js'; import { RoleSeperator, RoleSeperatorType, db } from './db'; export const pronouns = new Set([ 'he/him', 'she/her', 'they/them', 'it/its', 'fae/faer', 'no pronouns', 'any pronouns', 'was/were', 'will/would', ]); export function isColorRole(name: string) { return name.startsWith('#') && name.length === 7; } export function isPronounRole(name: string) { return pronouns.has(name); } export async function getRoleSeperator(type: RoleSeperatorType, guild: Guild) { const seperator = await db('roleSeperators') .select('role') .where('guild', guild.id) .where('type', type) .first(); if (seperator) return await guild.roles.fetch(seperator.role); return null; }