TJ-Bot
TJ-Bot copied to clipboard
Feat/purge messages upto 24 hrs in current channel
For earlier context related to PR, #945
resolves #912
Workflow
- Message Sent: A user sends a message in a Discord channel.
- Log Message Metadata: The Message Listener detects the new message and logs its metadata into the Database Table.
- Periodic Cleanup: The Cleanup Routine periodically checks the database for messages older than 24 hours and deletes them.
- Database Overload Prevention: The Emergency Brake activates if the database approaches its record limit, preventing spamming and overload.
- Database Size Management: The Record Management Subroutine deletes the oldest records to make space for new entries when nearing the database limit for this feature(~7.5k records).
Includes
- Database Table: Tracks message metadata.
- Cleanup Routine: Removes records older than 24 hours.
- Message Listener: Logs new messages into the database.
- New Package: Dedicated to the feature.
-
New Command:
/purge-in-channel. - Issue Resolution: Resolves #912.
Additions
- Emergency Brake: Prevents spamming DB after cetain limit.
- Record Management Subroutine: Deletes oldest records to free up DB limit for this feature once triggered.
Command Interface
when there's no records:
if there's any records within selected duration:
Note: Duration is optional, if skipped it defaults to last hour.
converting this PR to draft, feel like it needs a bit of refactoring considering moderation usecase per channel basis might not be suited anymore.
It appears that this has been inactive for some time, and since you also mentioned that we would not necessarily need something like this as a feature in the server, I will close the PR for the time being. Feel free to reopen this at any time if you wish to continue work on it.