Skip to content

fix(bot): log a banned member as User Left - #390

Merged
RedStar071 merged 1 commit into
V7from
fix/member-leave-log
Nov 9, 2026
Merged

RedStar071 merged 1 commit into
V7from
fix/member-leave-log

Conversation

@RedStar071

@RedStar071 RedStar071 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

None.

❓ Type of change

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

📚 Description

The leave log of a banned member said User Banned and listed the roles the member had. The case of the ban in moderation.channel already tells both, so the log read as a second, wrong report.

A banned member is now logged as User Left. The roles line stays for a member who left by themselves, and a ban, a kick or a softban no longer lists roles, since its case keeps them. A kick and a softban keep their User Kicked and User Softbanned footers. 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: 3/5

The PR should not merge until voluntary leaves retain their roles and kicks and softbans retain their promised labels.

Reviews (6) · Last reviewed commit: "fix(bot): log every member who leaves as..." · Reviewed by Greptile

A kick, a ban or a softban is told by its case in moderation.channel, which keeps the roles,
so the leave log no longer repeats it with another footer and a roles line.
@coldtea-pr-lens

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

Copy link
Copy Markdown

Architecture

Walkthrough of Simplify member leave log to User Left, in three steps

Read this PR faster


Data flow

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

Follow each request


Review

✨ Nothing flagged · reviewed 5bc7666


Tip

Open a diagram on the canvas, then press W or click play to walk through the change one step at a time

🪧 More tips
  • 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."
  • 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
  • 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

Reviewed the single commit on this PR in full.

  • Leave log always User Left — rawMemberRemoveNotify no longer looks up the latest case or the member's roles, so the footer and description are the same whatever made the member leave.
  • Dead locale keys removed — guildMemberBanned, guildMemberKicked, guildMemberSoftBanned and guildMemberRemoveRoles are dropped from en-US/events/guilds-members.json and i18next.d.ts; nothing else in the repo references them, and fetchMemberRoleIds, formatRoleMentions and getLatestRecentCachedEntryForUser still have other callers.
  • Tests and docs — memberLogs.test.ts now checks the footer is User Left for every case type and that a banned member's roles are not listed; the AGENTS.md bullet matches the new behavior.

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 9, 2026
@RedStar071
RedStar071 merged commit 7224352 into V7 Nov 9, 2026
9 checks passed
@RedStar071
RedStar071 deleted the fix/member-leave-log branch November 9, 2026 21:12
@github-project-automation github-project-automation Bot moved this from Review Approved to Done in Wolfstar Nov 9, 2026
@RedStar071 RedStar071 changed the title fix(bot): log every member who leaves as User Left, without their roles fix(bot): log a banned member as User Left, without their roles Nov 10, 2026
@RedStar071 RedStar071 changed the title fix(bot): log a banned member as User Left, without their roles fix(bot): log a banned member as User Left Nov 10, 2026
Comment on lines +37 to 40
const description = t(key, {
user: getUserMentionWithFlagsString(user.flags ?? 0, user.id),
relativeTime: time(seconds.fromMilliseconds(joinedTimestamp), TimestampStyles.RelativeTime)
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Voluntary leaves lose role records

When a cached member leaves voluntarily, rawMemberRemoveNotify now drops their roles along with the roles of banned members. An ordinary leave creates no moderation case, so nothing replaces the removed record. Moderators can no longer use it to restore roles when the member returns. Keep the roles line for voluntary leaves, as the PR description promises.

Greptile automatically discovered a related ticket stating that leave logs should list the member’s roles, which informed this comment.

Source Used: Linear — request: show the roles a member had when they leave or are banned

Prompt To Fix With AI
This is a comment left during a code review.
Path: projects/bot/src/listeners/guilds/members/rawMemberRemoveNotify.ts
Line: 37-40

Comment:
**Voluntary leaves lose role records**

When a cached member leaves voluntarily, `rawMemberRemoveNotify` now drops their roles along with the roles of banned members. An ordinary leave creates no moderation case, so nothing replaces the removed record. Moderators can no longer use it to restore roles when the member returns. Keep the roles line for voluntary leaves, as the PR description promises.

Greptile automatically discovered a related ticket stating that leave logs should list the member’s roles, which informed this comment.

**Source Used:** Linear — [request: show the roles a member had when they leave or are banned](https://linear.app/wolfstar-project/issue/WOL-84/request-show-the-roles-a-member-had-when-they-leave-or-are-banned)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Cursor Fix in Cursor Cloud Agents

.setAuthor(getFullEmbedAuthor(user))
.setDescription(description)
.setFooter({ text: footer })
.setFooter({ text: t('events/guilds-members:guildMemberRemove') })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Kicks look like voluntary leaves

The unconditional guildMemberRemove footer changes kicks and softbans to User Left too. Readers can no longer distinguish those actions from voluntary departures. The PR description explicitly says they should keep User Kicked and User Softbanned.

Preserve those two branches and use User Left for bans and ordinary leaves. The updated test currently expects the same incorrect footer for all four cases.

Prompt To Fix With AI
This is a comment left during a code review.
Path: projects/bot/src/listeners/guilds/members/rawMemberRemoveNotify.ts
Line: 46

Comment:
**Kicks look like voluntary leaves**

The unconditional `guildMemberRemove` footer changes kicks and softbans to `User Left` too. Readers can no longer distinguish those actions from voluntary departures. The PR description explicitly says they should keep `User Kicked` and `User Softbanned`.

Preserve those two branches and use `User Left` for bans and ordinary leaves. The updated test currently expects the same incorrect footer for all four cases.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code Fix in Cursor Fix in Cursor Cloud Agents

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.

1 participant