Skip to content

Commit 0362239

Browse files
committed
fix: update default return value for unknown sticker formats
1 parent caa3041 commit 0362239

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

discord/enums.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,15 +636,14 @@ class StickerFormatType(Enum):
636636
gif = 4
637637

638638
@property
639-
def file_extension(self) -> str:
639+
def file_extension(self) -> str | None:
640640
lookup: dict[StickerFormatType, str] = {
641641
StickerFormatType.png: "png",
642642
StickerFormatType.apng: "png",
643643
StickerFormatType.lottie: "json",
644644
StickerFormatType.gif: "gif",
645645
}
646-
# TODO: Improve handling of unknown sticker format types if possible
647-
return lookup.get(self, "png")
646+
return lookup.get(self)
648647

649648

650649
class InviteTarget(Enum):
@@ -833,8 +832,8 @@ def from_datatype(cls, datatype):
833832
if issubclass(datatype, float):
834833
return cls.number
835834

836-
from .commands.context import ApplicationContext # noqa: PLC0415
837-
from .ext.bridge import BridgeContext # noqa: PLC0415
835+
from .commands.context import ApplicationContext
836+
from .ext.bridge import BridgeContext
838837

839838
if not issubclass(
840839
datatype, (ApplicationContext, BridgeContext)

0 commit comments

Comments
 (0)