Skip to content

Message logging - #3

Merged
eggy03 merged 9 commits into
mainfrom
Message-Logging
Jun 20, 2025
Merged

Message logging#3
eggy03 merged 9 commits into
mainfrom
Message-Logging

Conversation

@eggy03

@eggy03 eggy03 commented Jun 20, 2025

Copy link
Copy Markdown
Owner
  • Added the message logging feature to log edited and deleted messages
  • Default message retention: 30 days

eggy03 added 9 commits June 19, 2025 13:51
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.
@eggy03 eggy03 self-assigned this Jun 20, 2025
@eggy03 eggy03 added the enhancement New feature or request label Jun 20, 2025
@eggy03
eggy03 merged commit 93d3bd0 into main Jun 20, 2025
4 checks passed
@eggy03
eggy03 deleted the Message-Logging branch June 20, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant