Repository navigation
fix(bot): log a banned member as User Left and keep the roles of a leave - #392
Conversation
…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.
Architecture Data flow Review ✨ Nothing new to flag · reviewed Tip Run 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: the full single-commit diff of #392, checked against formatRoleMentions, fetchMemberRoleIds and ModerationManager.getLatestRecentCachedEntryForUser.
- Leave footer:
rawMemberRemoveNotifylooks up the latest recent case again. Kick givesUser Kicked, softban givesUser Softbanned, and ban or no case givesUser Left. - Roles line: it is shown only for a member who left by themselves.
formatRoleMentionsreturnsnullfor no roles, so the description stays one line. A ban, kick or softban leaves roles to its case. - Locale and types:
guildMemberKicked,guildMemberSoftBannedandguildMemberRemoveRolesreturn toguilds-members.jsonandi18next.d.ts.guildMemberBannedstays unused, as the description says. - Docs and tests: the
AGENTS.mdbullet matches the new behavior, andmemberLogs.test.tscovers the footer per case type, the roles line on and off, and an uncached member.
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.
There was a problem hiding this comment.
✅ 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:
isModerationActiontakesjoinedTimestampand ignores a case created before the member joined, so a kick followed by a quick rejoin and voluntary leave logsUser Leftwith roles. With no join time (-1) the case is trusted. - Locks for the leave log:
/ban addand/softbannow take the moderation lock whenlogsMemberRemoveis set (as/kickalready did), sowaitLock()in the listener sees their case. - Tests:
mockLatestCaseaccepts acreatedAt, and a new table test covers a kick case made before and after the member joined.
claude-sonnet-5-5 | 𝕏

🔗 Linked issue
Follow-up to #390.
❓ Type of change
📚 Description
#390 fixed the leave log of a banned member by removing too much: the
User KickedandUser Softbannedfooters, 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 theirUser KickedandUser Softbannedfooters. 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 inmoderation.channelkeeps them. TheguildMemberBannedtext stays in the locale file, unused for now.

Confidence 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