Skip to content

Commit

Permalink
Fixed images not appearing in vetted listings
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed Aug 28, 2024
1 parent 61f9610 commit 54d23fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extensions/confessions_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,12 @@ async def on_confession_review(self, inter:disnake.MessageInteraction):
anonid, channeltype.anonid, pendingconfession.content
)

if not pendingconfession.author.dm_channel:
await pendingconfession.author.create_dm()
if (
len(inter.message.attachments) and
inter.message.attachments[0].content_type.startswith('image')
):
await pendingconfession.download_image(inter.message.attachments[0].url)

await pendingconfession.send_confession(inter)

await inter.message.edit(view=None)
Expand All @@ -259,6 +263,8 @@ async def on_confession_review(self, inter:disnake.MessageInteraction):
)
if str(pendingconfession.author_id) not in self.config.get('dm_notifications', '').split(','):
try:
if not pendingconfession.author.dm_channel:
await pendingconfession.author.create_dm()
await pendingconfession.author.send(content)
except disnake.Forbidden:
pass
Expand Down

0 comments on commit 54d23fe

Please sign in to comment.