Changed Nessa's Image. Fixed the issue with consent that was causing 400 error. Fixed a missed tab in commands that should fix the issue with updating task error

This commit is contained in:
Dan
2024-05-07 09:48:25 -04:00
parent 2aa3b20b6d
commit 02c03fe992
4 changed files with 6 additions and 7 deletions

BIN
Nessa.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 113 KiB

BIN
Nessa.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 KiB

After

Width:  |  Height:  |  Size: 536 KiB

View File

@ -127,7 +127,7 @@ class TaskCommands(app_commands.Group):
logger.error(f"Invalid date or time format provided by user: {ve}")
except Exception as e:
await interaction.response.send_message("An unexpected error occurred. Please try again!", ephemeral=True)
logger.error(f"Unexpected error in update_task_command: {e}")
logger.error(f"Unexpected error in update_task_command: {e}")
@app_commands.command(name="list", description="List tasks for a project.")
async def list_tasks(self, interaction: discord.Interaction, project_id: int):
@ -174,8 +174,6 @@ class ConsentCommands(app_commands.Group):
policy_details = f"""Hi there! So you're looking to hire Nessa, the godess of memory! Let me tell you what you need to know. You need to consent to me storing what you send me in my 'memory' (better known as a database). What I am storing is: Your Disocrd ID, Projects, Tasks, and other data related to your projects. Why I need it? Well, I need your ID so as track your consent to store your data. If I don't have your consent, You can't use my services and your data isn't stored. As far as project and task management is concerned, I store just what you send me. I do not share it with any third-parties. I do not use any external services. I store it in my local 'memory'. Your data is not used for anything else, including but not limited to machine learning. Your data can be removed at any time using the commands. If you wish to opt-out, please use the `/consent opt-out` command. You need anything else, talk to my boss: <@{contact_user_id}> on Discord."""
await interaction.response.send_message(policy_details, ephemeral=True)
class NessaTracker(app_commands.Group, name="nessa", description="Nessa the Project Tracker."):
def __init__(self):
super().__init__()

View File

@ -101,11 +101,11 @@ class Nessa(discord.Client):
consented = await check_user_consent(interaction.user.id)
if not consented:
# If there is no consent, show the consent dialog,
# unless the command is to opt-out, which should be accessible without prior consent.
if interaction.command.name == 'opt-out':
# Allow users to opt-out directly if they mistakenly initiated any command.
# Allow opt-out without consent.
return
# Prompt for consent
view = ConsentView()
await interaction.response.send_message(
"By using the services I, Nessa, provide, you consent to the storage of your data necessary for functionality. Please confirm your consent. See /nessa consent privacy-policy for more details.",
@ -116,11 +116,12 @@ class Nessa(discord.Client):
if view.value:
await store_user_consent(interaction.user.id)
else:
# This is the correct use of followup after the initial response
await interaction.followup.send("Whoops! You have to give me your okay to do store your data before you can use my services!", ephemeral=True)
return # Stop processing if they do not consent
# For opt-in command, check if they're trying to opt-in after opting out.
if interaction.command.name == 'opt-in':
if consented:
# Directly send a response if already consented
await interaction.response.send_message("Hey! Thanks, but you've already opted in.", ephemeral=True)
return