Allow multiple images on pins, closes #161
This commit is contained in:
parent
4343b67abd
commit
66e39cbea9
1 changed files with 5 additions and 6 deletions
|
@ -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="🗑️",
|
||||
|
|
Loading…
Add table
Reference in a new issue