diff --git a/gdpr_commands.py b/gdpr_commands.py index 78c60b4..6c7ea1f 100644 --- a/gdpr_commands.py +++ b/gdpr_commands.py @@ -2,6 +2,7 @@ import discord from discord import app_commands from discord.ext import commands import aiosqlite +import json from gdpr import check_consent, give_consent, revoke_consent @@ -37,8 +38,7 @@ class GDPRCommands(commands.Cog): "Data is stored securely and only accessible by authorized " "personnel.\n" "You can revoke consent at any time by using the /revoke_consent " - "command.\n" - "For more details, visit our [website](https://example.com/privacy)." # noqa: E501 + "command." ) await interaction.response.send_message(privacy_text) @@ -54,13 +54,20 @@ class GDPRCommands(commands.Cog): row = await cursor.fetchone() if row: notes, strikes = row - data_text = f"Your data:\nNotes: {notes}\nStrikes: {strikes}" - await interaction.user.send(data_text) + data = { + "user_id": user_id, + "notes": notes, + "strikes": strikes + } + data_text = json.dumps(data, indent=4) + await interaction.user.send + (f"Your data:\n```json\n{data_text}\n```") await interaction.response.send_message( "Your data has been sent to you privately." ) else: - await interaction.response.send_message("No data found for you.") # noqa: E501 + await interaction.response.send_message + ("No data found for you.") async def setup(bot): diff --git a/main.py b/main.py index 436dfa9..68d8f0a 100644 --- a/main.py +++ b/main.py @@ -9,8 +9,8 @@ from dotenv import load_dotenv load_dotenv() +GUILD_ID = os.getenv('GUILD_ID') TOKEN = os.getenv('DISCORD_TOKEN') -GUILD_ID = int(os.getenv('GUILD_ID')) intents = discord.Intents.default() intents.message_content = True @@ -25,7 +25,7 @@ class Ariella(commands.Bot): await self.load_extension('commands') await self.load_extension('gdpr_commands') self.tree.copy_global_to(guild=discord.Object(id=GUILD_ID)) - await self.tree.sync(guild=discord.Object(id=GUILD_ID)) + await self.tree.sync() bot = Ariella()