Logging All Message Content #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
logger.info(f"Channel: [{str(message.channel)}] User: {str(message.author)} Content: {message.content}")
Issue: Privacy violation, logs sensitive data, creates massive log files.
Fix:
Only log commands or errors, not all message content
if message.content.startswith(('.', '/')):
logger.info(f"Command in {message.channel}: {message.author} - {message.content[:50]}")