Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when sending multiple images at once, and error when reacting on confirm thread creation message. #2933

Merged
merged 2 commits into from
Jan 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions core/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ async def delete_message(
await asyncio.gather(*tasks)

async def find_linked_message_from_dm(self, message, either_direction=False):
if either_direction and message.embeds:
if either_direction and message.embeds and message.embeds[0].author.url:
compare_url = message.embeds[0].author.url
compare_id = compare_url.split("#")[-1]
else:
Expand Down Expand Up @@ -915,9 +915,9 @@ async def send(
additional_count = 1

for url, filename, is_sticker in images:
if not prioritize_uploads or (
(url is None or is_image_url(url)) and not embedded_image and filename
):
if (
not prioritize_uploads or ((url is None or is_image_url(url)) and filename)
) and not embedded_image:
if url is not None:
embed.set_image(url=url)
if filename:
Expand All @@ -930,7 +930,7 @@ async def send(
else:
embed.add_field(name="Image", value=f"[{filename}]({url})")
embedded_image = True
elif filename is not None:
else:
if note:
color = self.bot.main_color
elif from_mod:
Expand All @@ -940,11 +940,11 @@ async def send(

img_embed = discord.Embed(color=color)

if url is None:
if url is not None:
img_embed.set_image(url=url)
img_embed.url = url

img_embed.title = filename
if filename is not None:
img_embed.title = filename
img_embed.set_footer(text=f"Additional Image Upload ({additional_count})")
img_embed.timestamp = message.created_at
additional_images.append(destination.send(embed=img_embed))
Expand Down