# Feature flags module ## Behavior - no in-memory caching; each check reads from the database - a flag must exist and be globally enabled before any access grant matters - grants can target a guild, a user, or a role ## Main entrypoints - `isFlagEnabled(flagName)` - `hasAccess(flagName, { guildId, userId, memberRoles })` - `createFlag(name, description?)` - `setFlagEnabled(name, enabled)` - `grantAccess(flagName, { guildId?, userId?, roleId? })` - `revokeAccess(accessId)` - `listFlags()` - `listAccess(flagName)` - `deleteFlag(name)` ## Command integration - `bot/lib/handlers/CommandHandler.ts` checks beta commands through this service - if a command does not set `featureFlag`, the slash command name is used as the fallback flag name