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:
+18
-14
@@ -156,8 +156,25 @@ class ReportView(discord.ui.View):
|
|||||||
.values_list("user_id", flat=True)
|
.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:
|
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:
|
try:
|
||||||
await (await self.bot.get_or_fetch_user(report.reported_by_id)).send(
|
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:
|
except errors.DiscordException:
|
||||||
pass
|
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)
|
@discord.ui.button(label="Decline", style=discord.ButtonStyle.red, row=2)
|
||||||
@transactions.atomic()
|
@transactions.atomic()
|
||||||
async def decline(
|
async def decline(
|
||||||
|
|||||||
Reference in New Issue
Block a user