-
Notifications
You must be signed in to change notification settings - Fork 0
replace usernames in user facing embeds for quotes with discord @ mentions #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
.mentioninstead of.display_namefor authors - Removed the
@prefix in the footer text (line 84) since.mentionalready 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})" |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
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}>".
| content = msg.content[:1024] if msg.content else "[- kein Text -]" | ||
| embed.add_field( | ||
| name=f"~ {msg.author.display_name}", | ||
| name=f"~ {msg.author.mention}", |
Copilot
AI
Nov 21, 2025
There was a problem hiding this comment.
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}>".
|
ah crap dafür müsste man prolly DB-stuff abändern |
No description provided.