From 75f052b8c91e91347cfe94b7c5b339311cd941f2 Mon Sep 17 00:00:00 2001 From: Sonic4999 Date: Sat, 28 Aug 2021 18:24:05 -0400 Subject: [PATCH] Prefer `static_format` over `format` with static assets --- discord/asset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/discord/asset.py b/discord/asset.py index c58cfd36..25c72648 100644 --- a/discord/asset.py +++ b/discord/asset.py @@ -313,10 +313,11 @@ class Asset(AssetMixin): if self._animated: if format not in VALID_ASSET_FORMATS: raise InvalidArgument(f'format must be one of {VALID_ASSET_FORMATS}') - else: + url = url.with_path(f'{path}.{format}') + elif static_format is MISSING: if format not in VALID_STATIC_FORMATS: raise InvalidArgument(f'format must be one of {VALID_STATIC_FORMATS}') - url = url.with_path(f'{path}.{format}') + url = url.with_path(f'{path}.{format}') if static_format is not MISSING and not self._animated: if static_format not in VALID_STATIC_FORMATS: -- 2.47.2