Skip to content

Improve privacy command formatting - #66

Closed
belofe wants to merge 4 commits into
mainfrom
feature/capr-26-port-privacy-policy-command
Closed

Improve privacy command formatting#66
belofe wants to merge 4 commits into
mainfrom
feature/capr-26-port-privacy-policy-command

Conversation

@belofe

@belofe belofe commented Feb 5, 2026

Copy link
Copy Markdown

Improved the formatting of the privacy command

Summary by Sourcery

Add a dedicated privacy policy cog providing a formatted slash command for viewing data handling information.

New Features:

  • Introduce a /privacy slash command that presents the bot's privacy policy and data handling details via an embed.

Enhancements:

  • Improve the presentation and structure of privacy and data usage information shown to users via an embedded message.

@sourcery-ai

sourcery-ai Bot commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Introduces a new Discord "privacy" slash command cog that presents the bot’s privacy policy and data handling information using a structured embed, and registers it with the bot via an async setup function.

Sequence diagram for the new privacy slash command flow

sequenceDiagram
    actor User
    participant DiscordClient
    participant DiscordAPI
    participant Bot
    participant PrivacyCog

    User->>DiscordClient: Trigger /privacy command
    DiscordClient->>DiscordAPI: Send interaction
    DiscordAPI->>Bot: POST interaction
    Bot->>PrivacyCog: Call privacy(interaction)
    PrivacyCog->>PrivacyCog: Build privacy policy embed
    PrivacyCog->>Bot: interaction.response.send_message(embed, ephemeral=True)
    Bot->>DiscordAPI: Send response payload
    DiscordAPI->>DiscordClient: Deliver ephemeral embed message
    DiscordClient->>User: Display privacy policy embed
Loading

Class diagram for the new Privacy cog

classDiagram
    class Bot {
    }

    class Privacy {
        - bot Bot
        - log Logger
        + Privacy(bot Bot)
        + privacy(interaction Interaction) void
    }

    class Logger {
    }

    class Interaction {
    }

    class SetupModule {
        + setup(bot Bot) void
    }

    Bot <|.. Privacy : uses
    Privacy o-- Logger : has
    Privacy ..> Interaction : uses
    SetupModule ..> Bot : parameter
    SetupModule ..> Privacy : adds cog
Loading

File-Level Changes

Change Details Files
Add a Privacy cog that exposes a /privacy slash command showing structured privacy and data-handling information in an embed.
  • Create a new Privacy commands.Cog that logs initialization and stores the bot reference.
  • Define a /privacy app command that builds a multi-field discord.Embed detailing collected data, storage practices, access, usage, and deletion options, and sends it ephemerally.
  • Register the cog with the bot through an async setup function that adds the Privacy cog.
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 left some high level feedback:

  • The embed field with name='\n' and another with name='Your information is never shared or used for marketing purposes.\n' are a bit awkward; consider using more descriptive field titles and moving full-sentence statements into the value to improve readability and localization later.
  • Logging "Privacy cog initialized" at INFO level in __init__ may be noisy if many cogs behave similarly; consider using DEBUG or centralizing cog-load logging at the bot level instead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The embed field with `name='\n'` and another with `name='Your information is never shared or used for marketing purposes.\n'` are a bit awkward; consider using more descriptive field titles and moving full-sentence statements into the `value` to improve readability and localization later.
- Logging `"Privacy cog initialized"` at INFO level in `__init__` may be noisy if many cogs behave similarly; consider using DEBUG or centralizing cog-load logging at the bot level instead.

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.

@belofe belofe closed this Feb 5, 2026
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