Skip to content

Commit b4aa82c

Browse files
authored
fix: nested options and choices (#961)
1 parent 89e349f commit b4aa82c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

interactions/client/models/command.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,16 @@ def __attrs_post_init__(self):
140140
self._json.pop("converter", None)
141141

142142
# needed for nested classes
143-
self.options = (
144-
[Option(**option) if isinstance(option, dict) else option for option in self.options]
145-
if self.options is not None
146-
else None
147-
)
143+
if self.options is not None:
144+
self.options = [
145+
Option(**option) if isinstance(option, dict) else option for option in self.options
146+
]
147+
self._json["options"] = [option._json for option in self.options]
148+
if self.choices is not None:
149+
self.choices = [
150+
Choice(**choice) if isinstance(choice, dict) else choice for choice in self.choices
151+
]
152+
self._json["choices"] = [choice._json for choice in self.choices]
148153

149154

150155
@define()

0 commit comments

Comments
 (0)