From e5a189d9cb2323ba2388691642dc4c67d38fe0e5 Mon Sep 17 00:00:00 2001 From: Dan Date: Sun, 5 May 2024 14:26:58 -0400 Subject: [PATCH] Added a privacy-policy command to Dolly. Also Fixed up How the consent is worded. --- dolly/commands.py | 14 ++++++++++++++ dolly/dolly.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dolly/commands.py b/dolly/commands.py index c040639..070151b 100644 --- a/dolly/commands.py +++ b/dolly/commands.py @@ -4,6 +4,12 @@ from .database import add_project, get_project_id, get_project_name, add_task_to from .consent import check_user_consent, store_user_consent, revoke_user_consent from datetime import datetime import logging +from dotenv import load_dotenv +import os + +load_dotenv() + +contact_user_id = int(os.getenv("AUTHORIZED_USER_ID")) logger = logging.getLogger('Dolly') @@ -122,6 +128,14 @@ class ConsentCommands(app_commands.Group): async def opt_out(self, interaction: discord.Interaction): await revoke_user_consent(interaction.user.id) await interaction.response.send_message("You have opted out of data storage. You will no longer be able to use the bot.", ephemeral=True) + + @app_commands.command(name="privacy-policy", description="View the bot's data handling policy.") + async def privacy_policy(self, interaction: discord.Interaction): + # Replace 'YOUR_USER_ID' with the actual numeric ID of the user 'advtech' + policy_details = f"""Your data, including your Discord ID, task entries, and other related data, is collected for the purpose of providing task management functionalities. All data is stored securely and is not shared with third parties. You can withdraw your consent at any time by using the `/opt-out` command. For any data requests or inquiries, please contact <@{contact_user_id}> on Discord.""" + await interaction.response.send_message(policy_details, ephemeral=True) + + class DollyTracker(app_commands.Group, name="dolly", description="Dolly the Project Tracker."): def __init__(self): diff --git a/dolly/dolly.py b/dolly/dolly.py index 69ec5ce..a5d78c4 100644 --- a/dolly/dolly.py +++ b/dolly/dolly.py @@ -45,7 +45,7 @@ class Dolly(discord.Client): return view = ConsentView() await interaction.response.send_message( - "By using this bot, you consent to the storage of your data necessary for functionality. Please confirm your consent.", + "By using this bot, you consent to the storage of your data necessary for functionality. Please confirm your consent. See /dolly consent privacy-policy for more details.", view=view, ephemeral=True )