Skip to content

Commit

Permalink
fix to-external file bridging
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Sep 27, 2024
1 parent df1b5ce commit ef7d641
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cogs/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1763,10 +1763,15 @@ async def to_file(source_file):
else:
attachment_size = source_support.attachment_size(attachment)
content_type = source_support.attachment_type(attachment)
if platform == 'discord':
# already checked for, so skip
is_allowed = True
else:
is_allowed = dest_support.attachment_type_allowed(content_type)
if (
not 'audio' in content_type and not 'video' in content_type and not 'image' in content_type
and not 'text/plain' in content_type and self.__bot.config['safe_filetypes']
) or attachment_size > 25000000 or not dest_support.attachment_type_allowed(content_type):
) or attachment_size > 25000000 or not is_allowed:
continue

try:
Expand Down

0 comments on commit ef7d641

Please sign in to comment.