Skip to content

Commit

Permalink
Fix image support in compact mode
Browse files Browse the repository at this point in the history
  • Loading branch information
yiays committed Aug 28, 2024
1 parent 54d23fe commit 22a79b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/confessions_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ class ConfessionData:
""" Dataclass for Confessions """
SCOPE = 'confessions' # exists to keep babel happy
anonid:str | None
content:str = ''

def __init__(
self,
Expand Down
4 changes: 3 additions & 1 deletion extensions/confessions_moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async def on_confession_review(self, inter:disnake.MessageInteraction):
guildchannels = get_guildchannels(self.config, inter.guild.id)
channeltype = guildchannels[pendingconfession.targetchannel_id]

if channeltype != ChannelType.marketplace and not pendingconfession.embed:
if not (channeltype == ChannelType.marketplace and pendingconfession.embed):
await pendingconfession.generate_embed(
anonid, channeltype.anonid, pendingconfession.content
)
Expand All @@ -242,6 +242,8 @@ async def on_confession_review(self, inter:disnake.MessageInteraction):
inter.message.attachments[0].content_type.startswith('image')
):
await pendingconfession.download_image(inter.message.attachments[0].url)
elif len(inter.message.embeds) and inter.message.embeds[0].image:
await pendingconfession.download_image(inter.message.embeds[0].image.url)

await pendingconfession.send_confession(inter)

Expand Down

0 comments on commit 22a79b6

Please sign in to comment.