From 66e39cbea94629a7d358329b141961f785059faf Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Sun, 27 Aug 2023 15:13:04 -0600 Subject: [PATCH] Allow multiple images on pins, closes #161 --- jarvis/cogs/extra/pinboard.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/jarvis/cogs/extra/pinboard.py b/jarvis/cogs/extra/pinboard.py index bb8cbd9..6483eb0 100644 --- a/jarvis/cogs/extra/pinboard.py +++ b/jarvis/cogs/extra/pinboard.py @@ -228,13 +228,12 @@ class PinboardCog(Extension): content = message.content attachments = message.attachments - image_url = None + image_urls = [] if attachments: for attachment in attachments: if attachment.content_type in supported_images: - image_url = attachment.url - break - if not content and image_url: + image_urls.append(attachment.url) + if not content and len(image_urls) > 0: content = "\u200b" embed = build_embed( @@ -250,8 +249,8 @@ class PinboardCog(Extension): icon_url=message.author.avatar.url, ) embed.set_footer(text=ctx.guild.name + " | " + channel.name) - if image_url: - embed.set_image(url=image_url) + if len(image_urls) > 0: + embed.set_images(*image_urls) star_components = Button( style=ButtonStyle.DANGER, emoji="🗑️",