-
-
Notifications
You must be signed in to change notification settings - Fork 40
Fix report regression & add threads to each report #536
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,8 +45,7 @@ async def on_submit(self, interaction: discord.Interaction) -> None: | |
| embed = EmbedCreator.create_embed( | ||
| bot=self.bot, | ||
| embed_type=EmbedCreator.INFO, | ||
| user_name=interaction.user.name, | ||
| user_display_avatar=interaction.user.display_avatar.url, | ||
| user_name="tux", | ||
| title=(f"Anonymous report for {self.short.value}"), # type: ignore | ||
| description=self.long.value, # type: ignore | ||
| ) | ||
|
|
@@ -89,4 +88,9 @@ async def on_submit(self, interaction: discord.Interaction) -> None: | |
| delete_after=30, | ||
| ) | ||
|
|
||
| await report_log_channel.send(embed=embed) | ||
| message = await report_log_channel.send(embed=embed) | ||
| await report_log_channel.create_thread( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Add error handling for thread creation Consider adding a try-except block around the thread creation to handle potential errors, especially since this is an asynchronous operation. This would improve the robustness of the code. |
||
| name=f"Anonymous report for {self.short.value}", # type: ignore | ||
| message=message, | ||
| auto_archive_duration=10080, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Extract magic number to a named constant or configuration value The value 10080 for auto_archive_duration is a magic number. Consider extracting this to a named constant or configuration value for better maintainability and clarity. |
||
| ) | ||
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.
suggestion: Consider using a more generic term for anonymous reports
Instead of hardcoding "tux" as the user name for anonymous reports, consider using a more neutral term like "Anonymous" or "System". This would make the purpose of the change clearer and avoid potential confusion.