Skip to content

Added /audit button to reports (moderation)#1499

Open
modwodmm wants to merge 11 commits into
Together-Java:developfrom
modwodmm:develop
Open

Added /audit button to reports (moderation)#1499
modwodmm wants to merge 11 commits into
Together-Java:developfrom
modwodmm:develop

Conversation

@modwodmm

Copy link
Copy Markdown

Adds a button that lets the moderator that clicked it see the audit log of the reported user.
Resolves #1498

@modwodmm modwodmm requested a review from a team as a code owner June 10, 2026 17:15
@Zabuzard

Copy link
Copy Markdown
Member

Please add screenshots of the feature and all edge cases in action, makes reviewing it muuuch easier...^^

@Zabuzard Zabuzard changed the title Button to view reported user's previous warns, mutes and punishments Added /audit button to reports (moderation) Jun 11, 2026
@Zabuzard Zabuzard added enhancement New feature or request priority: normal labels Jun 11, 2026
@modwodmm

Copy link
Copy Markdown
Author

Made some changes as you asked.
Screenshot 2026-06-11 135601
Screenshot 2026-06-11 140912
Screenshot 2026-06-11 141350

@Zabuzard

Copy link
Copy Markdown
Member

(please dont resolve comments urself, let the author of the comment do it as confirmation that they consider it done, thanks)

@modwodmm

modwodmm commented Jun 11, 2026

Copy link
Copy Markdown
Author

sorry I'm kinda new to this pr stuff

@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-15 132418 Screenshot 2026-06-15 132755 Screenshot 2026-06-15 135435

here are the screenshots too

@modwodmm modwodmm requested a review from surajkumar June 15, 2026 10:24
@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-15 132418 Screenshot 2026-06-15 162405

@Zabuzard

Zabuzard commented Jun 15, 2026

Copy link
Copy Markdown
Member

So it shows the last page only now? not sure how i feel about that. the user could have 100 pages and then u show only a single item bc the last page happened to only include one item yet. it should at least show a full page or have buttons i guess. also, shouldnt it be page 1 and not the last? im pretty sure /audit sorts it with the most recent actions shown first, with a full page

@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-15 213759

everything works and the pages turn too I forgot to take screenshot 😭 but tested it and it worked just as intended.

@modwodmm modwodmm requested a review from Zabuzard June 15, 2026 16:59

@surajkumar surajkumar 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.

Small change but the rest of the PR at my glance looks good. Will be happy to provide the second tick on Zabu's approval

return new EmbedBuilder().setTitle("Audit log of **%s**".formatted(user.getName()))
.setAuthor(user.getName(), null, avatarOrDefaultUrl)
.setDescription(createSummaryMessageDescription(actions))
.setDescription(ModerationUtils.createSummaryMessageDescription(actions)) // Redirected

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.

This code comment doesn't seem meaningful enough to keep

@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-15 132418 Screenshot 2026-06-16 163202 Screenshot 2026-06-16 163701

this time I didn't forget to take screenshots for page turning

@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-16 163701 it works I didn't think it would need all the screenshots

Comment thread application/config.json.template
@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-16 163701

Made the changes and also changed the name to .json.template this time sorry for the earlier mistake.

@modwodmm

Copy link
Copy Markdown
Author

and yeah its not the same screenshot every time I take a new one every time I change the code to show that it is tested and works

Comment on lines +269 to +271
.onErrorFlatMap(_ -> event.getHook()
.sendMessage("Could not load audit data for this user.")
.map(msg -> null))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

are you sure that works and doesnt crash when its happening?

@modwodmm

Copy link
Copy Markdown
Author
Screenshot 2026-06-18 113425 Screenshot 2026-06-18 115202

Tested it with "1234567890L" id and it didn't crash just gave the message and also made it ephemeral because Christolis asked it to be ephemeral.

@modwodmm

Copy link
Copy Markdown
Author

and also if you like some name changes tell me, I'm not good at naming.

@modwodmm

Copy link
Copy Markdown
Author

Looked at it thoroughly and changed the names, there might be some that I missed so if any, tell me I'll change them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modmail: Include button on a report to display member's audit log

3 participants