Skip to content

Gdpr compliance - #13

Merged
cmaureir merged 3 commits into
mainfrom
gdpr-compliance
Aug 15, 2026
Merged

Gdpr compliance#13
cmaureir merged 3 commits into
mainfrom
gdpr-compliance

Conversation

@cmaureir

Copy link
Copy Markdown
Member

No description provided.

New comandos/retencion.py cog, covering two mechanisms:

- A daily background task that deletes rows older than
  config.RETENTION_DAYS (default 30) from every log holding personal
  data (main_log, mod_log, accepted, rejected). Rows with a missing/
  unparseable date are kept rather than guessed-and-deleted. Rows
  pruned from mod_log are also evicted from the live bot.data_mod.
  log_spam_file/log_image_spam_file (the known-spam text/image-hash
  caches) are intentionally excluded - they store only content/hashes,
  never an author, so they aren't personal data to begin with.

- A %olvidar command (restricted to the moderation role) that removes
  every row belonging to a given user from those same logs on request,
  matched by the stable author_id (not the displayed username, which
  can change). Shows a preview of what will be deleted and requires an
  explicit Confirmar/Cancelar button click - re-checked against the
  moderation role at click time, not just at command invocation - before
  doing anything irreversible. The erasure itself is logged to a new
  gdpr_erasure_log.csv (id + counts only, never the erased content), as
  an audit trail that a request was honored.

configuration.py gains RETENTION_DAYS and log_gdpr_file. read_last_csv_row
moved from tests/test_moderacion.py to tests/factories.py for reuse.
Describes what personal data the bot collects, why, retention periods
(30 days for personal data, indefinite for spam signatures since those
aren't personal data), who has access, and how to request erasure via
the new %olvidar command. Explicitly marked as a technical draft that
needs legal review before being published as an official policy, with
placeholders for the actual data controller/contact info.
Was discord.Intents().all() - every intent, including the privileged
Members and Presences ones. Nothing in this codebase uses guild member
chunking, join/leave/update events, or presence data (confirmed via a
full grep). Switched to Intents.default() + message_content = True,
keeping the one privileged intent this bot genuinely needs (every
spam/moderation check reads message.content) and dropping the two it
doesn't. Fewer privileged intents requested means less to justify and
reapply for under Discord's developer policy as the bot grows.
@cmaureir
cmaureir force-pushed the gdpr-compliance branch 2 times, most recently from d8d46c3 to 31a521a Compare August 15, 2026 23:15
@cmaureir
cmaureir merged commit 383a60a into main Aug 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant