Repository navigation
Add /admin set-level and /admin whois - #33
Merged
Merged
Conversation
set-level makes someone a member, friend or guest through the access store, with an optional reason for the audit log. It refuses admins and bots and says so when nothing would change. whois shows level, source, capabilities and the note, and logs the lookup. Free text is shown as a code span and names are escaped so nothing can render as formatting, a link or a mention. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
8 tasks done
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #26. Builds on the access store (#25) and the admin framework (#24).
What changed
/admin set-level user: level: [reason:](admin, private).levelismember,friendorguest. One command assigns, upgrades and demotes. The reply shows before and after.guestkeeps the person's entry and capabilities (decided in Writable access store: members, friends and capabilities managed by admin commands #25). The reply says the capabilities are kept but inactive.admins.yaml) and bots, each with a clear private message./admin whois user:(admin, private). Level, where it comes from (admins file, members file, or not listed), capabilities (marked inactive for a guest), the note, Discord ID and handle. Bots are shown as bots. Each lookup is logged asadmin.whoiswith who looked up whom.inlineCode(), which shows text as a code span: backticks, control, invisible and bidi characters are removed, and it's length-limited. Names are escaped. Mentions stay disabled.AccessChangegains an optionalreason. The tier labels move tocore/access.tsand are shared with/whoami./admin member setwithnonebecame/admin set-levelwithguest(one level of subcommand, and demotion keeps the entry). Docs updated.Needs a human reviewer
This is the first code that changes who has access (AGENTS.md rule 11): the guard rails (no admins, no bots, no-ops), what is logged, and the sanitising.
Tests
Through the real dispatcher and a real store on a temp folder: denied to member, friend and guest with nothing changed; assign, upgrade, demote, and persistence across a restart; every no-op; admin, bot, unresolved user, bad level and long reason refused; failed write; the audit contents; a demoted person is refused straight away;
whoisfor every source; and hostile notes, names and handles.inlineCodehas its own tests.just checkpasses: lint, types, 604 tests, coverage thresholds.🤖 Generated with Claude Code