Skip to content

Port Privacy Policy Command - #58

Closed
belofe wants to merge 3 commits into
mainfrom
beloff_branch
Closed

Port Privacy Policy Command#58
belofe wants to merge 3 commits into
mainfrom
beloff_branch

Conversation

@belofe

@belofe belofe commented Feb 3, 2026

Copy link
Copy Markdown

Added privacy cog from deprecated bot to discord bot.

Summary by Sourcery

New Features:

  • Introduce a Privacy cog that provides a /privacy slash command showing the bot's data collection, storage, access, and deletion policies.

@sourcery-ai

sourcery-ai Bot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a new Privacy cog extension that exposes a /privacy slash command to display the bot’s privacy policy via an ephemeral embedded message, and wires it up for cog-based loading.

Sequence diagram for the new /privacy slash command flow

sequenceDiagram
    actor User
    participant DiscordClient
    participant DiscordAPI
    participant Bot as DiscordBot
    participant Privacy as PrivacyCog

    User->>DiscordClient: Trigger /privacy
    DiscordClient->>DiscordAPI: Send interaction
    DiscordAPI->>Bot: POST interaction payload
    Bot->>Privacy: Dispatch to privacy handler
    Privacy->>Privacy: Build privacy Embed
    Privacy->>Bot: interaction.response.send_message(embed, ephemeral=True)
    Bot->>DiscordAPI: Send ephemeral response
    DiscordAPI->>DiscordClient: Deliver ephemeral message
    DiscordClient->>User: Show privacy policy embed
Loading

Updated class diagram for the Privacy cog extension

classDiagram
    class commands_Cog
    class commands_Bot

    class Privacy {
        - bot: commands_Bot
        - log: logging_Logger
        + __init__(bot: commands_Bot)
        + privacy(interaction: discord_Interaction) async
    }

    Privacy ..|> commands_Cog
    commands_Bot o-- Privacy

    class privacy_extension_module {
        + setup(bot: commands_Bot) async
    }

    privacy_extension_module ..> Privacy : add_cog(Privacy(bot))
Loading

File-Level Changes

Change Details Files
Introduce a Privacy cog that exposes a /privacy app command returning an embedded privacy policy message.
  • Create a new cog class that logs initialization and stores a bot reference
  • Define an app_commands-based slash command that builds a rich Discord embed describing data collection, storage, access, and deletion practices
  • Configure the privacy response to be sent as an ephemeral interaction response
  • Add a cog setup function to register 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:

  • In the Data Access embed field, the concatenated string for "Your information is never shared with third parties" and "or used for marketing purposes." is missing a space, so one of the literals should end with a space to avoid rendering as partiesor.
  • The privacy policy content (including the "Last updated" date) is fully hard-coded in the cog; consider centralizing this text in a config or constants module so it can be updated without changing code and redeploying the bot.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the `Data Access` embed field, the concatenated string for "Your information is never shared with third parties" and "or used for marketing purposes." is missing a space, so one of the literals should end with a space to avoid rendering as `partiesor`.
- The privacy policy content (including the "Last updated" date) is fully hard-coded in the cog; consider centralizing this text in a config or constants module so it can be updated without changing code and redeploying the bot.

## 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):** String concatenation here drops the space between "parties" and "or".

These adjacent literals are concatenated as-written, producing `"third partiesor used"`. Add a space to either the end of the first string or the start of the second (e.g., `"third parties "` or `" or used for marketing purposes."`).
</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): String concatenation here drops the space between "parties" and "or".

These adjacent literals are concatenated as-written, producing "third partiesor used". Add a space to either the end of the first string or the start of the second (e.g., "third parties " or " or used for marketing purposes.").

@belofe belofe changed the title Beloff branch Port Privacy Policy Command Feb 3, 2026
@belofe belofe closed this Feb 3, 2026
@belofe
belofe deleted the beloff_branch branch February 3, 2026 21:51
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