Nexora
A Discord role-management bot built around set operations - find who has every one of a set of roles, who has either of two, or diff two members' roles directly.
Why it exists
A Discord server with a lot of custom roles - mentors, designers, backend, alumni - has no built-in way to ask "who has all of these roles," "who has either of these," or "what's different between these two people's roles." Nexora treats roles as sets and gives moderators three slash commands to query them directly.
Three commands, three set operations
/convergeIntersection
Give it up to 12 roles and it finds every member who has all of them at once, with an option to ping the matches directly.
/crossroleUnion
Give it two roles and it finds every member who has either one - the wider net, for when 'and' is too strict.
/rolediffSymmetric difference
Give it two members and it shows what's shared, plus exactly what each one has that the other doesn't.
Under the hood
Six real implementation details, pulled straight from the command handlers and the deploy script:
Member sync
guild.members.fetch()
run fresh before every check - Discord's local cache isn't guaranteed complete
AND logic
roleIds.every(id => member.roles.cache.has(id))
/converge - member must hold every selected role
OR logic
cache.has(role1) || cache.has(role2)
/crossrole - member only needs one
Deploy scope
Routes.applicationGuildCommands()
registered to a single guild, not globally
Dedup guard
manualCommands.some(c => c.name === ...)
skips a folder command already defined by hand
Keep-alive
express().listen(port)
stops Render's free tier from spinning the bot down
A solo build in Node.js and discord.js, made for a server that had outgrown manually cross-referencing member lists by hand.