Skip to content

Conversation

@probablyjassin
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to replace plain usernames with Discord @ mentions in quote embeds to improve user experience by making usernames clickable and notifying mentioned users. However, the implementation has critical bugs that will cause runtime errors.

Key Changes:

  • Modified quote embed generation to use .mention instead of .display_name for authors
  • Removed the @ prefix in the footer text (line 84) since .mention already includes the mention format

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
utils/quoteUtils.py Correctly updated build_quote_embed() to use msg.author.mention (Discord Message objects support this property)
models/database/quoteData.py Incorrectly attempts to use .mention on database User model instances which don't have this property (will cause AttributeError)

embed.set_footer(
text=
f"von @{self.reporter.display_name} ({self.reporter.global_name})"
f"von {self.reporter.mention} ({self.reporter.global_name})"
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mention attribute does not exist on the database User model. The self.reporter is a Tortoise ORM User instance (defined in models/database/userData.py) which only has id, global_name, and display_name fields. To create a Discord mention, you need to manually format it as f"<@{self.reporter.id}>".

Copilot uses AI. Check for mistakes.
content = msg.content[:1024] if msg.content else "[- kein Text -]"
embed.add_field(
name=f"~ {msg.author.display_name}",
name=f"~ {msg.author.mention}",
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mention attribute does not exist on the database User model. The msg.author is a Tortoise ORM User instance (defined in models/database/userData.py) which only has id, global_name, and display_name fields. To create a Discord mention, you need to manually format it as f"<@{msg.author.id}>".

Copilot uses AI. Check for mistakes.
@probablyjassin probablyjassin marked this pull request as draft November 21, 2025 09:47
@probablyjassin
Copy link
Member Author

ah crap dafür müsste man prolly DB-stuff abändern
bleibt deswegen erstmal ein draft

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.

2 participants