We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5ef5c1 commit 0cea688Copy full SHA for 0cea688
interactions/client/utils/input_utils.py
@@ -2,6 +2,7 @@
2
import re
3
import typing
4
from enum import IntFlag
5
+from interactions.models.discord.snowflake import Snowflake
6
from typing import Any, Dict, Union, Optional
7
8
import aiohttp # type: ignore
@@ -25,8 +26,8 @@
25
26
import msgspec.json as json
27
28
def enc_hook(obj: Any) -> int:
- # msgspec doesnt support IntFlags
29
- if isinstance(obj, IntFlag):
+ # msgspec doesnt support IntFlags or interactions.Snowflakes
30
+ if isinstance(obj, (IntFlag, Snowflake)):
31
return int(obj)
32
raise TypeError(f"Object of type {type(obj)} is not JSON serializable")
33
0 commit comments