feat(roles): lurker builtin template in role editor UI metadata
Reserve lurker name for custom roles and expose read-only Lurker template in builtinRoleTemplates() for server settings parity display. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -24,8 +24,8 @@ function normalizeRoleName (name) {
|
||||
function validateRoleName (name) {
|
||||
const n = normalizeRoleName(name)
|
||||
if (!n || n.length < 2) throw new Error('role name must be at least 2 characters')
|
||||
if (/^(owner|moderator|member)$/i.test(n)) {
|
||||
throw new Error('reserved role name — use builtin promote/demote for moderator')
|
||||
if (/^(owner|moderator|member|lurker)$/i.test(n)) {
|
||||
throw new Error('reserved role name — use builtin role presets in member list')
|
||||
}
|
||||
return n
|
||||
}
|
||||
@@ -261,6 +261,15 @@ class PearcordGuildRoles {
|
||||
color: '#99aab5',
|
||||
permissions: ROLE_PERMISSIONS[MEMBER_ROLES.MEMBER],
|
||||
locked: true
|
||||
},
|
||||
{
|
||||
id: 'builtin:lurker',
|
||||
builtin: true,
|
||||
name: 'Lurker',
|
||||
color: '#72767d',
|
||||
permissions: ROLE_PERMISSIONS[MEMBER_ROLES.LURKER],
|
||||
locked: true,
|
||||
hint: 'Read-only — assign a custom role to grant send permissions'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user