Merge pull request #17 from Payphone-Bot/16-notify-the-user-about-their-successful-report-after-the-preports-embed-was-edited

perf(bot): ⚡ Notify reporter after the `p.reports` embed was edited.
This commit is contained in:
Rafael Bradley
2024-10-20 23:33:15 -03:00
committed by GitHub
+18 -14
View File
@@ -156,8 +156,25 @@ class ReportView(discord.ui.View):
.values_list("user_id", flat=True)
)
if next_report is None:
await interaction.response.edit_message(
content="✅ No reports left, have this cookie 🍪 !!",
embed=None,
view=None,
)
else:
await interaction.response.edit_message(
embed=embeds.ReportEmbed(self.bot, next_report),
view=views.ReportView(self.bot, next_report, total),
)
if len(banned_user_ids) > 0:
profiles = [rs.profile for rs in report.call.call_rss if rs.user_id in banned_user_ids]
profiles = [
rs.profile
for rs in report.call.call_rss
if rs.user_id in banned_user_ids
]
try:
await (await self.bot.get_or_fetch_user(report.reported_by_id)).send(
@@ -178,19 +195,6 @@ class ReportView(discord.ui.View):
except errors.DiscordException:
pass
if next_report is None:
await interaction.response.edit_message(
content="✅ No reports left, have this cookie 🍪 !!",
embed=None,
view=None,
)
return
await interaction.response.edit_message(
embed=embeds.ReportEmbed(self.bot, next_report),
view=views.ReportView(self.bot, next_report, total),
)
@discord.ui.button(label="Decline", style=discord.ButtonStyle.red, row=2)
@transactions.atomic()
async def decline(