Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions interactions/client/models/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,16 @@ def __attrs_post_init__(self):
self._json.pop("converter", None)

# needed for nested classes
self.options = (
[Option(**option) if isinstance(option, dict) else option for option in self.options]
if self.options is not None
else None
)
if self.options is not None:
self.options = [
Option(**option) if isinstance(option, dict) else option for option in self.options
]
self._json["options"] = [option._json for option in self.options]
if self.choices is not None:
self.choices = [
Choice(**choice) if isinstance(choice, dict) else choice for choice in self.choices
]
self._json["choices"] = [choice._json for choice in self.choices]


@define()
Expand Down