Skip to content

Commit 5c90a00

Browse files
committed
✨ add unknown sticker format type to StickerFormatType enum
1 parent dacdc70 commit 5c90a00

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

discord/enums.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ class StickerType(Enum):
630630
class StickerFormatType(Enum):
631631
"""Sticker format Type"""
632632

633+
unknown = 0
633634
png = 1
634635
apng = 2
635636
lottie = 3
@@ -642,9 +643,9 @@ def file_extension(self) -> str:
642643
StickerFormatType.apng: "png",
643644
StickerFormatType.lottie: "json",
644645
StickerFormatType.gif: "gif",
646+
StickerFormatType.unknown: "unknown",
645647
}
646-
# TODO: Improve handling of unknown sticker format types if possible
647-
return lookup.get(self, "png")
648+
return lookup.get(self, StickerFormatType.unknown)
648649

649650

650651
class InviteTarget(Enum):
@@ -833,8 +834,8 @@ def from_datatype(cls, datatype):
833834
if issubclass(datatype, float):
834835
return cls.number
835836

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

839840
if not issubclass(
840841
datatype, (ApplicationContext, BridgeContext)

0 commit comments

Comments
 (0)