File tree Expand file tree Collapse file tree
astrbot/core/platform/sources/kook Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,21 +78,34 @@ def from_dict(cls, raw_data: dict):
7878 def from_json (cls , raw_data : str | bytes | bytearray ):
7979 return cls .model_validate_json (raw_data )
8080
81- def to_dict (self , by_alias = False , exclude_none = True ) -> dict :
82- return self .model_dump (by_alias = by_alias , exclude_none = exclude_none )
81+ def to_dict (
82+ self ,
83+ mode : Literal ["json" , "python" ] | str = "python" ,
84+ by_alias = True ,
85+ exclude_none = True ,
86+ exclude_unset = False ,
87+ ) -> dict :
88+ return self .model_dump (
89+ by_alias = by_alias ,
90+ exclude_none = exclude_none ,
91+ mode = mode ,
92+ exclude_unset = exclude_unset ,
93+ )
8394
8495 def to_json (
8596 self ,
8697 indent : int | None = None ,
8798 ensure_ascii = False ,
8899 by_alias = True ,
89100 exclude_none = True ,
101+ exclude_unset = False ,
90102 ) -> str :
91103 return self .model_dump_json (
92104 indent = indent ,
93105 ensure_ascii = ensure_ascii ,
94106 by_alias = by_alias ,
95107 exclude_none = exclude_none ,
108+ exclude_unset = exclude_unset ,
96109 )
97110
98111
You can’t perform that action at this time.
0 commit comments