Implement automatic deletion of bot messages after configurable period#341
Open
Implement automatic deletion of bot messages after configurable period#341
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #38
- Added BOT_MESSAGE_DELETE_DELAY_MINUTES config to control deletion timing - Added BOT_MESSAGE_DELETE_CHATS config for per-chat control - Extended send_msg() to automatically schedule deletion of all bot messages - Enhanced delete_message() to handle both karma and bot message deletions - Maintained backward compatibility with existing karma deletion system - Added comprehensive tests and usage documentation Resolves #38 by allowing bot administrators to configure automatic cleanup of bot messages to reduce chat clutter. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Changes Made
BOT_MESSAGE_DELETE_DELAY_MINUTESandBOT_MESSAGE_DELETE_CHATSconfiguration optionssend_msg()to automatically schedule deletion when enableddelete_message()to handle both karma and general bot messages_should_delete_bot_message()for chat eligibility checkingConfiguration Options
BOT_MESSAGE_DELETE_DELAY_MINUTES
0to disable auto-deletion60(1 hour)BOT_MESSAGE_DELETE_CHATS
CHATS_DELETINGconfiguration[](uses CHATS_DELETING fallback)How It Works
send_msg(), it checks if auto-deletion is enabledBackward Compatibility
✅ Existing karma message deletion (2-second delay) unchanged
✅ If
BOT_MESSAGE_DELETE_DELAY_MINUTES = 0, feature is disabled✅ Existing
CHATS_DELETINGconfiguration respected as fallback✅ No breaking changes to existing API or functionality
Testing
experiments/directoryUsage Examples
Files Modified
python/config.py- Added new configuration optionspython/__main__.py- Enhanced message handling and deletion logicexperiments/- Added test suite and usage documentationFixes #38
🤖 Generated with Claude Code