Implement automatic deletion of bot messages after configurable period #341
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