Skip to content

Separate moderator logs from event logs#36

Open
MatthewL246 wants to merge 4 commits intodevfrom
mod-logs
Open

Separate moderator logs from event logs#36
MatthewL246 wants to merge 4 commits intodevfrom
mod-logs

Conversation

@MatthewL246
Copy link
Copy Markdown
Member

@MatthewL246 MatthewL246 commented Aug 4, 2024

Resolves #34

Changes:

This creates a setting for a mod-log channel, which will log moderator events like punishments and slow-mode configuration. The event-log channel will continue to log user events like message updates and deletions.

Message deletions?

I originally wanted to move moderator-deleted messages into the mod-logs channel, but there are a few issues with this.

  • There is not an easy, reliable way to tell if a message deletion event was done by a moderator or a user. The standard way to check this is by fetching the most recent message deletion audit log event, but this is not fully reliable because the event does not contain the message ID. It only contains the message author and channel where the message was sent, so the only way is to make a guess if the most recent event's author and channel ID match.
  • This might make mod-logs too noisy to be useful, so I don't know if it is worth adding this.

This PR is a draft because a decision on how to handle message deletions has not been made yet. Moderator message deletions have been implemented, with certain pitfalls as noted in a comment.

@MatthewL246 MatthewL246 marked this pull request as ready for review August 5, 2024 00:08
@MatthewL246 MatthewL246 marked this pull request as draft August 5, 2024 00:48
@MatthewL246 MatthewL246 marked this pull request as ready for review August 5, 2024 02:40
Comment thread src/util.ts Outdated
wolfendale
wolfendale previously approved these changes Aug 5, 2024
Copy link
Copy Markdown
Contributor

@wolfendale wolfendale left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/util.ts Outdated
Comment thread src/events/messageDelete.ts Outdated
Comment on lines 26 to 44
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.

I do agree with your original message about this not being super great. This looks like it would be very error prone in large servers like ours where tons of messages are deleted all the time. I'm not sure this is worth keeping

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've gone back and forth on this. I think that it is worth trying out, but if the edge case is hit often enough that it causes a significant amount of confusion, it should be removed. I don't know how common it is for users to delete their own messages within 5 minutes of one of theirs getting deleted by a mod.

@MatthewL246 MatthewL246 force-pushed the mod-logs branch 2 times, most recently from 313701f to dddc818 Compare August 10, 2024 02:54
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 5, 2025

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants