Message logging - #3
Merged
Merged
Conversation
eggy03
commented
Jun 20, 2025
Owner
- Added the message logging feature to log edited and deleted messages
- Default message retention: 30 days
Introduces message logging functionality, including new slash commands for setting, viewing, and removing message log channels. Adds MessageLogListener to track and log message edits and deletions, storing message content and author in the database. Refactors database connector to support message log operations and updates command names for audit log management. Updates command registration and integrates new listeners in the main application.
Introduced a retrieveMessageId method in DatabaseConnector to check if a message exists in the database. Updated MessageLogListener to exit early if the message ID is not found, preventing unnecessary processing for unlogged messages.
Replaces LogCommandListener with AuditLogCommandListener for audit log channel management, updating all references and registration in FireRun. Refactors DatabaseConnector with clearer method names and adds channel/message registration checks. Enhances message logging in MessageLogListener, including improved handling of message edits and deletions, and clarifies audit log mapping in various listeners.
Moved EmbedBuilder instantiation inside methods in AuditLogCommandListener and MessageLogListener to avoid shared mutable state and potential concurrency issues. Removed unnecessary clearFields() calls and improved code clarity by creating new EmbedBuilder instances for each event.
Added a check to skip logging and database updates when a MessageUpdateEvent is triggered but the message content remains unchanged (such as pin or embed resolve events). This prevents unnecessary log entries and database writes for non-content edits.
Embeds for edited and deleted messages now include the guild name as a footer and the current timestamp. This improves context and traceability in message logs.
Replaced usage of setString and getString with setLong and getLong for guild, channel, author, and message IDs in all database queries and updates. This ensures IDs are handled as numeric types, improving type safety and consistency with the database schema.
Replaces SetupListener with BotSetupListener, providing improved setup instructions and updated command names. Updates BotInfoListener to show server and database locations. Bumps version to 1.1.0 and adds new fields in VersionInfo for server and database locations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.