Skip to content

fix(bot): log a banned member as User Left and keep the roles of a leave - #392

Merged
RedStar071 merged 3 commits into
V7from
fix/member-leave-roles
Nov 10, 2026
Merged

RedStar071 merged 3 commits into
V7from
fix/member-leave-roles

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

Follow-up to #390.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

#390 fixed the leave log of a banned member by removing too much: the User Kicked and User Softbanned footers, the case lookup behind them, their texts, and the roles line of every leave.

A banned member is logged as User Left. A kick and a softban keep their User Kicked and User Softbanned footers. The roles line comes back for a member who left by themselves, and a ban, a kick or a softban does not list roles, since its case in moderation.channel keeps them. The guildMemberBanned text stays in the locale file, unused for now.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. AI open source policy.


Read this PR faster    Follow each request

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge with the previously accepted logging limits.

Reviews (3) · Last reviewed commit: "Merge branch 'V7' into fix/member-leave-..." · Reviewed by Greptile

…ber who left

#390 removed the case lookup and the texts of a kick and a softban, and every roles line.
A ban now says User Left, and only a member who left by themselves lists their roles.
@coldtea-pr-lens

coldtea-pr-lens Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
  • Redraw · drawn at 5df21fe, the branch has moved on

Architecture

Walkthrough of Role mentions on voluntary leave logs and distinct moderation footers, in three steps

Read this PR faster


Data flow

Data flow diagram for wolfstar-project/wolfstar at 5df21fe

Follow each request


Review

✨ Nothing new to flag · reviewed 5df21fe


Tip

Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."

🪧 More tips
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture… row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion
  • Set github.description: false in .github/pr-lens.yml to stop PR Lens adding buttons to your PR descriptions

Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it.  Star PR Lens on GitHub

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the full single-commit diff of #392, checked against formatRoleMentions, fetchMemberRoleIds and ModerationManager.getLatestRecentCachedEntryForUser.

  • Leave footer: rawMemberRemoveNotify looks up the latest recent case again. Kick gives User Kicked, softban gives User Softbanned, and ban or no case gives User Left.
  • Roles line: it is shown only for a member who left by themselves. formatRoleMentions returns null for no roles, so the description stays one line. A ban, kick or softban leaves roles to its case.
  • Locale and types: guildMemberKicked, guildMemberSoftBanned and guildMemberRemoveRoles return to guilds-members.json and i18next.d.ts. guildMemberBanned stays unused, as the description says.
  • Docs and tests: the AGENTS.md bullet matches the new behavior, and memberLogs.test.ts covers the footer per case type, the roles line on and off, and an uncached member.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

A case from before the member joined no longer labels the leave, and /ban and /softban
hold the moderation lock when the leave log is on, as /kick does.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes: the delta since the prior pullfrog review (5df21fe), one commit tying the leave log to the case of the current stay.

  • Case matched to this stay: isModerationAction takes joinedTimestamp and ignores a case created before the member joined, so a kick followed by a quick rejoin and voluntary leave logs User Left with roles. With no join time (-1) the case is trusted.
  • Locks for the leave log: /ban add and /softban now take the moderation lock when logsMemberRemove is set (as /kick already did), so waitLock() in the listener sees their case.
  • Tests: mockLatestCase accepts a createdAt, and a new table test covers a kick case made before and after the member joined.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@github-project-automation github-project-automation Bot moved this from Todo to Review Approved in Wolfstar Nov 10, 2026
@RedStar071
RedStar071 merged commit 31db34d into V7 Nov 10, 2026
8 checks passed
@RedStar071
RedStar071 deleted the fix/member-leave-roles branch November 10, 2026 19:15
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants