Skip to content

feature/capr-26-port-privacy-policy-command - #59

Closed
belofe wants to merge 3 commits into
developfrom
Port-Privacy-Policy-Command
Closed

feature/capr-26-port-privacy-policy-command#59
belofe wants to merge 3 commits into
developfrom
Port-Privacy-Policy-Command

Conversation

@belofe

@belofe belofe commented Feb 3, 2026

Copy link
Copy Markdown

Add privacy policy command

Summary by Sourcery

New Features:

  • Introduce a /privacy slash command that shows an embedded summary of the bot's privacy policy, data collection, storage, access, and deletion practices.

@sourcery-ai

sourcery-ai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new Discord cog that exposes a /privacy slash command, returning an ephemeral embed describing the bot’s privacy policy and data handling practices.

Sequence diagram for /privacy slash command handling

sequenceDiagram
  actor User
  participant DiscordClient
  participant DiscordAPI
  participant Bot
  participant PrivacyCog

  User->>DiscordClient: Open_slash_commands
  User->>DiscordClient: Select_/privacy_and_submit
  DiscordClient->>DiscordAPI: Send_interaction_request
  DiscordAPI->>Bot: Deliver_interaction
  Bot->>PrivacyCog: Invoke_privacy(interaction)
  PrivacyCog->>PrivacyCog: Build_privacy_embed
  PrivacyCog->>DiscordAPI: interaction.response.send_message(ephemeral_embed)
  DiscordAPI->>DiscordClient: Send_ephemeral_message
  DiscordClient->>User: Display_ephemeral_privacy_embed
Loading

Class diagram for the new Privacy cog

classDiagram
  class Bot {
  }

  class Privacy {
    - bot : commands.Bot
    - log : logging.Logger
    + __init__(bot)
    + privacy(interaction)
  }

  class setup {
    + setup(bot)
  }

  Bot <|.. Privacy : uses
  setup ..> Privacy : creates_instance
Loading

File-Level Changes

Change Details Files
Introduce a Privacy cog with a slash command that returns an ephemeral privacy policy embed.
  • Create a new Privacy commands.Cog that stores the bot instance and initializes a logger
  • Register an /privacy app_commands.command handler on the cog that builds a rich embed describing collected data, storage, access, usage, and deletion options
  • Configure the command response to be ephemeral and include fields, formatting, and a footer timestamp for the policy
  • Add an async setup function that registers the Privacy cog with the bot
capy_discord/exts/tools/privacy.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue, and left some high level feedback:

  • The hard-coded privacy policy text and 'Last updated: February 2024' date may become stale; consider pulling this content from a central configuration or constants module so it can be updated without code changes.
  • In the '👥 Data Access' field, the concatenated strings 'Your information is never shared with third parties' and 'or used for marketing purposes.' are missing a space between them; use an explicit space or single multiline string to avoid formatting glitches.
  • The logging of 'Privacy cog initialized' in the constructor will trigger on every cog load; if this is primarily for debugging, consider lowering the log level or removing it to avoid noisy logs in production.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The hard-coded privacy policy text and 'Last updated: February 2024' date may become stale; consider pulling this content from a central configuration or constants module so it can be updated without code changes.
- In the '👥 Data Access' field, the concatenated strings 'Your information is never shared with third parties' and 'or used for marketing purposes.' are missing a space between them; use an explicit space or single multiline string to avoid formatting glitches.
- The logging of 'Privacy cog initialized' in the constructor will trigger on every cog load; if this is primarily for debugging, consider lowering the log level or removing it to avoid noisy logs in production.

## Individual Comments

### Comment 1
<location> `capy_discord/exts/tools/privacy.py:79-80` </location>
<code_context>
+                "• Event participation management\n"
+                "• Academic program coordination\n"
+                "• Communication within organizations\n\n"
+                "Your information is never shared with third parties"
+                "or used for marketing purposes."
+            ),
+            inline=False,
</code_context>

<issue_to_address>
**issue (bug_risk):** Fix missing space between concatenated string literals in the privacy text.

These adjacent literals are concatenated, producing `third partiesor used...`. Add a space at the end of the first or the start of the second string to correct the text.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +79 to +80
"Your information is never shared with third parties"
"or used for marketing purposes."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Fix missing space between concatenated string literals in the privacy text.

These adjacent literals are concatenated, producing third partiesor used.... Add a space at the end of the first or the start of the second string to correct the text.

@belofe belofe changed the title Port privacy policy command feature/capr-26-port-privacy-policy-command Feb 3, 2026
@belofe belofe closed this Feb 3, 2026
@belofe
belofe deleted the Port-Privacy-Policy-Command branch February 3, 2026 22:23
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