Skip to content

Commit 73e7173

Browse files
authored
fix: TypeErrors raised from Reaction events (#2255)
fix try_enum
1 parent 9e4b3ff commit 73e7173

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/raw_models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __init__(
256256
self.burst: bool = data.get("burst")
257257
self.burst_colours: list = data.get("burst_colors", [])
258258
self.burst_colors: list = self.burst_colours
259-
self.type: ReactionType = try_enum(data.get("type", 0))
259+
self.type: ReactionType = try_enum(ReactionType, data.get("type", 0))
260260

261261
try:
262262
self.guild_id: int | None = int(data["guild_id"])
@@ -333,7 +333,7 @@ def __init__(self, data: ReactionClearEmojiEvent, emoji: PartialEmoji) -> None:
333333
self.burst: bool = data.get("burst")
334334
self.burst_colours: list = data.get("burst_colors", [])
335335
self.burst_colors: list = self.burst_colours
336-
self.type: ReactionType = try_enum(data.get("type", 0))
336+
self.type: ReactionType = try_enum(ReactionType, data.get("type", 0))
337337

338338
try:
339339
self.guild_id: int | None = int(data["guild_id"])

0 commit comments

Comments
 (0)