Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions capy_discord/exts/tools/privacy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
"""Privacy policy cog for displaying data handling information.

This module handles the display of privacy policy information to users.
"""

import logging

import discord
from discord import app_commands
from discord.ext import commands


class Privacy(commands.Cog):
"""Privacy policy and data handling information cog."""

def __init__(self, bot: commands.Bot) -> None:
"""Initialize the Privacy cog.

Args:
bot: The Discord bot instance
"""
self.bot = bot
self.log = logging.getLogger(__name__)
self.log.info("Privacy cog initialized")

@app_commands.command(
name="privacy",
description="View our privacy policy and data handling practices",
)
async def privacy(self, interaction: discord.Interaction) -> None:
"""Display privacy policy and data handling information.

Args:
interaction: The Discord interaction initiating the command
"""
embed = discord.Embed(
title="Privacy Policy & Data Handling",
color=discord.Color.blue(),
description="Here's how we handle your information:",
)

embed.add_field(
name="📝 Data We Collect",
value=(
"**Basic Discord Data:**\n"
"• Discord User ID\n"
"• Server (Guild) ID\n"
"• Channel configurations\n"
"• Role assignments\n\n"
"**Academic Profile Data:**\n"
"• Full name (first, middle, last)\n"
"• School email address\n"
"• Student ID number\n"
"• Major(s)\n"
"• Expected graduation year\n"
"• Phone number (optional)\n"
),
inline=False,
)

embed.add_field(
name="🔒 Data Storage",
value=("• Data is stored in a secure MongoDB database\n• Regular backups are maintained\n"),
inline=False,
)

embed.add_field(
name="👥 Data Access",
value=(
"**Who can access your data:**\n"
"• Club/Organization officers for member management\n"
"• Server administrators for server settings\n"
"• Bot developers for maintenance only\n\n"
"**How your data is used:**\n"
"• Member verification and tracking\n"
"• 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."
Comment on lines +79 to +80

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.").

),
inline=False,
)

embed.add_field(
name="❌ Data Deletion",
value=(
"You can request data deletion through:\n"
"• Contacting the bot administrators\n"
"• Calling /profile delete\n\n"
"Note: Some basic data may be retained for academic records as required."
),
inline=False,
)

embed.set_footer(text="Last updated: February 2024")
await interaction.response.send_message(embed=embed, ephemeral=True)


async def setup(bot: commands.Bot) -> None:
"""Set up the Privacy cog."""
await bot.add_cog(Privacy(bot))