From a0fa657fdb25e83b5775fdbb76091d7330486a55 Mon Sep 17 00:00:00 2001 From: UK <41271523+NeloBlivion@users.noreply.github.com> Date: Mon, 12 May 2025 20:08:03 +0100 Subject: [PATCH 1/4] Update sticker.py Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com> --- discord/sticker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/discord/sticker.py b/discord/sticker.py index d204c4b369..c7cf44576d 100644 --- a/discord/sticker.py +++ b/discord/sticker.py @@ -212,7 +212,8 @@ def __init__(self, *, state: ConnectionState, data: StickerItemPayload): self.format: StickerFormatType = try_enum( StickerFormatType, data["format_type"] ) - self.url: str = f"{Asset.BASE}/stickers/{self.id}.{self.format.file_extension}" + base = "https://media.discordapp.net" if self.format is StickerFormatType.gif else Asset.BASE + self.url: str = f"{base}/stickers/{self.id}.{self.format.file_extension}" def __repr__(self) -> str: return f"" @@ -288,7 +289,8 @@ def _from_data(self, data: StickerPayload) -> None: self.format: StickerFormatType = try_enum( StickerFormatType, data["format_type"] ) - self.url: str = f"{Asset.BASE}/stickers/{self.id}.{self.format.file_extension}" + base = "https://media.discordapp.net" if self.format is StickerFormatType.gif else Asset.BASE + self.url: str = f"{base}/stickers/{self.id}.{self.format.file_extension}" def __repr__(self) -> str: return f"" From 0a75e5d614521e5b315c583b460b783eaa6e4e4c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 19:10:08 +0000 Subject: [PATCH 2/4] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/sticker.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/discord/sticker.py b/discord/sticker.py index c7cf44576d..78b4b8c1f4 100644 --- a/discord/sticker.py +++ b/discord/sticker.py @@ -212,7 +212,11 @@ def __init__(self, *, state: ConnectionState, data: StickerItemPayload): self.format: StickerFormatType = try_enum( StickerFormatType, data["format_type"] ) - base = "https://media.discordapp.net" if self.format is StickerFormatType.gif else Asset.BASE + base = ( + "https://media.discordapp.net" + if self.format is StickerFormatType.gif + else Asset.BASE + ) self.url: str = f"{base}/stickers/{self.id}.{self.format.file_extension}" def __repr__(self) -> str: @@ -289,7 +293,11 @@ def _from_data(self, data: StickerPayload) -> None: self.format: StickerFormatType = try_enum( StickerFormatType, data["format_type"] ) - base = "https://media.discordapp.net" if self.format is StickerFormatType.gif else Asset.BASE + base = ( + "https://media.discordapp.net" + if self.format is StickerFormatType.gif + else Asset.BASE + ) self.url: str = f"{base}/stickers/{self.id}.{self.format.file_extension}" def __repr__(self) -> str: From f54a8f82ab422a0a3a36ba91aefaad6997517a48 Mon Sep 17 00:00:00 2001 From: UK <41271523+NeloBlivion@users.noreply.github.com> Date: Mon, 12 May 2025 21:21:59 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d14e3309..a22a9096c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,6 +107,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2767])(https://github.com/Pycord-Development/pycord/pull/2767) - Fixed `Webhook.edit` not working with `attachments=[]`. ([#2779])(https://github.com/Pycord-Development/pycord/pull/2779) +- Fixed GIF-based `Sticker` returning the wrong `url`. + ([#2781])(https://github.com/Pycord-Development/pycord/pull/2781) ### Changed From 26a7389c7b2ec805c5e1f0a332b8e2208a8100ce Mon Sep 17 00:00:00 2001 From: UK <41271523+NeloBlivion@users.noreply.github.com> Date: Mon, 12 May 2025 21:24:45 +0100 Subject: [PATCH 4/4] changelog again --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a22a9096c6..65100c9ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,16 +99,16 @@ These changes are available on the `master` branch, but have not yet been releas ([#2564](https://github.com/Pycord-Development/pycord/pull/2564)) - Fixed `Subscription.renewal_sku_ids` not accepting `None` from the received payload. ([#2709](https://github.com/Pycord-Development/pycord/pull/2709)) -- Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None` +- Fixed `ForumChannel.edit` allowing `default_reaction_emoji` to be `None`. ([#2739](https://github.com/Pycord-Development/pycord/pull/2739)) - Fixed missing `None` type hints in `Select.__init__`. - ([#2746])(https://github.com/Pycord-Development/pycord/pull/2746) + ([#2746](https://github.com/Pycord-Development/pycord/pull/2746)) - Updated `valid_locales` to support `in` and `es-419`. - ([#2767])(https://github.com/Pycord-Development/pycord/pull/2767) + ([#2767](https://github.com/Pycord-Development/pycord/pull/2767)) - Fixed `Webhook.edit` not working with `attachments=[]`. - ([#2779])(https://github.com/Pycord-Development/pycord/pull/2779) + ([#2779](https://github.com/Pycord-Development/pycord/pull/2779)) - Fixed GIF-based `Sticker` returning the wrong `url`. - ([#2781])(https://github.com/Pycord-Development/pycord/pull/2781) + ([#2781](https://github.com/Pycord-Development/pycord/pull/2781)) ### Changed