(role)
| 49 | } |
| 50 | |
| 51 | export function hasDangerousPermissions(role) { |
| 52 | if (!role || !role.permissions) return false; |
| 53 | |
| 54 | for (const permission of DANGEROUS_PERMISSIONS) { |
| 55 | if (role.permissions.has(permission)) { |
| 56 | return true; |
| 57 | } |
| 58 | } |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | async function validateRoleSafety(client, guildId, roleId) { |
| 63 | const guild = client.guilds?.cache?.get(guildId) || await client.guilds?.fetch?.(guildId).catch(() => null); |
no outgoing calls
no test coverage detected