Skip to content

Commit 5fed716

Browse files
committed
Lower attachment urls for image_url check
1 parent e7dbc8d commit 5fed716

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/thread.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def send(self, message, destination=None, from_mod=False, delete_message=T
9393
em.set_author(name=str(author), icon_url=author.avatar_url, url=f'https://{message.id}.id') # store message id in hidden url
9494

9595
image_types = ['.png', '.jpg', '.gif', '.jpeg', '.webp']
96-
is_image_url = lambda u: any(urlparse(u).path.endswith(x) for x in image_types)
96+
is_image_url = lambda u: any(urlparse(u.lower()).path.endswith(x) for x in image_types)
9797

9898
delete_message = not bool(message.attachments)
9999
attachments = list(filter(lambda a: not is_image_url(a.url), message.attachments))

0 commit comments

Comments
 (0)