From caa3041375f7c334d185b97fb433607629199d08 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 4 Aug 2025 00:46:57 +0200 Subject: [PATCH 1/5] :memo: CHANGELOG --- CHANGELOG-V3.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG-V3.md b/CHANGELOG-V3.md index eb94407d2e..47eabb568a 100644 --- a/CHANGELOG-V3.md +++ b/CHANGELOG-V3.md @@ -5,6 +5,10 @@ release. ### Added +- Added `StickerFormatType.unknown` for unknown sticker format types instead of + defaulting to `StickerFormatType.png` in + [#58](https://github.com/Pycord-Development/pycord-next/pull/58) + ### Fixed ### Changed From 0362239cdf072ae05ca485bd36ffa96eaeee9180 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 4 Aug 2025 13:34:58 +0200 Subject: [PATCH 2/5] fix: update default return value for unknown sticker formats --- discord/enums.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index 4de87b9ff3..a083b1e820 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -636,15 +636,14 @@ class StickerFormatType(Enum): gif = 4 @property - def file_extension(self) -> str: + def file_extension(self) -> str | None: lookup: dict[StickerFormatType, str] = { StickerFormatType.png: "png", StickerFormatType.apng: "png", StickerFormatType.lottie: "json", StickerFormatType.gif: "gif", } - # TODO: Improve handling of unknown sticker format types if possible - return lookup.get(self, "png") + return lookup.get(self) class InviteTarget(Enum): @@ -833,8 +832,8 @@ def from_datatype(cls, datatype): if issubclass(datatype, float): return cls.number - from .commands.context import ApplicationContext # noqa: PLC0415 - from .ext.bridge import BridgeContext # noqa: PLC0415 + from .commands.context import ApplicationContext + from .ext.bridge import BridgeContext if not issubclass( datatype, (ApplicationContext, BridgeContext) From bfd6d0bf4613c440a10a4d28a59c45cbb775f819 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 4 Aug 2025 13:40:08 +0200 Subject: [PATCH 3/5] :memo: CHANGELOG --- CHANGELOG-V3.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-V3.md b/CHANGELOG-V3.md index 47eabb568a..b7cb4ce04a 100644 --- a/CHANGELOG-V3.md +++ b/CHANGELOG-V3.md @@ -5,8 +5,8 @@ release. ### Added -- Added `StickerFormatType.unknown` for unknown sticker format types instead of - defaulting to `StickerFormatType.png` in +- `StickerFormatType.file_extension` will be `None` instead of `"png"` when an unknown + sticker format is encountered. [#58](https://github.com/Pycord-Development/pycord-next/pull/58) ### Fixed From 1d149ec24d766a6bfe6a619729f4765e1c352c21 Mon Sep 17 00:00:00 2001 From: Paillat Date: Mon, 4 Aug 2025 13:44:51 +0200 Subject: [PATCH 4/5] fing precommit --- discord/enums.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index a083b1e820..780621d9f2 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -832,8 +832,8 @@ def from_datatype(cls, datatype): if issubclass(datatype, float): return cls.number - from .commands.context import ApplicationContext - from .ext.bridge import BridgeContext + from .commands.context import ApplicationContext # noqa: PLC0415 + from .ext.bridge import BridgeContext # noqa: PLC0415 if not issubclass( datatype, (ApplicationContext, BridgeContext) From 049517e858866187bb3cdbd79fff418fb3955ebb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 22:29:16 +0200 Subject: [PATCH 5/5] chore(deps): upgrade pre-commit hook astral-sh/ruff-pre-commit to v0.12.11 (#93) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 909a3d09ae..0eb5126370 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: end-of-file-fixer exclude: \.(po|pot|yml|yaml)$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.9 + rev: v0.12.11 hooks: - id: ruff args: [ --fix ]