MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / validateRoleId

Function validateRoleId

src/services/reactionRoleService.js:40–49  ·  view source on GitHub ↗
(roleId)

Source from the content-addressed store, hash-verified

38}
39
40function validateRoleId(roleId) {
41 if (!roleId || typeof roleId !== 'string' || !/^\d{17,19}$/.test(roleId)) {
42 throw createError(
43 `Invalid role ID: ${roleId}`,
44 ErrorTypes.VALIDATION,
45 'Invalid role ID provided.',
46 { roleId }
47 );
48 }
49}
50
51export function hasDangerousPermissions(role) {
52 if (!role || !role.permissions) return false;

Callers 2

addReactionRoleFunction · 0.85

Calls 1

createErrorFunction · 0.90

Tested by

no test coverage detected