From 1cb06134b610565d8ee4dedc487b8bb700073260 Mon Sep 17 00:00:00 2001 From: dolfies Date: Sat, 11 Feb 2023 21:59:04 -0500 Subject: [PATCH] Update application asset paths and remove nonexistant Application.splash --- discord/appinfo.py | 12 ++---------- discord/asset.py | 31 ------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/discord/appinfo.py b/discord/appinfo.py index eec277505..9a51cc8b7 100644 --- a/discord/appinfo.py +++ b/discord/appinfo.py @@ -1740,7 +1740,6 @@ class PartialApplication(Hashable): self._icon: Optional[str] = data.get('icon') self._cover_image: Optional[str] = data.get('cover_image') - self._splash: Optional[str] = data.get('splash') self.terms_of_service_url: Optional[str] = data.get('terms_of_service_url') self.privacy_policy_url: Optional[str] = data.get('privacy_policy_url') @@ -1819,14 +1818,7 @@ class PartialApplication(Hashable): """Optional[:class:`Asset`]: Retrieves the application's cover image, if any.""" if self._cover_image is None: return None - return Asset._from_cover_image(self._state, self.id, self._cover_image) - - @property - def splash(self) -> Optional[Asset]: - """Optional[:class:`Asset`]: Retrieves the application's splash asset, if any.""" - if self._splash is None: - return None - return Asset._from_application_asset(self._state, self.id, self._splash) + return Asset._from_icon(self._state, self.id, self._cover_image, path='app') @property def flags(self) -> ApplicationFlags: @@ -3356,7 +3348,7 @@ class IntegrationApplication(Hashable): """Optional[:class:`Asset`]: Retrieves the application's cover image, if any.""" if self._cover_image is None: return None - return Asset._from_cover_image(self._state, self.id, self._cover_image) + return Asset._from_icon(self._state, self.id, self._cover_image, path='app') @property def primary_sku_url(self) -> Optional[str]: diff --git a/discord/asset.py b/discord/asset.py index 90fde6d2a..63fdac028 100644 --- a/discord/asset.py +++ b/discord/asset.py @@ -264,15 +264,6 @@ class Asset(AssetMixin): animated=False, ) - @classmethod - def _from_cover_image(cls, state: _State, object_id: int, cover_image_hash: str) -> Self: - return cls( - state, - url=f'{cls.BASE}/app-assets/{object_id}/store/{cover_image_hash}.png?size=1024', - key=cover_image_hash, - animated=False, - ) - @classmethod def _from_scheduled_event_cover_image(cls, state: _State, scheduled_event_id: int, cover_image_hash: str) -> Self: return cls( @@ -333,28 +324,6 @@ class Asset(AssetMixin): animated=False, ) - @classmethod - def _from_application_asset(cls, state, app_id: int, hash: str) -> Asset: - animated = hash.startswith('a_') - format = 'gif' if animated else 'png' - return cls( - state, - url=f'{cls.BASE}/app-assets/{app_id}/{hash}.{format}', - key=hash, - animated=animated, - ) - - @classmethod - def _from_astore_asset(cls, state, app_id: int, hash: str) -> Asset: - animated = hash.startswith('a_') - format = 'gif' if animated else 'png' - return cls( - state, - url=f'{cls.BASE}/app-assets/{app_id}/{hash}.{format}', - key=hash, - animated=animated, - ) - @classmethod def _from_achievement_icon(cls, state, app_id: int, achievement_id: int, icon_hash: str) -> Asset: return cls(